Intermediatehow it works Verified ~7 min
How do you find weekdays that have no rows in a daily trading table (missing dates) in SQL?
Quick answerFree
Generate every calendar date in the range (a calendar table, generate_series or a recursive CTE), keep Monday to Friday, then anti-join to the trades table with LEFT JOIN ... WHERE trade_date IS NULL or NOT EXISTS. Market holidays need a holiday table, otherwise they show as missing.
Detailed answer· ~260 words
Interview PrepUnlock the full answer with Interview Prep
Get a ~260-word model answer, 5 key points, a visual explainer, 4 common mistakes and 4 follow-ups, plus 247 more SQL questions.
Also in Pro (₹499 / 90 days).
Key points· 5 points
Interview PrepUnlock with Interview Prep
Visual explainer· animated, step by step
Interview PrepUnlock with Interview Prep
Common mistakes· 4
Interview PrepLocked
Best practices· 3
Interview PrepLocked
Likely follow-ups· 4 questions
Interview PrepUnlock with Interview Prep
+ 247 more SQL questions in Interview Prep, each with the full answer.