Tables, rows and columns
A database is a set of tables, much like a workbook is a set of sheets. Brightwell Supplies keeps everything it knows in one database: its customers, the products it sells, every order, invoice and payment, and its staff.
Each table holds one kind of thing:
customershas one row per customer.productshas one row per product Brightwell sells.ordershas one row per order.
Every row in a table has the same columns. In customers, each row has a name, a city, a
signup_date and so on. A column always holds the same kind of value: text, a number, a date, or
true/false.
Your first query
You ask a database a question by writing a query in SQL. This one shows every row and every
column of the departments table:
SELECT * FROM departmentsRead it as "select everything from departments". The * means "all columns".
SQL doesn't mind whether you write keywords in capitals (SELECT) or not (select). Capitals make
them easier to spot, so this course uses them.
Press Run to see what a query returns. When you think it answers the question, press Submit and it's marked straight away.