98.6k views
0 votes
Can you rename a column in the output of an SQL query?

a) Yes, by using the AS keyword
b) No, column names in the output are fixed
c) Yes, but only by modifying the original table
d) No, renaming is not supported in SQL

User Avrom
by
8.8k points

1 Answer

5 votes

Final answer:

Yes, you can rename a column in the output of an SQL query by using the AS keyword.

Step-by-step explanation:

Yes, you can rename a column in the output of an SQL query by using the AS keyword. The AS keyword allows you to give an alias or a new name to a column in the query result. This can be useful for making the output more readable or concise. For example, you can write a query like:

SELECT column_name AS new_name FROM table_name;

This will rename the column 'column_name' in the output to 'new_name'.

User Leeladam
by
8.1k points