← All topics

πŸ—„ Interview Prep

SQL & Databases

Joins, GROUP BY, subqueries, CTEs and window functions, run on real tables in your browser. Asked for back-end, data and full-stack roles.

100 questions, most asked first

Ordered so the most useful questions for learning each pattern come first.

#3Customers Who Never OrderedJoinsEasyFree#5Find Duplicate EmailsGroup byEasyFree#6Employees Earning More Than Their ManagersSelf joins & CTEsEasyFree#7Average Salary by DepartmentGroup byEasyFree#9INNER vs LEFT vs RIGHT vs FULL JOINJoinsEasyFree#10WHERE vs HAVINGGroup byEasyFreeUnlock 33 more SQL & Databases questions Β· all 1,200 questions for $39/year (about 11Β’ a day)See full access#13Number of Orders per Customer (Including Zero)JoinsEasyπŸ”’#16Monthly RevenueDates & stringsEasyπŸ”’#18Products Never OrderedSubqueriesEasyπŸ”’#22Employees Hired in a Date RangeDates & stringsEasyπŸ”’#23Handling NULLs with COALESCECASE & NULLEasyπŸ”’#24Salary Bands with CASECASE & NULLEasyπŸ”’#26Top Customer by Total SpendSorting & limitsEasyπŸ”’#28Each Customer's First Order DateAggregatesEasyπŸ”’#30Daily Active UsersAggregatesEasyπŸ”’#31Who Referred the Most Customers?Self joins & CTEsEasyπŸ”’#33Departments With No EmployeesJoinsEasyπŸ”’#34Employees Without a DepartmentFilteringEasyπŸ”’#35UNION vs UNION ALLBasicsEasyπŸ”’#40Primary keys and foreign keysSchema designEasyπŸ”’#45COUNT(*) vs COUNT(column) vs COUNT(DISTINCT)AggregatesEasyπŸ”’#46DISTINCT vs GROUP BYGroup byEasyπŸ”’#49Extract email domainsDates & stringsEasyπŸ”’#52The Most Popular ProductAggregatesEasyπŸ”’#55Average Order Value by CityAggregatesEasyπŸ”’#57DELETE vs TRUNCATE vs DROPChanging dataEasyπŸ”’#61What is a view?Schema designEasyπŸ”’#72Customers Who Never CancelledGroup byEasyπŸ”’#73City With the Most CustomersGroup byEasyπŸ”’#74Orders Above the Average AmountSubqueriesEasyπŸ”’#76Units Sold per Product (Including Zero)JoinsEasyπŸ”’#77Hires per YearDates & stringsEasyπŸ”’#79Same-Day Duplicate EventsGroup byEasyπŸ”’#83Soft deletesSchema designEasyπŸ”’#87Searching text with LIKEFilteringEasyπŸ”’#88Filtering with IN and BETWEENFilteringEasyπŸ”’#93Every Combination with CROSS JOINJoinsEasyπŸ”’#97Copy Rows with INSERT … SELECTChanging dataEasyπŸ”’#100How to approach any SQL interview questionBasicsEasyπŸ”’