Loading

T11 SQL · Lesson 7

Games: Subqueries

Choose the right option, fill in the blanks, write small pieces of code and fix broken ones. Code runs in a safe box inside this page.

Solved 0 of 49 items in this lesson.

1 / 27

ledger.db holds halls (1 Engine Hall, Ines Tappet; 2 Clock Tower, Hakim Verge; 3 Couriers' Yard, Dalia Waybill; 4 Archive, Yusra Hollis) and gauges (id, name, hall_id, reading): 1 boiler (1, 96.5), 2 pump (1, 4.2), 3 fan (1, 1200.0), 4 chimney (3, NULL), 5 pendulum (2, 2.0), 6 kettle (3, 88.0), 7 bell (2, 440.0), 8 valve (1, 4.2), 9 compass (NULL, 270.0). The average of the eight readings is 263.1125. What does this print?

bash
sqlite3 -list ledger.db "SELECT COUNT(*) FROM gauges WHERE reading > (SELECT AVG(reading) FROM gauges);"

Back to the lesson