Consecutive Dates, Missing Numbers & Gaps and Islands
Learn Consecutive Dates, Missing Numbers & Gaps and Islands (Advanced SQL Interview Problems, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Introduction Islands are runs of consecutive values; gaps are the holes between them. The trick: subtract a row number from the value. Consecutive values then produce the same constant, which identifies the island.
More lessons in Advanced SQL Interview Problems
- Second & Nth Highest Salary Problems
- Find & Remove Duplicate Records
- Employees Earning More Than Their Manager
- Department-wise Highest Salary & Top 3 per Department
- Running Total & Moving Average Problems
- Employee Hierarchy & Recursive Organizational Tree
- Customers Who Never Ordered
- Most Frequently Purchased Product & Monthly Revenue
- Year-over-Year Growth & Retention Analysis