1. Databases and tables
A database is an organised store of data. Inside it, data lives in tables, just like sheets in Excel.
- Each row is one thing: one player, one sale, one train
- Each column is one fact about it: name, team, runs
Our first table is players: made-up cricketers with their matches, runs and wickets. It is sample data for practice, not official statistics. Look at the Tables panel to see its columns and how many rows it has.
You talk to a database in SQL (say “sequel” or “S-Q-L”). The most important command is SELECT. This query shows everything:
SELECT * FROM players;
* means “all columns”, FROM players says which table. The ; ends the statement. SQL keywords are not case-sensitive, but writing them in CAPITALS makes queries easy to read.
-- Sample data for practice,
-- not official statistics.
SELECT * FROM players;
Challenge: Meet the players
Show every column and every row of the players table.