Programming · Beginner

SQL & Databases

A forty-year-old language that has outlived every technology built to replace it — and the design thinking underneath it.

Lessons
25 lessons
Total runtime
72 hours of video
Modules
7 modules
Optional lessons
19 optional
Start course

Free. No account.

About this course

SQL is the most durable skill in software. Frameworks come and go on a five-year cycle; the query you write this week would have run in 1990 and will run in 2050. It is also unusual in being genuinely useful to people who are not programmers — analysts, marketers and finance people write more SQL between them than engineers do.

The language itself is small and you can be productive in an afternoon. Web Dev Simplified's hour gets you querying; Mosh's course is the proper treatment, and it is the spine of this course. Joins get their own lesson because joins are where beginners stall, and because almost every wrong answer produced by a confident-looking query is a join that quietly dropped rows.

The second half is the part most tutorials skip, and it is the part that separates people who can query a database from people who can build one. Normalisation sounds like bureaucratic theory until you have watched a spreadsheet-shaped table corrupt its own data, at which point it becomes obvious. Decomplexify's half hour on it is the clearest explanation of the subject anywhere, in any format.

About five hours of required video. The optional lessons run to another sixty-odd, including a thirty-hour course for anyone who would rather have one continuous reference than a dozen short ones. Install PostgreSQL or SQLite and type the queries — SQL is learned at a prompt, and reading it teaches almost nothing.

What you'll be able to do

  • Write SELECT queries with filtering, grouping and aggregation
  • Join tables correctly, and know which join you need before you run it
  • Design a schema with sensible keys and relationships
  • Normalise a table, and explain what problem each normal form actually prevents
  • Insert, update and delete data without destroying a table by accident
  • Say what a relational database is good at, and when a different paradigm fits better

Curriculum

25 lessons · 72 hours

What a Database Is

2 lessons · 11m

  1. 01CompletedSQL Explained in 100 SecondsFireshipVideoTables, rows, relationships and the shape of a query, before any of it is asked of you.2m
  2. 02Completed7 Database ParadigmsFireshipVideoThe map before the territory. Relational databases are the default for good reasons, and this is the fastest way to see what those reasons are by contrast with the alternatives.9m

The Query Language

6 lessons · 13h 26m

  1. 03CompletedLearn SQL In 60 MinutesWeb Dev SimplifiedVideoAn hour to go from nothing to writing real queries. Start here even if you intend to do the longer course — having queried something once makes the thorough version far easier to follow.1h
  2. 04CompletedSQL Course for BeginnersProgramming with MoshVideoThe spine of the course. Three hours covering querying properly, plus inserting, updating and deleting — the operations that can actually damage something, and are therefore worth learning carefully.3h 10m
  3. 05CompletedSQL Joins ExplainedSocraticaVideoJoins get their own lesson because joins are where people stall. Six minutes, and worth rewatching — an inner join used where you needed a left join silently returns fewer rows and no error.6m
  4. 06CompletedSQL Tutorial - Full Database Course for BeginnersOptionalfreeCodeCamp.orgVideoOptional. A four-hour alternative treatment of the same ground, useful if a particular topic did not land the first time.4h 20m
  5. 07CompletedSQL Tutorial for BeginnersOptionalKevin StratvertVideoUnusually plain-spoken and aimed at people who are not developers. A good first forty-five minutes if the other lessons here assume more than you have.45m
  6. 08CompletedLearn SQL Beginner to Advanced in Under 4 HoursOptionalAlex The AnalystVideoFour hours taught from an analyst's perspective rather than an engineer's, so the emphasis is on answering questions rather than designing schemas. Pairs well with the Data Analysis course.4h 5m

Beyond SELECT

