1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| DROP TABLE IF EXISTS Student; DROP TABLE IF EXISTS Exam; CREATE TABLE If NOT EXISTS Student (student_id INT, student_name VARCHAR(30)); CREATE TABLE If NOT EXISTS Exam (exam_id INT, student_id INT, score INT); TRUNCATE TABLE Student; INSERT INTO Student (student_id, student_name) VALUES ('1', 'Daniel'); INSERT INTO Student (student_id, student_name) VALUES ('2', 'Jade'); INSERT INTO Student (student_id, student_name) VALUES ('3', 'Stella'); INSERT INTO Student (student_id, student_name) VALUES ('4', 'Jonathan'); INSERT INTO Student (student_id, student_name) VALUES ('5', 'Will'); TRUNCATE TABLE Exam; INSERT INTO Exam (exam_id, student_id, score) VALUES ('10', '1', '70'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('10', '2', '80'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('10', '3', '90'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('20', '1', '80'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('30', '1', '70'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('30', '3', '80'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('30', '4', '90'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('40', '1', '60'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('40', '2', '70'); INSERT INTO Exam (exam_id, student_id, score) VALUES ('40', '4', '80');
|