ควิซ 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.

ง่าย 10 ข้อ ~5 นาที ผ่านที่ 80% SQLite

เลือกโหมด

กำลังเล่นแบบผู้เยี่ยมชม: เข้าสู่ระบบเพื่อเก็บ XP และ streak

ตัวอย่างคำถาม

ข้อ 1 จาก 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;
ดูเฉลย

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

ควิซนี้มีเนื้อหาอะไรบ้าง

  • 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

คำถามที่พบบ่อย

ต้องมีบัญชีไหม?

ไม่ต้อง ใครก็เล่นได้ เข้าสู่ระบบเพื่อเก็บ XP, streak, เหรียญตรา และประวัติ

ทำซ้ำได้ไหม?

ได้ ระบบเก็บคะแนนที่ดีที่สุดไว้ และสลับคำถามกับตัวเลือกใหม่ทุกครั้ง