THE FUTURE MARKETACADEMY
Your classroomRoom 07 · Tech Lab
School of Data & Tech

SQL Basics

What you'll be able to do
  • Explain what a database, a table, a row and a column are.
  • Set up a free practice database on your own computer with SQLite.
  • Write SELECT queries that filter, sort and limit results.
  • Summarize data with COUNT, SUM, AVG, GROUP BY and HAVING.
  • Combine tables with JOIN and LEFT JOIN.
  • Add, change and delete data safely, and know why SQL injection matters.

All queries in this course were tested in SQLite. They also work, with at most small changes, in other databases such as PostgreSQL and MySQL.

Words in this course 35Open the Vocabulary Hall
01

What a database is

In simple words

A database is a super-organized toy box with labelled drawers. Each drawer is a table, like "Customers" or "Orders". SQL is the language you use to ask the toy box for exactly what you want.

Key facts
  • A relational database stores data in tables. Each row is one record (one customer). Each column is one property (name, city).
  • A primary key is a column that uniquely identifies each row, usually id.
  • A foreign key is a column that points to another table's primary key, for example orders.customer_id points to customers.id. This is how tables connect.
  • SQL (Structured Query Language) is the standard language for asking relational databases questions and changing their data. Many people pronounce it "sequel" or "S-Q-L"; both are fine.
  • SQLite is a small, free database that stores a whole database in one file. The SQLite project says it is likely used more than all other database engines combined, and that it is built into every Android device, every iPhone, every Mac, every Windows 10/11 installation and the Firefox, Chrome and Safari browsers.
  • Spreadsheets vs databases: a spreadsheet is great for one person and thousands of rows. A database handles millions of rows, many users at once and strict rules about what data is allowed.
Step by step
  1. Think of a small business you know.
  2. On paper, draw a table called Customers with columns id, name and city.
  3. Mark id as the primary key.
  4. Draw a second table called Orders with columns id, customer_id, product, amount and order_date.
  5. Draw an arrow from Orders.customer_id to Customers.id. That is the foreign key.
  6. Write two sample rows in each table.
  7. Check: you can explain what each row and each column means.
Watch on YouTube
SQLite Tutorial for Beginners in 1 HourTutorialBrain · YouTube · youtube.com

Videos by other creators on YouTube, for reference. They are not made by or affiliated with The Future Market.

LESSON 01What a database is
LESSON 01 / ANIMATED LESSON / AI VOICE00:00 / 01:00
Read the video script
[Host] "Every app you use, from your bank to your phone's contacts, keeps its data in a database."
[Screen: two tables, customers and orders, with an arrow from customer_id to id] "Tables, rows, columns. And keys that link one table to another."
[Text on screen: SQL = Structured Query Language] "SQL is how you ask the database questions. And you're going to write it today."
Try it now

On paper, design two tables for a small business you know: one for customers and one for orders. Mark the primary key in each and the foreign key that links them.

ClaudeStuck? Copy a ready-made prompt for Claude

Copy this, open Claude, paste it, and Claude will walk you through the lesson step by step.

For a grown-up: Claude is for adults (18+). Copy this, paste it into Claude, and use the answer to explain the lesson to your child.

I'm learning "SQL Basics" on The Future Market. Lesson 1: "What a database is".

What the lesson teaches:
- A relational database stores data in tables. Each row is one record (one customer). Each column is one property (name, city).
- A primary key is a column that uniquely identifies each row, usually id.
- A foreign key is a column that points to another table's primary key, for example orders.customer_id points to customers.id. This is how tables connect.
- SQL (Structured Query Language) is the standard language for asking relational databases questions and changing their data. Many people pronounce it "sequel" or "S-Q-L"; both are fine.
- SQLite is a small, free database that stores a whole database in one file. The SQLite project says it is likely used more than all other database engines combined, and that it is built into every Android device, every iPhone, every Mac, every Windows 10/11 installation and the Firefox, Chrome and Safari browsers.
- Spreadsheets vs databases: a spreadsheet is great for one person and thousands of rows. A database handles millions of rows, many users at once and strict rules about what data is allowed.

The exercise I'm working on:
On paper, design two tables for a small business you know: one for customers and one for orders. Mark the primary key in each and the foreign key that links them.

I'm stuck. Please:
1. Explain the main idea in plain, simple words with one everyday example.
2. Walk me through the exercise one small step at a time. Ask me what I've done so far before giving the next step.
3. Don't just give me the final answer. Help me do it myself, and check my work when I share it.
I'm a parent helping my child (about 8 years old) with a lesson called "What a database is" from the course "SQL Basics".

Here's what the lesson says:
A database is a super-organized toy box with labelled drawers. Each drawer is a table, like "Customers" or "Orders". SQL is the language you use to ask the toy box for exactly what you want.

The activity:
On paper, design two tables for a small business you know: one for customers and one for orders. Mark the primary key in each and the foreign key that links them.

Please explain this so an 8-year-old understands: short sentences, a fun everyday example, and no hard words.
Then give me 3 simple questions I can ask my child to check they understood, and a way to do the activity together, one tiny step at a time.
Open Claude
Sources
My notes
02

Set up a practice database

This lesson is part of full access: every course and every level for one payment.

03

SELECT, WHERE, ORDER BY, LIMIT

This lesson is part of full access: every course and every level for one payment.

04

Summaries with COUNT, SUM, AVG and GROUP BY

This lesson is part of full access: every course and every level for one payment.

05

JOIN: connecting tables

This lesson is part of full access: every course and every level for one payment.

06

Changing data safely (and SQL injection)

This lesson is part of full access: every course and every level for one payment.

++

Final project

This lesson is part of full access: every course and every level for one payment.

??

Quiz

  1. What is a primary key?

  2. What does SELECT * mean?

  3. How do you write text values in SQL?

  4. What's the difference between WHERE and HAVING?

  5. What does ORDER BY amount DESC LIMIT 3 return?

  6. What does LEFT JOIN do that JOIN doesn't?

  7. What happens if you run DELETE without WHERE?

  8. How do you find empty values?

  9. What is SQL injection, and how do apps prevent it?

  10. Which free database is built into every Android device and iPhone, according to its makers?

EX

Final exam

This lesson is part of full access: every course and every level for one payment.

CE

Certificate

This lesson is part of full access: every course and every level for one payment.