Open In App
Related Articles

GATE | GATE 2017 MOCK II | Question 56

Improve Article
Improve
Save Article
Save
Like Article
Like

Using the EMPLOYEE table, the following query is issued to generate the name, salary and the salary increased after an appraisal by 25 %. The increased salary for all the employee should be above 25000.

SELECT fname, salary, salary + (salary *0.25) AS "INCREASED_SALARY" 
FROM employee 
WHERE increased_salary > 25000; 

The above query throws an error. What is the reason for the error ?
(A) The parenthesis is missing in the expression used in SELECT statement.
(B) Single quotes must be used to define a column alias.
(C) Column alias cannot be used in the WHERE clause.
(D) Column alias in the WHERE clause must be enclosed within double quotation marks.


Answer: (C)

Explanation: A column alias cannot be used in WHERE clause conditions but can be used in SELECT statement and ORDER BY clause.


Quiz of this Question

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Similar Reads