Dates
SQL Date Interview Questions
Dates come up in almost every reporting question: totals by month, the time between two events, gaps in a calendar. They are also where the most invisible errors live, because a wrong date range still returns a perfectly sensible-looking number.
What date questions ask you to do
Across the questions here, these are the shapes that come up:
- Group totals by month, week or hour of the day
- Work out the time between two events
- Return the rows inside a date range
- Find days with no activity at all
- Find runs of consecutive days
Common mistakes with dates
If a column stores a time as well as a date, asking for everything between the 1st and the 31st loses almost all of the 31st — everything after midnight. A whole day goes missing and nothing in the result says so. Asking for dates on or after the start, and before the start of the next month, avoids it.
Questions to practice
- Completed trips by hour of daySQL
Ubereasy - Hires per yearSQL
LinkedIneasy - Orders placed in March 2024SQL
Best Buyeasy - Products launched in 2024SQL
Targeteasy - Average sales cycleSQL
Salesforcemedium - Booked revenue by cityPandas
Airbnbmedium - Days from signup to first orderSQL
Stripemedium - Delivery time by cuisineSQL
DoorDashmedium - Monthly approved spendPandas
Visamedium - Monthly traded valuePandas
Robinhoodmedium - Nights booked per citySQL
Airbnbmedium - Orders per calendar monthSQL
Walmartmedium - Slow deliveries by cuisinePandas
DoorDashmedium - Weekend ordersSQL
Walmartmedium - Busiest hour per cityPandasPremium
Lyfthard - Minutes from order to doorstepSQLPremium
Instacarthard
Questions last reviewed 19 October 2026.