Quiz di SQL: ORDER BY & LIMIT

This SQL quiz covers ORDER BY and LIMIT, the clauses behind every "top 5" or "cheapest first" list. You will predict sorted results, break ties with a second column and page through rows with OFFSET.

Facile 10 domande ~5 minuti Superato con il 80% SQLite

Scegli una modalità

Stai giocando come ospite: accedi per salvare XP e serie.

Domanda di esempio

Domanda 1 di 10

What does this query return?

CREATE TABLE products (name TEXT, price INTEGER);
INSERT INTO products VALUES ('Pen', 2), ('Book', 12), ('Mug', 8), ('Lamp', 25), ('Cup', 8);
SELECT name FROM products ORDER BY price LIMIT 1;
Mostra la risposta

B. Pen ORDER BY price sorts from lowest to highest, and LIMIT 1 keeps only the first row, the cheapest product.

Cosa copre questo quiz

  • Sorting with ORDER BY, ASC and DESC
  • Breaking ties with a second sort column
  • Keeping the first rows with LIMIT and skipping rows with OFFSET
  • Sorting by a column alias or position
  • Why LIMIT without ORDER BY gives no guaranteed rows

Domande frequenti

Serve un account?

No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.

Posso rifarlo?

Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.