Codele / How software is built
SQL: asking questions of data
SQL is how you ask a database questions. Pick a category and a lowest price, then watch the shop’s table get filtered, trimmed, sorted and counted.
- SELECT picks the columns. FROM names the table. WHERE keeps only rows that pass a test.
- Join tests with AND (both must pass) or OR (either may pass).
- ORDER BY sorts the answer. ASC is lowest first, DESC is highest first.
- COUNT counts the rows that pass, instead of listing them.
- Asking a question never changes the table. It only reads.
Loading the playable lesson…