Structured Query Language (SQL) · Class 12 · CBSE · Science Computer Science

Which SQL query displays each different city name only once from the relation STUDENT?

Practice question from Structured Query Language (SQL) (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

easy · MCQ · Q-A66CEE

Which SQL query displays each different city name only once from the relation STUDENT?

  1. A.SELECT DISTINCT City FROM STUDENT;Correct answer
  2. B.SELECT UNIQUE City FROM STUDENT;
  3. C.SELECT City FROM STUDENT GROUP City;
  4. D.SELECT DIFFERENT City FROM STUDENT;

Solution

The DISTINCT keyword removes duplicate values from the result. Therefore, SELECT DISTINCT City FROM STUDENT; displays every city only once.

More from Structured Query Language (SQL)

All of Structured Query Language (SQL)

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed