Computer Science · Database Management Systems
To filter main departments based on whether a corresponding sub-department exists in a separate table, which query syntax is appropriate?
- 1SELECT * FROM departments WHERE sub_dept IN (SELECT name FROM sub_depts);✓
- 2SELECT * FROM departments GROUP BY sub_dept;
- 3SELECT * FROM departments ORDER BY sub_dept;
- 4SELECT * FROM departments HAVING sub_dept IS NOT NULL;
Correct answer
SELECT * FROM departments WHERE sub_dept IN (SELECT name FROM sub_depts);
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Database Management Systems?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Database Management Systems