โ† 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

Ranked by how often each question comes up in real interviews. #1 is the most common.

#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๐Ÿ”’