
Find out how SQL answers everyday workplace questions, the road this course takes from first ideas to a final project, and which department costs the company most.
Preview the final project: six questions from an HR director, each answered with SQL, a check that the numbers add up and a plain finding, and see why Research goes missing.
See how a lesson runs, from the drawn scene to the notebook, and pick up the habits that help most: guess before each result, type along, and expect your numbers to match.
Download every course file from the GitHub repository as one ZIP, find each section's notebooks, practice files and cheat sheet, and meet the setup script that resets the data.
Get an overview of the words every later section builds on, learned with one small college and its six students, Leena, Maya, Rea, Sofia, Alex and Noah, with no typing.
Watch Leena's paper form turn into a row in a table, and see how a table finds the three students taking Databases at a glance instead of reading every form.
Learn what a database, a DBMS, SQL and MySQL each do as one request travels to the data and back, and why MySQL is the software, not the database itself.
Compare relational, document, key-value and graph databases using the same six students, and match each shape to the job it suits best.
Discover why one big table goes wrong when the Databases fee of 1,250.00 USD sits in three rows, and how separate linked tables store each fact only once.
Name every part of the students table, from row and column down to a single cell, and see which data type fits each column: INT, VARCHAR(60), DATE or DECIMAL(8,2).
Understand a schema as the structure of a database, see campus_lab hold students, courses and enrollments, and learn that schema and database mean the same thing in MySQL.
See how a primary key gives every student a number of their own, and how foreign keys in enrollments refuse a course 999 that does not exist.
Compare MySQL, PostgreSQL, SQL Server, SQLite and DuckDB, from LIMIT versus TOP to a server versus a single file, and see why this course uses MySQL.
Preview the setup ahead: the MySQL server, a choice of three SQL tools, installing and connecting, your first query, saving notebooks, and a short set-up check.
Learn why the MySQL server, which keeps the data, and the SQL tool you type in are two separate programs, and why closing the tool loses no records.
Compare MySQL Workbench, Modern MySQL Workbench and SQL Notebook Studio, which all send the same SQL to the same server, and pick the one you will use.
Download the LTS release of MySQL Community Server, install it with the Typical setup, and use MySQL Configurator to set port 3306, a root password and the Windows service.
Install MySQL Workbench, save a Local MySQL connection on localhost port 3306, test it, and run a one-line SELECT that answers Hello, SQL.
Add Modern MySQL Workbench, a free notebook plugin, to the Workbench you already have, open a notebook on your Local MySQL connection, and run your first cell.
Install VS Code and the free SQL Notebook Studio extension from the VS Code Marketplace, and find its view with the Add Connection button.
Connect SQL Notebook Studio to your local server with host localhost, port 3306 and user root, test it until it reports MySQL 9.7.4, and save the connection.
Tour a SQL Notebook Studio notebook: cells and their run buttons, Markdown notes, results under each cell, Run All, and the connection you check before every run.
Run SELECT with a text literal as your very first command, read the one row it returns, and learn why Ctrl+Alt+Enter, not Ctrl+Enter, runs a cell.
Run three statements in one cell and get three result tabs, then misspell SELECT on purpose and use the near part of the error message to fix it.
Save notebooks in a clear course folder, reopen them and use Run All to bring the results back, and open any .sql file as a SQL notebook.
Check your setup with six short tasks: connect, run and change a hello statement, run three at once, fix an error, then save and reopen your work, with the solution after.
Learn what host, port, user, password and TLS mean, and which of them change when your SQL tool connects to a server on another computer instead of localhost.
Get an overview of building campus_lab yourself, from the first CREATE DATABASE to linked tables with rules, a library challenge, and an AI helper you check line by line.
Meet campus_lab, the small college database you build from nothing, and practice_lab, the throwaway database where anything risky is tried first.
Take one statement apart into keywords, identifiers, values, comments and semicolons, and see what goes wrong when the semicolon between two statements is missing.
List the server's databases with SHOW DATABASES, create campus_lab with CREATE DATABASE, and pick it with USE so the statements that follow work inside it.
Create practice_lab, hit the error when campus_lab is created twice, avoid it with IF NOT EXISTS, read the note with SHOW WARNINGS, and switch between databases.
Choose a column type for each value: INT for IDs, VARCHAR for names, DECIMAL(8,2) for money and DATE for days, and see why numbers stored as text sort wrongly.
Write CREATE TABLE to build the students table with four typed columns and a primary key on student_id, and see what happens when you run it twice.
Inspect your table three ways: SHOW TABLES lists it, DESCRIBE shows each column's type and key, and SHOW CREATE TABLE returns the full statement MySQL stored.
Add Leena to the students table with INSERT INTO, then add the other five students in a single statement with one bracket per row.
Read the six students back with SELECT *, pick just the name and city columns, and preview the first three rows with LIMIT.
Use WHERE to find rows, see a name match two students called Maya, and use the primary key to find exactly one record, or no rows for a number nobody has.
Move Rea from Lisbon to Porto with UPDATE, SET and WHERE, check the change with a SELECT, and see why an UPDATE without WHERE changes every row.
Remove one student with DELETE and check what remains, then turn on the setting that makes SQL Notebook Studio ask before a DELETE with no WHERE.
Change a table's shape with ALTER TABLE: add a country column, rename it, lengthen it with MODIFY COLUMN and drop it again, checking each step with DESCRIBE.
Compare DELETE, TRUNCATE and DROP TABLE on a throwaway copy in practice_lab: chosen rows go, then every row goes, then the table itself is gone.
Read the database name twice, remove practice_lab with DROP DATABASE, and add IF EXISTS so dropping a database that is already gone gives no error.
Make student_id an AUTO_INCREMENT primary key and insert a student without an ID, so MySQL picks the next number, 107, by itself.
Build the courses table with NOT NULL, UNIQUE, DEFAULT and CHECK, add three courses, and watch the rules refuse a missing title, a repeated title and a fee below zero.
Create the enrollments table with two foreign keys, record which student takes which course, and see MySQL refuse an enrollment in course 999.
Diagnose two refused inserts, a duplicate student 103 and a missing course 520, by reading which key the error names and looking before you change anything.
Build library_lab on your own from a ten-step brief: a members table, a loans table linked to it, and rows to add, change and remove, with the solution in its own file.
Run one correct library_lab solution cell by cell, see where your version may differ and still be right, and finish with a short readiness check of your basic SQL.
Install Ollama, download the Qwen 27B model, and connect it to the AI helper in SQL Notebook Studio, so plain English can become SQL on your own computer.
Ask the AI helper for SQL in plain English, repair a misspelled table name with Fix with AI, get a step-by-step Explain, and check every draft before it runs.
Use a free cloud model through OpenRouter as the AI helper, see Gemini as another option, and learn why a free tier is the wrong place for confidential data.
Follow the move from campus_lab to my_db, a made-up company's records, and how you will load, check and explore its tables before you trust them.
Find out why the course moves from your small campus_lab to my_db, an employee database of 6 tables and 3,599 rows that stays the same while you learn.
Meet the company: 10 departments, 500 employees with managers stored as employee IDs, 30 projects with 901 assignments, a salary history, and NULL for missing values.
Read the schema diagram's boxes, gold keys and arrows, and ask three questions of every table: what one row is, which key identifies it, and where its arrows go.
Open my_db_setup.sql as plain text and recognise every statement in it, from DROP DATABASE IF EXISTS to six CREATE TABLE and six INSERT statements, parents first.
Open the setup script as a SQL notebook, switch it to Local MySQL, run all 15 cells, and read the row counts, from 10 departments to 884 change log rows.
Verify the import with SHOW TABLES, DESCRIBE and SHOW CREATE TABLE, read the PRI, UNI and MUL keys, and check the first and last employees, Grace Okafor and Karen Eze.
Find tables, columns and keys in the SQL Notebook Studio tree, use Describe Table and Select Top 100 without typing, and chart project budgets as bars.
Explore departments and employees with SELECT, column lists, WHERE and LIMIT, and see why Kofi's 0.00 commission and Valentina's NULL are not the same.
Follow Wei Chen from his employee row to Finance, to his manager Priya Raman and to his projects, one small query per hop, without writing a single JOIN.
Practise finding your way around my_db with seven tasks, from listing its tables to following one employee to a department, a manager and projects, with the solution after.
Get an overview of turning tables into answers: choosing columns, readable aliases, calculated pay, DISTINCT, ORDER BY, and top lists that return the same rows every time.
Read the 500-row employees table, pin a column while you scroll, and name only the columns a question needs instead of selecting everything.
Give result columns readable headers with AS, see how a forgotten comma quietly turns a column into an alias, and lay out SQL so it reads at a glance.
Work out monthly pay and a 5% raise with arithmetic in SELECT, check the raise against Grace's salary, and confirm that the stored table never changes.
Use DISTINCT to list the departments that really have people, nine of the ten with Research missing, and find the job title combinations in Finance.
Sort departments by name or city, employees by salary from highest down, and by department then salary, and see why grid sorting only covers the rows on screen.
Combine ORDER BY with LIMIT for top lists, see a tie at the cut silently drop Camila, and add a unique tie-breaker so the same rows come back every time.
Write five first reports on your own, from unique job titles and Finance monthly pay to top salaries, recent hires and the biggest project budgets, with solutions after.
Preview what filtering covers: one test every row must pass, combined tests, lists and ranges, name patterns, the unknown answer NULL gives, and mistakes caught by the row count.
Filter employees with WHERE and the six comparison operators, see why >= lets in Lucas Moreau and Mateus Fischer at exactly 150000, and compare WHERE with the grid filter.
Combine tests with AND, OR and NOT, and see how a missing pair of brackets lets all 46 Marketing employees into a list meant for high earners.
Shorten OR chains with IN, exclude cities with NOT IN, and use BETWEEN for inclusive salary and date ranges, like hires from the first three months of 2000.
Search names with LIKE and the % and _ wildcards, from last names starting with Ib to first names ending in ara, and see a pattern catch more than you meant.
Learn why = NULL finds nothing, then use IS NULL and IS NOT NULL to find the 8 Sales Coordinators with no commission and the projects with no end date.
Make common filtering mistakes on purpose, from NULL rows missed by a test and its opposite to unquoted dates and OR 90, and catch each one from the row count.
Answer five selection questions on your own, by department, salary range, name pattern, missing commission and open projects, then compare with the solutions.
Get an overview of SQL functions as small machines that reshape values for a report, from text and numbers to CASE labels and missing values, without changing stored data.
See what a SQL function does, one value in and one value out, by turning Grace into GRACE with UPPER, and confirm that functions never change the stored table.
Build full names and logins like grace.okafor with CONCAT and LOWER, put one function inside another, and remove stray spaces with TRIM.
Cut text with SUBSTRING, swap Head of for Director of with REPLACE, count characters with CHAR_LENGTH, and see why LENGTH counts bytes when a name has an accent.
Round monthly pay with ROUND, CEIL and FLOOR, share people into groups with MOD, and use brackets to fix a raise calculation that divides in the wrong order.
Turn salaries into bands like Top, High, Middle and Entry with CASE, learn why the order of the WHEN tests matters, and see what a missing ELSE leaves behind.
Add a missing commission safely with COALESCE so Valentina's total pay is no longer NULL, and use NULLIF to keep a zero out of a division.
Practise five formatting jobs on your own, from labels and logins for Legal to salary bands and a safe ratio for Sales, then compare with the solutions and the AI helper's query.
Preview the work with dates: storing them, taking them apart, counting completed years from one fixed date, moving dates, and filtering with clear boundaries.
Compare DATE, DATETIME and TIMESTAMP using hire dates and a badge_scans table, and learn which type to choose for a day, a clock time or a recorded moment.
Take dates apart with YEAR and MONTH, write them for readers with DATE_FORMAT, and see why a formatted date sorts as text instead of by the real date.
Count days with DATEDIFF and completed years with TIMESTAMPDIFF, and see why rounding days divided by 365 gives Isabel 5 years when she has completed only 4.
Move dates forward and back with DATE_ADD and DATE_SUB to find probation ends, review dates and recent Sales hires, and see what adding a month to 31 January gives.
Filter badge scans by date and see BETWEEN quietly lose all of 30 November, then use a half-open range that keeps every second of the month.
Answer five HR questions on your own from the fixed date 2005-12-31, from Sales hires in 2003 to completed years and every scan on one day, with solutions after.
Get an overview of turning rows into totals: aggregate functions, three kinds of COUNT, department summaries with GROUP BY, HAVING, shares, and the order a query runs in.
Turn many rows into one value with COUNT, SUM, AVG, MIN and MAX, first on six Sales employees, then for all 95 people in Sales and their 6133500.00 payroll.
Compare COUNT(*), COUNT(column) and COUNT(DISTINCT column), see a NULL commission skipped while a zero is counted, and decide what an average with NULLs is of.
Build department summaries with GROUP BY, from headcount to payroll and average salary, and see why Research makes no group and the result has 9 rows, not 10.
Group by department and job title together, and learn why MySQL refuses a first_name that is neither grouped nor inside an aggregate.
Filter rows with WHERE and groups with HAVING, see why an average in WHERE fails, and find departments averaging over 70000 or with at least five high earners.
Count the rows that pass a test inside each group with SUM and CASE, turn counts into percentages, and use NULLIF so departments with no commissions give NULL safely.
Follow the logical order FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT, and see why an alias like monthly_pay works in ORDER BY but not in WHERE.
Analyse department payroll on your own in five tasks, from headcount and payroll to high average salaries, NULL commissions and long-serving staff, with solutions after.
This course contains the use of artificial intelligence. Learn SQL with MySQL from the very first idea to a finished project. You start with an empty MySQL server, build a small database of your own with your own hands, then load a whole company's employee database and learn to answer real questions about it: who earns what, which department costs the most, who runs the biggest team, and who is on no project at all.
You do not need any programming or database experience. Every new word is explained the first time it appears, and every query is typed piece by piece, so you always know why each part is there.
One company, one real project
From the employee database section on, you work with the same company: 500 employees in 10 departments, with managers, projects, project assignments and a salary history. It is made up, but it is built to feel real, and it is big enough that you cannot eyeball the answers. At the end, an HR director hands you six questions. You plan the expected results, write the SQL, check every number, and hand in one notebook with your findings in plain words. Then you answer a second database you have never seen, on your own.
What makes this course different
What you will cover
By the end, you will be able to take a question about real data, write SQL you understand, check that the answer is right, and explain it in plain words.
All you need is a computer where you can install MySQL (Windows, macOS or Linux; the course is recorded on Windows) and an internet connection. All the software is free.