AnalystPath

Readable Book Due Dates

SQLEasyJunior level~15 min

Problem

Table: `DueDates`

```text
+-------------+------+
| Column Name | Type |
+-------------+------+
| due_on | date |
+-------------+------+
due_on is the primary key for this table.
Each row is the date a borrowed library book must be returned.
```

The library wants to print friendly reminder slips. Write a solution to turn each `due_on` date into a human-readable string of the form `'weekday, month day, year'`, for example `'Tuesday, March 14, 2023'`.

The weekday and month must be full English names, the day has no leading zero, and the year is the four-digit number.

Return the result table in any order. Name the output column `due_label`.

Tables

Example rows — the live problem includes the full dataset.

DueDates
due_on
2023-03-14
2023-11-23
2024-02-29

Expected output

Your answer should return 3 rows with the columns due_label.

Starter code (SQL)

SELECT *
FROM DueDates;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions