Your question is SQL Query With Aggregates and Joins. Start with the requirements and the four tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Write an SQL query based on aggregate functions, wildcard operators, and joins.
Use the provided school, student, registration, and exam tables. Include students whose last names begin with A% and exams whose titles begin with SAT%. Return only schools with at least two qualifying attempts.
school_code, school_name, eligible_students, exam_attempts, average_score, highest_score, and performance_rankperformance_rank, then school_name| Column | Type | Description |
|---|---|---|
| school_idPK | INT | Unique school identifier |
| school_code | VARCHAR(20) | Short school code |
| school_name | VARCHAR(120) | School name |
| Column | Type | Description |
|---|---|---|
| student_idPK | INT | Unique student identifier |
| school_id | INT | Student's school |
| first_name | VARCHAR(60) | Student first name |
| last_name | VARCHAR(60) | Student last name |
| Column | Type | Description |
|---|---|---|
| registration_idPK | INT | Unique exam registration |
| student_id | INT | Registered student |
| exam_id | INT | Registered exam |
| score | INT | Exam score |
| Column | Type | Description |
|---|---|---|
| exam_idPK | INT | Unique exam identifier |
| exam_title | VARCHAR(100) | Exam title |
| exam_year | INT | Exam administration year |