SQL – Date and Time Functions
Practice SQL date and time function interview questions. Cover filtering by date, extracting parts, date differences, and time-based aggregations. Write queries and receive feedback on correctness and approach. Ideal for data analyst and SQL interview prep. First 2 questions are free with full feedback.
- Level Intermediate
- Questions 12
Try any track free — first 2 questions include full AI feedback. Subscribe to finish the track and unlock everything. Type or speak your answer — the first 2 questions include scoring and detailed AI feedback.
Sample sql – date and time functions interview questions
Preview 6 questions from this track in quiz order. In the full quiz you answer one at a time — type or speak — then get a score and feedback.
-
How do you filter rows from the last 7 days?
What a strong answer includes
Uses CURRENT_DATE or NOW() with an interval.
-
Write a query to extract the year and month from a timestamp.
What a strong answer includes
Uses EXTRACT or DATE_TRUNC.
-
How do you calculate the number of days between two dates?
What a strong answer includes
Subtracts dates or uses a date difference function.
-
Write a query to group revenue by month.
What a strong answer includes
Truncates or extracts month and sums.
-
How do you find records from the current month?
What a strong answer includes
Compares year and month or uses date truncation.
-
Explain the difference between a date and a timestamp.
What a strong answer includes
Timestamp includes time; date is day only.