Khan Academy wants to analyze how students perform after their first attempt on a quiz exercise. Write a PostgreSQL query that returns the second attempt score for every student who attempted exercise 101 more than once.
attempted_at ascending, using attempt_id as a tie-breaker.101.NULL second-attempt score, and sort the result by user_id.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique student identifier |
| username | VARCHAR(50) | Student username |
| Column | Type | Description |
|---|---|---|
| exercise_idPK | INT | Unique exercise identifier |
| exercise_name | VARCHAR(100) | Exercise title |
| Column | Type | Description |
|---|---|---|
| attempt_idPK | INT | Unique quiz attempt identifier |
| user_id | INT | Student who made the attempt |
| exercise_id | INT | Exercise attempted |
| score | NUMERIC(5,2) | Score from 0 to 100, possibly unavailable |
| attempted_at | TIMESTAMP | Timestamp when the attempt was submitted |