Loading problem...
A school analytics system tracks students, subjects, and exam attendance events.
Tables:
Definitions:
Task:
Output requirements:
Supported submission environments:
students:
| student_id | student_name |
|------------|--------------|
| 1 | Alice |
| 2 | Bob |
| 6 | Alex |
| 13 | John |
subjects:
| subject_name |
|--------------|
| Math |
| Physics |
| Programming |
examinations:
| student_id | subject_name |
|------------|--------------|
| 1 | Math |
| 1 | Physics |
| 1 | Programming |
| 2 | Programming |
| 1 | Physics |
| 1 | Math |
| 13 | Math |
| 13 | Programming |
| 13 | Physics |
| 2 | Math |
| 1 | Math |[
{"student_id":1,"student_name":"Alice","subject_name":"Math","attended_exams":3},
{"student_id":1,"student_name":"Alice","subject_name":"Physics","attended_exams":2},
{"student_id":1,"student_name":"Alice","subject_name":"Programming","attended_exams":1},
{"student_id":2,"student_name":"Bob","subject_name":"Math","attended_exams":1},
{"student_id":2,"student_name":"Bob","subject_name":"Physics","attended_exams":0},
{"student_id":2,"student_name":"Bob","subject_name":"Programming","attended_exams":1},
{"student_id":6,"student_name":"Alex","subject_name":"Math","attended_exams":0},
{"student_id":6,"student_name":"Alex","subject_name":"Physics","attended_exams":0},
{"student_id":6,"student_name":"Alex","subject_name":"Programming","attended_exams":0},
{"student_id":13,"student_name":"John","subject_name":"Math","attended_exams":1},
{"student_id":13,"student_name":"John","subject_name":"Physics","attended_exams":1},
{"student_id":13,"student_name":"John","subject_name":"Programming","attended_exams":1}
]The output includes all student-subject pairs. Missing attendance combinations are represented with 0.
students:
| student_id | student_name |
|------------|--------------|
| 10 | Mia |
| 11 | Noah |
subjects:
| subject_name |
|--------------|
| Algebra |
| Chemistry |
examinations:
[][
{"student_id":10,"student_name":"Mia","subject_name":"Algebra","attended_exams":0},
{"student_id":10,"student_name":"Mia","subject_name":"Chemistry","attended_exams":0},
{"student_id":11,"student_name":"Noah","subject_name":"Algebra","attended_exams":0},
{"student_id":11,"student_name":"Noah","subject_name":"Chemistry","attended_exams":0}
]No attendance events exist, so every matrix cell has value 0.
students:
| student_id | student_name |
|------------|--------------|
| 21 | Priya |
subjects:
| subject_name |
|--------------|
| Databases |
| Networks |
examinations:
| student_id | subject_name |
|------------|--------------|
| 21 | Databases |
| 21 | Databases |
| 21 | Databases |
| 21 | Networks |[
{"student_id":21,"student_name":"Priya","subject_name":"Databases","attended_exams":3},
{"student_id":21,"student_name":"Priya","subject_name":"Networks","attended_exams":1}
]Duplicate examination rows count as multiple attendances for the same student-subject pair.
Constraints