SQL · Capital One · Medium
Four tables describe a school: students holds each learner and the class they belong to, classes maps a class id to a readable class name, exams records each exam and the date it was held, and scores links a student to an exam along with the mark they received. Column layouts are students(student_id, name, class_id), classes(class_id, class_name), exams(exam_id, exam_name, exam_date) and scores(student_id, exam_id, score). Write one SQL statement — a chain of CTEs is…
Checking your access…