SQL Basics Practice Problems: 102 Questions with Solutions

102 SQL basics practice problems with solutions: SELECT, WHERE, ORDER BY, LIMIT, DISTINCT and NULLs. Written in MySQL, judged on hidden datasets.

  • Problems: 102
  • By difficulty: 100 easy · 1 medium · 1 hard
  • Dialect: MySQL

Practise the SQL every query is built from: SELECT, WHERE, ORDER BY, LIMIT, DISTINCT and NULL handling, on small tables you can read at a glance. Each problem asks for one exact result set and is judged on hidden datasets as well as the example. Start here if you are new to SQL or warming up before an interview.

Easy SQL basics problems

Medium SQL basics problems

Hard SQL basics problems

Every SQL problem · The SQL skill test