Weekend Appointments for Consular Services Rescheduling
Problem statement
A consular-services dashboard needs to identify appointments scheduled on weekends so that staff can reschedule them to working days. List all appointments whose scheduled date falls on Saturday or Sunday.
Appointment data
The appointments table contains one row per appointment:
| Column | Type | Meaning |
|---|---|---|
email | text | Email address of the user who made the appointment. |
scheduled_appointment | date | The appointment's scheduled calendar date. |
Required result
email: the appointment's email address, unchanged.scheduled_appointment: the English day nameSaturdayorSunday.
Include only weekend appointments. Sort by email ascending. For this exercise, email ordering is case-sensitive ASCII order, and equal emails are ordered by the output day name ascending: Saturday before Sunday.
Keep one result row for every matching appointment, including duplicate rows. If no appointment is on a weekend, return an empty result with these two columns. The task only identifies the appointments; do not choose new dates or modify the input.
Table schema
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
appointments
| Column | Type | Nullable | Description |
|---|---|---|---|
| Text | No | Unchanged user email address. | |
| scheduled_appointment | Date | No | Scheduled calendar date without a time or timezone. |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| Text | No | — | |
| scheduled_appointment | Text | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
0 <= number of appointments <= 2000.- Both columns are non-null.
- Email values are nonempty ASCII strings of at most 254 characters. Preserve their spelling and case.
- Scheduled dates are valid Gregorian calendar dates from
2000-01-01through2100-12-31. They contain no time or timezone component. - The input is not necessarily sorted, and multiple rows may contain the same email or date.