Practice free →
HomeGATE CSEcomputerscienceDatabase Management Systems › If a `student` table has five rows with `city = …

If a `student` table has five rows with `city = 'Pune'`, then `SELECT DISTINCT city FROM student` returns

Aone row with 'Pune'
Bfive rows, all with 'Pune'
Czero rows; DISTINCT requires unique table columns
Dan error; DISTINCT cannot apply to text
Answer & Solution
Correct answer: A. one row with 'Pune'
DISTINCT collapses duplicate result rows into one. Five rows with the same city value collapse to a single 'Pune' row in the output. The underlying table is unchanged; DISTINCT only affects the result set. It works on any data type, including text.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions