Which clause would you use in a SELECT statement to limit the display to those employees whose salary is greater then 5000?

  1. ORDER BY SALARY > 5000

  2. GROUP BY SALARY > 5000

  3. HAVING SALARY > 5000

  4. WHERE SALARY > 5000


Correct Option: D
Explanation:

To solve this question, the user needs to know the basic syntax of a SELECT statement in SQL, including the purpose of each clause.

The WHERE clause is used to filter the rows returned by a query based on specified conditions. In this case, we want to limit the display to only those employees whose salary is greater than 5000. Therefore, the correct answer is:

The Answer is: D. WHERE SALARY > 5000

Option A, ORDER BY SALARY > 5000 is incorrect because the ORDER BY clause is used to sort the rows returned by a query in ascending or descending order based on a specified column. It is not used to filter rows based on specific conditions.

Option B, GROUP BY SALARY > 5000 is incorrect because the GROUP BY clause is used to group the rows returned by a query based on one or more columns. It is not used to filter rows based on specific conditions.

Option C, HAVING SALARY > 5000 is incorrect because the HAVING clause is used to filter the rows returned by a query based on conditions that involve aggregate functions, such as SUM, COUNT, AVG, MAX, and MIN. It is not used to filter rows based on specific conditions.

Find more quizzes: