Practice free →
HomeGATE CSEcomputerscienceDatabase 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.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions