courses / sql / level 1

level 1 · easy

sql for
beginners.

Ask a database questions and change its data, from your very first query to tables of your own.

  • 28 lessons
  • 7 units
  • 3 h 24 m in all
  • £0, for good

what’s inside.

For people who have never written a line of code. Nothing is assumed: every new word is explained the moment it appears.

SQL Level 1 assumes nothing. In 28 short lessons you go from what a database is to building, filling and questioning your own tables, with a guess, a hands-on task and a fix-the-query challenge in every lesson. It ends with a level check: answering a shop owner's questions with queries that work for any shop.

every lesson goes the same way.

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

unit 1

Meet your data

Ask a database to show you what it holds.

4 lessons · 26 min

  1. What a database is5 minFind out what a database is and ask it your very first question.
  2. Your first query6 minRead and write a question that shows a whole table.
  3. Choosing columns7 minAsk for only the columns you need, in the order you like.
  4. When it goes wrong8 minRead error messages and fix the three you will meet most.

unit 2

Pick your rows

Ask for only the rows you need.

4 lessons · 31 min

  1. WHERE picks the rows7 minKeep only the rows that match what you are looking for.
  2. Text goes in quotes8 minSearch for words as well as numbers, without confusing the database.
  3. Bigger, smaller, different8 minFind rows above, below or not equal to a value.
  4. And, or, not8 minLink conditions together to ask sharper questions.

unit 3

Sort and trim

Put results in order and keep only the bits you want.

4 lessons · 27 min

  1. Putting rows in order7 minSort your results from smallest to biggest, or the other way round.
  2. Only the top few6 minShow the best three, the cheapest one, or any number you like.
  3. No repeats6 minList each value once, however many times it appears.
  4. Searching with patterns8 minFind text that starts with, ends with or contains some letters.

unit 4

Blanks, maths and text

Handle missing values and work out new ones.

4 lessons · 30 min

  1. When a value is missing8 minSpot empty boxes and find the rows that have them.
  2. Maths in a query8 minLet the database work out new numbers for you.
  3. Naming your columns6 minGive any column in your result a clear new name.
  4. Tricks with text8 minGlue text together and change how it looks.

unit 5

Sum it up

Turn a whole table into one answer.

4 lessons · 28 min

  1. Counting rows7 minAsk how many, and get one number back.
  2. Totals and averages7 minAdd up a column and find its average.
  3. Smallest and biggest6 minFind the lowest and highest values in a column.
  4. Many answers at once8 minBuild a tidy report in a single query.

unit 6

Change the data

Add, change and remove rows.

4 lessons · 29 min

  1. Adding a row7 minPut a brand new row into a table.
  2. Naming the columns you fill7 minAdd rows safely, even when you only know some of the values.
  3. Changing rows8 minUpdate values that are already in a table.
  4. Removing rows7 minDelete the rows you no longer need, and only those.

unit 7

Build your own tables

Make your own tables, then put everything together.

4 lessons · 33 min

  1. Making a table8 minBuild a brand new table and decide what goes in it.
  2. Rules for columns8 minStore decimals, and stop important boxes being left empty.
  3. Every row gets an id8 minGive each row its own number so you can always find it.
  4. Putting it all together9 minBuild a table, fill it, change it and ask it questions.
end of level 1 level check: the shop owner's questions Build one small project with everything from this level. Pass it and your face levels up. see the check

next, level 2

intermediate
sql.

Join tables, group and choose, design safe databases and work with dates to build useful reports.

see level 2