๐Ÿ—„๏ธ

Databases for Kids

intermediate ยท 11 lessons

Store and query data with SQL. Foundations every app builder needs.

Try in Applaa Builder โ€” Free

11 lessons

  1. 1

    Your First Database with Python

    A database is a super-organised place to store information permanently. Python has a built-in module called sqlite3 that lets you create and use a database with just a few lines of code โ€” no installation needed! Think of it like a super-powered spreadsheet that lives inside your program.

    3 min10 XPQuiz
  2. 2

    CREATE TABLE โ€” Building Your Blueprint

    Before you store any data, you need to create a table โ€” a blueprint with column names and types. Think of a table like a spreadsheet sheet: you define the columns (name, age, score) and then fill in the rows. The main types are TEXT, INTEGER, REAL (decimal), and BLOB (files).

    3 min10 XPQuiz
  3. 3

    INSERT โ€” Adding Rows to Your Table

    Now that you have a table blueprint, you can fill it with data using INSERT INTO. You can insert one row or many rows at once. Always use placeholders (?) instead of putting values directly in the string โ€” this protects against bugs and security issues.

    3 min10 XPQuiz
  4. 4

    SELECT โ€” Reading Your Data

    Use SELECT to read data from a table. fetchall() returns every matching row as a list of tuples. fetchone() returns just the first match. You can use * to get all columns, or list specific column names.

    3 min10 XPQuiz
  5. 5

    WHERE โ€” Filtering Rows

    The WHERE clause lets you filter rows โ€” only show rows that match a condition. You can compare with =, >, <, >=, <=, and != (not equal). Combine conditions with AND / OR.

    3 min10 XPQuiz
  6. 6

    ORDER BY โ€” Sorting Your Results

    ORDER BY sorts the rows returned by SELECT. Use ASC (ascending, low to high) or DESC (descending, high to low). You can sort by any column โ€” numbers, text (alphabetically), or dates.

    3 min10 XPQuiz
  7. 7

    UPDATE & DELETE โ€” Changing Your Data

    UPDATE changes existing rows. DELETE removes rows. ALWAYS use a WHERE clause with both โ€” otherwise you'll change or delete EVERY row! It's a good habit to check which rows match your WHERE first with a SELECT, then run the UPDATE or DELETE.

    3 min10 XPQuiz
  8. 8

    COUNT, SUM, AVG โ€” Crunching Numbers

    Aggregate functions calculate a single result from many rows. COUNT counts rows, SUM adds numbers up, AVG finds the average, MAX finds the biggest, MIN finds the smallest. They're used in the SELECT part of your query.

    3 min10 XPQuiz
  9. 9

    GROUP BY โ€” Summarising Groups

    GROUP BY groups rows that share a value, then you can run aggregate functions on each group. For example: total points per team, or average score per class. HAVING filters groups (like WHERE, but for groups).

    3 min10 XPQuiz
  10. 10

    JOIN โ€” Connecting Two Tables

    Real apps have multiple tables that relate to each other. JOIN lets you combine rows from two tables based on a matching column. INNER JOIN returns rows that have a match in both tables. You'll use this pattern constantly in real projects.

    3 min10 XPQuiz
  11. 11

    Mini Project โ€” Score Tracker App

    Let's build a complete score-tracking database app! It will store players and their game scores, let you add new scores, find the leaderboard, and show personal bests. This is a real mini-app using everything you've learned.

    3 min10 XPQuiz