Database Management System · Class 12 · CBSE · Science Computer Science

A relation named Employee has the attributes EmpID, EmpName, Department and Salary. Which SQL query displays the names of employees who belong to the…

Practice question from Database Management System (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

medium · MCQ · Q-BE5DF8

A relation named Employee has the attributes EmpID, EmpName, Department and Salary. Which SQL query displays the names of employees who belong to the IT department, earn more than 50000, and whose names are arranged in ascending alphabetical order?

  1. A.SELECT EmpName FROM Employee WHERE Department = 'IT' AND Salary > 50000 ORDER BY EmpName ASC;Correct answer
  2. B.SELECT EmpName FROM Employee WHERE Department = 'IT' OR Salary > 50000 ORDER BY EmpName ASC;
  3. C.SELECT EmpName FROM Employee WHERE Department = 'IT' AND Salary < 50000 ORDER BY EmpName DESC;
  4. D.SELECT EmpName FROM Employee ORDER BY Department = 'IT' AND Salary > 50000;

Solution

The WHERE clause must require both conditions using AND, and Salary must be greater than 50000. ORDER BY EmpName ASC arranges the selected names alphabetically.

More from Database Management System

All of Database Management System

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed