Computer Science · SQL Queries
A database administrator needs a list of unique cities where students live, without any duplicate rows or counts. Which SQL query is the simplest and correct choice?
- 1SELECT UNIQUE city FROM students WHERE city IS NOT NULL;
- 2SELECT city FROM students ORDER BY city;
- 3SELECT DISTINCT city FROM students;✓
- 4SELECT city FROM students GROUP BY city HAVING COUNT() > 1;
Correct answer
SELECT DISTINCT city FROM students;
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 SQL Queries?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · SQL Queries