SQL/Query basics 5 min
SELECT queries
Ask a table for the columns you care about.
selectcolumnsbasics
A relational database stores data in tables: rows are records, columns are attributes. You read data with a SELECT statement, which always names the columns first and the table second.
sql · editable
loading editor…
Try it: Add the category column to the output.
The star shorthand returns every column. It is handy while exploring, but in real queries you should name the columns you actually need so the result stays stable when the table changes.
sql · editable
loading editor…
SQL keywords are case-insensitive. Writing them in upper case is a convention that makes queries easier to scan.
practice this