Home › GATE CSE › computerscience › Database 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.
Related questions
The main reasons production DBMSs avoid shadow paging in favour of WAL are that shadow pagWhat is the purpose of a Compensation Log Record (CLR) in ARIES?ARIES recovery is structured as exactlyFuzzy checkpoints differ from naive checkpoints byIn standard log-based recovery, the order of operations isAfter a crash, with checkpointing, the recovery system scans the logA complete log record for a write operation includesPer WAL semantics, a transaction is officially committed at the moment