All courses
· intermediate

Intermediate SQL

Ask questions that need a query inside a query. Categorise rows with CASE, filter against a computed set, and combine results that come from different places.

Pathaxis · Original content

Written in house, from the work rather than from a syllabus. Every example is one we would use ourselves, and every exercise is checked against the same engine that grades your answer.

95 min 7 lessons 14 quiz questions 6 exercisesStart course

What you’ll learn

  • Categorise and reshape rows with CASE
  • Filter against a value or list produced by another query
  • Use a subquery as a derived table in FROM
  • Tell a correlated subquery from an independent one and know the cost
  • Choose between IN, EXISTS and a join for the same question
  • Combine result sets with UNION, INTERSECT and EXCEPT

Before you start

  • · SQL Foundations and Joining Data in SQL
  • · Comfort with GROUP BY and the aggregate functions

Syllabus

01

Conditional logic

Deciding per row, inside the query.

02

Queries inside queries

Subqueries in WHERE, SELECT and FROM, and what correlation costs.