BharatPe's learning and onboarding program stores students and their exam attempts. Write a PostgreSQL query to identify students whose best score is the second-highest distinct score across all students.
student_id.| Column | Type | Description |
|---|---|---|
| student_idPK | INTEGER | Unique student identifier |
| student_name | VARCHAR(100) | Student's full name |
| Column | Type | Description |
|---|---|---|
| attempt_idPK | INTEGER | Unique exam attempt identifier |
| student_id | INTEGER | Logical reference to the student who made the attempt |
| score | INTEGER | Attempt score, which may be NULL when not evaluated |