Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Join Tables With Date Filter

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Join Tables With Date Filter. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

ALTEN Technology USA needs a list of project events recorded in its engineering delivery tracking system during a defined reporting period. Write a PostgreSQL query that returns events from February 1, 2025 through February 28, 2025.

Requirements

  1. Return the event ID, project name, event date, and status for events within the specified date range.
  2. Exclude rows with a NULL event date and sort the results chronologically, using the event ID as a tie-breaker.

Use an inclusive start date and an exclusive end date so the query remains reliable if event_date is later changed from DATE to TIMESTAMP.

Schema

project_events
ColumnTypeDescription
event_idPKINTEGERUnique event identifier
project_nameVARCHAR(100)ALTEN Technology USA project name
event_dateDATEDate when the event occurred
statusVARCHAR(30)Current event status
Tablesproject_events
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results