ExamVeda
Login
Home
This question belongs to SQL Sql Miscellaneous
Sql Miscellaneous
?

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?

Answer & Solution
Correct Answer: Option B
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.
Examveda
Question posted by Examveda
Community

Join the Discussion

4 Comments
Sreeja Poreddy
Sreeja Poreddy 4 years ago
i think both a&b are true
Gibran Alves
Gibran Alves 4 years ago
I marked a wrong answer, but now I know the difference: between will list the values between 10000 and 25000, example: 10000, 10001, 10002, 10003, ... , 24998, 24999, 25000.

Meanwhile the in clause just select these two values, example: 10000, 25000 -> works like a "or"
Mahendra Pal
Mahendra Pal 8 years ago
only those records fetch which specific salary arguments provided in statement.
Abhishek Thakur
Abhishek Thakur 9 years ago
it matches the list and where we have two items in list. so it is true