SQL Dates Practice Problems: 430 Questions with Solutions

430 SQL dates practice problems with solutions: DATEDIFF, DATE ADD, DATE FORMAT, months, weeks and retention. Written in MySQL, judged on hidden datasets.

  • Problems: 430
  • By difficulty: 96 easy · 170 medium · 164 hard
  • Dialect: MySQL

Practise SQL date functions in MySQL: DATEDIFF, DATE_ADD and DATE_SUB with INTERVAL, YEAR, MONTH and DATE_FORMAT, TIMESTAMPDIFF and grouping by day, week or month. The problems are the time questions analysts are asked — retention after seven days, orders per month, the gap between two events.

Easy SQL dates problems

Medium SQL dates problems

Hard SQL dates problems

Every SQL problem · The SQL skill test