Home › GATE CSE › computerscience › Database Management Systems › Without an ORDER BY clause, the order of rows re…
Without an ORDER BY clause, the order of rows returned by a SELECT is
Aalways ascending by primary key
Bnot guaranteed; may differ each run
Calways insertion order, oldest row first
Dalways alphabetical on the first column
Answer & Solution
Correct answer: B. not guaranteed; may differ each run
SQL is built on the relational model, where a relation is an unordered set. The DBMS is free to return rows in whatever order is most efficient (which can change as the data grows or the optimiser picks a different plan). To get a predictable order you must say so with ORDER BY.
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