Informatics Practices
Rajveer wants to rename column in display result for his query. Select the appropriate query for the same:
- Select Ename, Salary*12 Annual Salary From Emp;
- Select Ename, Salary*12 Rename "Annual Salary" From Emp;
- Select Ename, Salary*12 Change "Annual Salary" From Emp;
- Select Ename, Salary*12 as "Annual Salary" From Emp;
Relational Database
2 Likes
Answer
Select Ename, Salary*12 as "Annual Salary" From Emp;
Reason — The AS
keyword is used to give an alias to a column or expression in the SELECT
statement. In this case, AS "Annual Salary"
is used to rename the column Salary*12
to "Annual Salary" in the display result.
Answered By
1 Like
Related Questions
Shivam wants to see the table structure in MySQL. Select an appropriate command to help him.
- Use
- Show
- Desc
- Display
Rajat wants to delete a primary key constraint from the table. Select an appropriate command to do so.
- Create
- Alter
- Drop
- Delete
The symbol Asterisk (*) in a select query retrieves …………… .
- All data from the table
- Data of primary key only
- NULL data
- None of these
Consider the attributes ( RollNumber, SName, SDateofBirth, GUID ) of the table Student. According to you, which of the following options is the correct representation of the table after executing the following query?
Insert Into Student (RollNumber, SName, SDateofBirth) Values(2, 'Sudha', '2002-02-28') ;
1.
RollNumber SName SDateofBirth GUID 1 Atharv 2003-05-15 12354899 2 Sudha 2002-02-28 NULL 2.
RollNumber SName SDateofBirth GUID 1 Atharv 2003-05-15 12354899 2 Sudha 2002-02-28 00000000 3.
RollNumber SName SDateofBirth GUID 1 Atharv 2003-05-15 12354899 2 Sudha 2002-02-28 0 4.
RollNumber SName SDateofBirth GUID 1 Atharv 2003-05-15 12354899 2 Sudha 2002-02-28