Vidyalelo
SQL · Q71

SQL

Programming · SQL · question 71

Q71

Which of the following SQL query is correct for selecting the name of staffs from 'staffinfo' table where salary is 10,000 or 25,000?

A.
SELECT name FROM staffinfo WHERE salary BETWEEN 10000 AND 25000;
B.
SELECT name FROM staffinfo WHERE salary IN (10000, 25000);
Answer
C.
Both A and B
D.
None of the above

Answer: Option B

Solution

Answer: Option B
Solution:
SELECT name FROM staffinfo WHERE salary IN (10000, 25000);

This query correctly selects the names of staff members whose salary is either 10,000 or 25,000. The correct answer is Option B because it selects the names of staffs with salaries of 10,000 or 25,000, as required by the question.