Learn SQL basics to answer questions from data
Six half-hour sessions using SQLBolt's free interactive lessons and a real SQLite database that runs in your browser. You'll build a small coffee shop database and finish by answering ten business questions with your own queries.
Outcome
A file of ten working SQL queries that use SELECT, WHERE, ORDER BY, LIMIT, COUNT, SUM, GROUP BY, and HAVING, each answering a plain-English question correctly.
- Every resource is a real public page our team picked. Our server checks the links; if one ever breaks, tell us and we'll replace it.
- This journey uses SQLite. Other databases (PostgreSQL, MySQL, SQL Server) use the same core SQL, but some details differ, such as LIMIT being TOP in SQL Server.
- SQLite Fiddle keeps data only until you reload the page. Keep setup.sql and answers.sql saved on your computer.
- SQLite Fiddle is hosted by the SQLite project but labeled as not officially supported, so its layout may change.
- 10,000 seconds is a structured starting point. It builds a real first result, not guaranteed expertise.
Outline
- 127:47
Build a sample database in your browser
A 15-row orders table exists in SQLite Fiddle and you can count its rows.
- 227:47
SELECT: pick the columns you want
Pull specific columns, calculate a new column, and list unique values.
- 327:47
WHERE: filter to the rows that matter
Filter rows by number, text, date range, a list, and a pattern.
- 427:47
ORDER BY and LIMIT: sort and take the top
Sort results and pull the top rows.
- 527:46
Totals and groups: COUNT, SUM, GROUP BY
Total, count, and average data, and break totals down by group.
- 627:46
Capstone: answer ten business questions
Ten working queries that filter, sort, group, and total the sample data, each answering a real question.
Capstone
Ten questions, ten queries
A saved SQL file that answers ten plain-English questions about the sample coffee shop data, using filters, sorting, grouping, and totals, with every answer checked.
Sources
- SQL Lesson 10: Queries with aggregates (Pt. 1)
SQLBolt
Not yet verifiedFree - SQL Lesson 11: Queries with aggregates (Pt. 2)
SQLBolt
Not yet verifiedFree - SQL Lesson 2: Queries with constraints (Pt. 1)
SQLBolt
Not yet verifiedFree - SQL Lesson 3: Queries with constraints (Pt. 2)
SQLBolt
Not yet verifiedFree - SQL Lesson 16: Creating tables
SQLBolt
Not yet verifiedFree - SQL Lesson 12: Order of execution of a Query
SQLBolt
Not yet verifiedFree - SQL Lesson 1: SELECT queries 101
SQLBolt
Not yet verifiedFree - SQL Lesson 4: Filtering and sorting Query results
SQLBolt
Not yet verifiedFree - SQLite3 Fiddle
SQLite (official project site)
Not yet verifiedFree