Sikau

Databases and SQL · Day 1 · about 20 min

What is a database?

Tables, rows, columns — and your first query.

Where apps keep their memory

Every app you use stores its data in a database: users, orders, messages. The most common kind is a relational database — data in tables of rows and columns, queried with SQL (Structured Query Language). SQL has been around for 50 years and is still one of the most valuable skills in tech.

A very strict spreadsheet: A table is like a spreadsheet tab: columns have names and types, each row is one record. But a database guards its data: types are enforced, rules are checked, and millions of rows can be searched in milliseconds.

SELECT

SELECT * FROM dishes;

SELECT name, price FROM dishes;
  • SQL keywords aren't case-sensitive; writing them in CAPITALS is a common style.
  • Popular databases: PostgreSQL (this course), MySQL, SQLite, SQL Server — the basics are the same in all of them.
  • Your app talks to the database with a driver or an ORM (like Prisma, later).

The rest of this lesson

  • Why not just use files?explain
  • Reading a SELECT out loudexplain
  • How many columns?predict
  • Spreadsheet words, database wordsmatch
  • Your turnwrite code
  • Badge quizquiz
  • What you learnedrecap

Continue this lesson free — run real code in your browser

Continue with Google

See all 17 lessons of Databases and SQL