Skip to main contentSkip to solution

Which of the following SQL statement is correct to rename a column name from NAME to SNAME from 'STUDENT' table while displaying the output?

Solution

✅ Correct Option: 1

The AS keyword creates an alias, which renames a column only in the displayed output. In SELECT NAME as SNAME FROM STUDENT;, the existing column NAME comes first and the new display name SNAME comes after AS.


Option 3: the order is reversed, so it looks for a column SNAME that does not exist in STUDENT.

Options 2 and 4: LIKE is a pattern-matching operator used in a WHERE clause, not for aliasing.

An alias does not change the table itself. To rename the column permanently, use ALTER TABLE.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question