Tables, rows and columns
What a database is and how SQL talks to it.
A database is a collection of data kept in order so a computer can search it quickly. Most databases store data in tables, which look like spreadsheets. Each row is one thing (one book, one customer) and each column is one fact about it (title, city, price). SQL (Structured Query Language) is the language we use to ask a database questions. You write a query, and the database answers with a small table of results.
SELECT title, author FROM books;This asks the books table for two columns, title and author, for every row. The answer is a new table with 12 rows and 2 columns.
In this course you will use three small databases: a neighborhood library (books, members, loans), an online shop (customers, products, orders, order_items) and a school (students, courses, grades). Every exercise starts from a fresh copy, so you cannot break anything.
SQL keywords like SELECT and FROM are usually written in capital letters so they stand out, but the database does not care. A query ends with a semicolon ;.