SQL practice
Write real SQL queries against sample tables in your browser and check them instantly — SELECT, joins, GROUP BY, subqueries and window functions. Revise the theory with the Top 50 SQL interview questions and the SQL docs.
SELECT basics
- All Departments — Easy
- Customer Cities — Easy
Filtering
- High Earners — Easy
- Employees From Mumbai — Easy
- Employees Without a Manager — Easy
- Names Starting With A — Easy
- Mid-Range Products — Easy
Sorting
- Salaries High to Low — Easy
- Top 3 Salaries — Easy
Aggregation
- Count Employees — Easy
Joins & grouping
- Employees per Department — Medium
- Average Salary by Department — Medium
- Departments With No Employees — Medium
- Employee and Department — Medium
- Customers Who Never Ordered — Medium
- Earning More Than Their Manager — Medium
- Orders per Month — Medium
- Total Spend per Customer — Medium
- Best-Selling Product — Medium
- Repeat Customers — Hard
Subqueries
- Second Highest Salary — Medium
- Above Their Department Average — Medium
Window functions
- Salary Rank in Department — Hard
- Top Earner per Department — Hard
- Running Revenue — Hard
- Third Highest Distinct Salary — Hard