Your First SELECT
Get every column.
Helen's first question is a simple one. Who works here? Let's answer it with the shortest query in SQL.

- Helen's first question
- Who works here?
- The shortest query in SQL
Show me everything
Read this out loud. Select star, from staff. The word select means, show me. The star means, every column. And from staff says which table to look in. The semicolon at the end means, that's the end of my question. Run it. There are all eight people who work at Riverside Books, with every column.
SELECT * FROM staff;โโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโ โ staff_id โ name โ role โ manager_id โ salary โ โโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโค โ 1 โ Helen Ward โ Owner โ โ 72000 โ โ 2 โ Marcus Lee โ Store Manager โ 1 โ 54000 โ โ 3 โ Priya Nair โ Online Manager โ 1 โ 56000 โ โ 4 โ Tom Baker โ Bookseller โ 2 โ 31000 โ โ 5 โ Sara Odum โ Bookseller โ 2 โ 32000 โ โ 6 โ Leo Grant โ Warehouse โ 3 โ 29000 โ โ 7 โ Amy Chen โ Web Support โ 3 โ 33000 โ โ 8 โ Noah Price โ Bookseller โ 2 โ 30500 โ โโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโ
The two words you always need
Almost every query starts with two parts. Select says which columns you want. From says which table they come from. Select, then from. Always in that order. If you remember nothing else today, remember that.
| key | value |
|---|---|
| SELECT | which columns |
| FROM | which table |
| * | every column |
| ; | end of the question |
Quick check
Quick check. Which query shows every column of the books table? Pause and choose. The answer is B. Select star from books. The star means every column, and from books names the table.
Summary
Select star, from a table, shows everything. But most of the time, you don't want everything. Let's learn to pick just the columns you need.
Key takeaways- SELECT shows
- FROM names the table
- * means every column