223k views
0 votes
Rajveer wants to rename column in display result for his query. He has given he

following queries, select correct query for him:
a) select ename, salary*12 Annual Salary from emp;
b) select ename, salary*12 rename “Annual Salary” from emp;
c) select ename, salary * 12 change “Annual Salary” from emp;
d) select ename, salary*12 as “Annual Salary” from emp;

User Alvas
by
7.3k points

1 Answer

3 votes

Answer:

The correct query for Rajveer to rename a column in the display result is:

d) select ename, salary*12 as "Annual Salary" from emp;

Step-by-step explanation:

In SQL, the AS keyword is used to rename a column in the display result.

The correct syntax for renaming a column is to use the AS keyword followed by the new column name.

In the given query, the AS keyword is used to rename the column as "Annual Salary". The new column name is enclosed in double quotes to indicate that it is a string.

Option (a) is incorrect because it does not rename the column.

Option (b) and (c) are incorrect because there is no rename or change keyword in SQL to rename a column.

Option (d) is the correct query as it uses the AS keyword to rename the column in the display result.

Therefore, option (d) is the correct query for Rajveer to rename a column in the display result.

User Badjer
by
7.4k points