Salary on a Given Date
Return each employee's salary on 2025-03-15 (start_date <= date and the date is before end_date, or end_date is NULL). Order by name.
Table schema
SalaryHistory(emp VARCHAR(10), salary INT, start_date DATE, end_date DATE)Sample data
emp | salary | start_date | end_date
Ann | 50000 | 2024-01-01 | 2025-01-01
Ann | 60000 | 2025-01-01 | 2026-01-01
Ann | 75000 | 2026-01-01 | NULL
Bob | 40000 | 2024-06-01 | 2025-06-01
Bob | 42000 | 2025-06-01 | NULL
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.