Distinct Vehicle Types Parked per Day
Problem
Table: `Entries`
```text
+-----------+---------+
| Column | Type |
+-----------+---------+
| entry_day | date |
| vehicle | varchar |
+-----------+---------+
There is no primary key for this table; it may contain duplicate rows.
Each row records one vehicle type that entered a parking garage on a given day.
```
For each day, report how many different vehicle types entered and a comma-separated list of those distinct types. The list must be sorted alphabetically. Return the result ordered by `entry_day`. Name the columns `entry_day`, `kinds`, and `vehicles`.
Tables
Example rows — the live problem includes the full dataset.
| entry_day | vehicle |
|---|---|
| 2021-11-04 | Coupe |
| 2021-11-04 | Sedan |
| 2021-11-04 | Van |
Expected output
Your answer should return 3 rows with the columns entry_day, kinds, vehicles.
Starter code (SQL)
SELECT *
FROM Entries;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