4 lessons · 5h 35m

  1. 09CompletedSQL Window Functions — RANK, DENSE_RANK, LEAD and LAGOptionaltechTFQVideoWindow functions are the dividing line between basic SQL and useful SQL — running totals, rankings and comparisons to the previous row, all without leaving the query. Twenty-five minutes very well spent.25m
  2. 10Completed12 Advanced SQL Concepts in 20 MinutesOptionalMaven AnalyticsVideoCTEs, subqueries, self-joins, CASE and the rest, at speed. A checklist of everything past the basics — anything here you cannot write is worth going and learning.22m
  3. 11CompletedSQL Window Functions Basics, Visually ExplainedOptionalData with BaraaVideoPARTITION BY and frame clauses drawn out step by step. The frame clause in particular is almost never explained properly, and it is where most window-function confusion lives.57m
  4. 12CompletedThe Ultimate SQL Window Functions CourseOptionalData with BaraaVideoFour hours on window functions alone. Absurd depth for one feature, and exactly right if you are doing analytics work daily.3h 51m

Designing a Database

2 lessons · 8h 50m

  1. 13CompletedLearn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NFDecomplexifyVideoThe best half hour in the course. Normalisation reads as dry theory right up until you understand that each normal form exists to prevent one specific way data goes wrong — and then it becomes obvious.30m
  2. 14CompletedDatabase Design CourseOptionalfreeCodeCamp.orgVideoOptional, and long enough to be a course in its own right. Keys, relationships, ER diagrams and schema design from first principles. Worth it before you design something other people will depend on.8h 20m

Making It Fast

4 lessons · 2h 24m

  1. 15CompletedHow Do Indexes Make Databases Read Faster?OptionalArpit BhayaniVideoThe B-tree underneath, explained from first principles. Once you can picture the structure, both why an index helps and why it costs you on every write become obvious.23m
  2. 16CompletedSQL Indexes — Clustered vs NonclusteredOptionalData with BaraaVideoThe practical follow-up: which indexes to actually create, and how to read a query plan to find out whether yours is being used.43m
  3. 17CompletedEasy Database Indexing StrategiesOptionalPlanetScaleVideoComposite indexes and column order, which is the part people get wrong after they have understood everything else. From a team who run databases for a living.36m
  4. 18CompletedWhat Every Developer Needs to Know About Database IndexingOptionalLaracon EUVideoA conference talk, and the most entertaining item in this module. Kai Sassnowski builds an index by hand on stage until the idea is unavoidable.42m

A Real Database

3 lessons · 8h 13m

  1. 19CompletedLearn PostgreSQL Tutorial - Full Course for BeginnersOptionalfreeCodeCamp.orgVideoOptional. SQL as taught above is the standard; this is a specific database with its own tools, types and command line. Postgres is the sensible default if you have no reason to pick another.4h 20m
  2. 20CompletedPostgreSQL Crash CourseOptionalNeuralNineVideoAn hour to get Postgres installed, connected to and queried. Enough to have somewhere real to type the rest of this course into.1h
  3. 21CompletedPostgreSQL Tutorial for BeginnersOptionalfreeCodeCamp.orgVideoA shorter alternative to the four-hour course above, and more current. Take whichever length suits you; the material is much the same.2h 53m

Practising

4 lessons · 33h 49m

  1. 22CompletedTop 10 SQL Interview QueriesOptionaltechTFQVideoTen problems worked through out loud, including the reasoning about which approach to take. Watching someone think through a query is more useful than watching them write one.37m
  2. 23CompletedTop 25 SQL Interview Questions and AnswersOptionaltechTFQVideoThe conceptual questions rather than the query-writing ones — normalisation, index types, the difference between WHERE and HAVING. Good self-assessment.26m
  3. 24CompletedSolve 70 SQL Questions in 3 HoursOptionalBuild with AkshitVideoVolume practice. Pause before each answer and write your own query first, or this is just three hours of watching.2h 58m
  4. 25CompletedSQL Full Course for Beginners — 30 HoursOptionalData with BaraaVideoThirty hours, from first query to warehouse design. Not a course to work through linearly — treat it as a reference and jump to the chapter you need.29h 48m

Credits

Every lesson in this course was made by one of these channels. Tubeversity sequenced them; it did not make them. If a course is useful to you, the people below are the ones who earned it.