Incomplete Assembly Tasks
Beginner Mode
Objective
Write a SQL query to identify parts that have started assembly but do not have a finish date.
Table Schema:
- parts_assembly
| Column | Type | Description |
|---|---|---|
| part | VARCHAR | Name of the part being assembled |
| finish_date | DATE | Date when the assembly was completed (NULL if not finished) |
| assembly_step | INTEGER | Step number in the assembly process |
Task Requirements:
- Identify parts that have started assembly but have no finish date (finish_date is NULL)
- Return the part name and assembly step for unfinished parts
- No specific sorting required
Output columns: assembly_step, part
Examples
Example 1:
Output:
Input:
| parts_assembly | ||
|---|---|---|
| assembly_step | finish_date | part |
| 1 | 2024-01-15 | Engine Block |
| 2 | null | Engine Block |
| 1 | 2024-02-20 | Transmission |
| 1 | null | Brake Pad |
| 2 | null | Brake Pad |
| assembly_step | part |
|---|---|
| 2 | Engine Block |
| 1 | Brake Pad |
| 2 | Brake Pad |
Code Environment
Sign in or try as guest to run your code.
Track
| Question | Difficulty | Company | Access |
|---|
Need more practice in this area? Explore more questions →
Tesla