Skip to content

Instantly share code, notes, and snippets.

@chidioguejiofor
Created November 20, 2019 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chidioguejiofor/952a5a77157f6032052339ba6dcaf557 to your computer and use it in GitHub Desktop.
Save chidioguejiofor/952a5a77157f6032052339ba6dcaf557 to your computer and use it in GitHub Desktop.
Result Table data used in a blogpost I wrote
CREATE TABLE results(
id SERIAL PRIMARY KEY,
student_id INT NOT NULL,
subject VARCHAR NOT NULL,
score INT NOT NULL,
UNIQUE(student_id, subject)
)
;
INSERT INTO results(stud_id, subject, score)
VALUES (9, 'Literature', 79),
(10, 'Literature', 63),
(11, 'Literature', 68),
(12, 'Literature', 61),
(13, 'Literature', 60),
(14, 'Literature', 78),
(15, 'Literature', 60),
(16, 'Literature', 61),
(17, 'Literature', 68),
(18, 'Literature', 79),
(1, 'Literature', 0),
(2, 'Literature', 73),
(4, 'Literature', 77),
(5, 'Literature', 62),
(6, 'Literature', 61),
(7, 'Literature', 77),
(1, 'Arts', 49),
(1, 'History', 72),
(1, 'Computer Science', 74),
(1, 'Physics', 71),
(1, 'Statistics', 14),
(1, 'Mathematics', 0),
(1, 'Economics', 73),
(1, 'Physical Education', 88),
(1, 'English Language', 63),
(1, 'Chemistry', 0),
(1, 'Biology', 0),
(2, 'Commerce', 76),
(2, 'Arts', 76),
(2, 'History', 71),
(2, 'Computer Science', 77),
(2, 'Physics', 73),
(2, 'Statistics', 91),
(2, 'Mathematics', 66),
(2, 'Economics', 81),
(2, 'Physical Education', 70),
(2, 'English Language', 0),
(2, 'Chemistry', 73),
(2, 'Biology', 78),
(4, 'Commerce', 66),
(4, 'Arts', 70),
(4, 'History', 78),
(4, 'Computer Science', 52),
(4, 'Physics', 80),
(4, 'Statistics', 71),
(4, 'Mathematics', 71),
(4, 'Economics', 70),
(4, 'Physical Education', 70),
(4, 'English Language', 0),
(4, 'Chemistry', 71),
(4, 'Biology', 77),
(5, 'Commerce', 75),
(5, 'Arts', 72),
(5, 'History', 68),
(5, 'Computer Science', 79),
(5, 'Physics', 79),
(5, 'Statistics', 65),
(5, 'Mathematics', 70),
(5, 'Economics', 67),
(5, 'Physical Education', 76),
(5, 'English Language', 67),
(5, 'Chemistry', 61),
(5, 'Biology', 64),
(6, 'Commerce', 66),
(6, 'Arts', 69),
(6, 'History', 66),
(6, 'Computer Science', 60),
(6, 'Physics', 76),
(6, 'Statistics', 53),
(6, 'Mathematics', 61),
(6, 'Economics', 66),
(6, 'Physical Education', 70),
(6, 'English Language', 62),
(6, 'Chemistry', 63),
(6, 'Biology', 63),
(7, 'Commerce', 73),
(7, 'Arts', 75),
(7, 'History', 80),
(7, 'Computer Science', 92),
(7, 'Physics', 66),
(7, 'Statistics', 80),
(7, 'Mathematics', 80),
(7, 'Economics', 70),
(7, 'Physical Education', 70),
(7, 'English Language', 67),
(7, 'Chemistry', 74),
(7, 'Biology', 81),
(8, 'Commerce', 68),
(8, 'Arts', 71),
(8, 'History', 67),
(8, 'Computer Science', 70),
(8, 'Physics', 69),
(8, 'Statistics', 60),
(8, 'Mathematics', 62),
(8, 'Economics', 63),
(8, 'Physical Education', 81),
(8, 'Chemistry', 61),
(8, 'Biology', 65),
(9, 'Commerce', 82),
(9, 'Arts', 80),
(9, 'History', 84),
(9, 'Computer Science', 93),
(9, 'Physics', 85),
(9, 'Statistics', 85),
(9, 'Mathematics', 80),
(9, 'Economics', 75),
(9, 'Physical Education', 81),
(9, 'English Language', 78),
(9, 'Chemistry', 81),
(9, 'Biology', 84),
(10, 'Commerce', 69),
(10, 'Arts', 79),
(10, 'History', 76),
(10, 'Computer Science', 76),
(10, 'Physics', 78),
(10, 'Statistics', 65),
(10, 'Mathematics', 72),
(10, 'Economics', 61),
(10, 'Physical Education', 70),
(10, 'English Language', 60),
(10, 'Chemistry', 51),
(10, 'Biology', 66),
(11, 'Commerce', 61),
(11, 'Arts', 70),
(11, 'History', 74),
(11, 'Computer Science', 51),
(11, 'Physics', 76),
(11, 'Statistics', 62),
(11, 'Mathematics', 62),
(11, 'Economics', 62),
(11, 'Physical Education', 64),
(11, 'English Language', 0),
(11, 'Chemistry', 56),
(11, 'Biology', 57),
(12, 'Commerce', 44),
(12, 'Arts', 45),
(12, 'History', 62),
(12, 'Computer Science', 40),
(12, 'Physics', 60),
(12, 'Statistics', 52),
(12, 'Mathematics', 47),
(12, 'Economics', 62),
(12, 'Physical Education', 60),
(12, 'English Language', 56),
(12, 'Chemistry', 40),
(12, 'Biology', 0),
(13, 'Commerce', 63),
(13, 'Arts', 77),
(13, 'History', 75),
(13, 'Computer Science', 71),
(13, 'Physics', 76),
(13, 'Statistics', 58),
(13, 'Mathematics', 64),
(13, 'Economics', 72),
(13, 'Physical Education', 80),
(13, 'English Language', 69),
(13, 'Chemistry', 62),
(13, 'Biology', 65),
(14, 'Commerce', 80),
(14, 'Arts', 80),
(14, 'History', 76),
(14, 'Computer Science', 84),
(14, 'Physics', 89),
(14, 'Statistics', 61),
(14, 'Mathematics', 75),
(14, 'Economics', 75),
(14, 'Physical Education', 74),
(14, 'English Language', 70),
(14, 'Chemistry', 70),
(14, 'Biology', 74),
(15, 'Commerce', 60),
(15, 'Arts', 71),
(15, 'History', 72),
(15, 'Computer Science', 65),
(15, 'Physics', 72),
(15, 'Statistics', 57),
(15, 'Mathematics', 63),
(15, 'Economics', 60),
(15, 'Physical Education', 60),
(15, 'English Language', 60),
(15, 'Chemistry', 45),
(15, 'Biology', 0),
(16, 'Commerce', 70),
(16, 'Arts', 67),
(16, 'History', 73),
(16, 'Computer Science', 80),
(16, 'Physics', 73),
(16, 'Statistics', 66),
(16, 'Mathematics', 65),
(16, 'Economics', 63),
(16, 'Physical Education', 65),
(16, 'English Language', 73),
(16, 'Chemistry', 67),
(16, 'Biology', 70),
(17, 'Commerce', 66),
(17, 'Arts', 70),
(17, 'History', 73),
(17, 'Computer Science', 87),
(17, 'Physics', 79),
(17, 'Statistics', 76),
(17, 'Mathematics', 70),
(17, 'Economics', 65),
(17, 'Physical Education', 80),
(17, 'English Language', 65),
(17, 'Chemistry', 60),
(17, 'Biology', 77),
(18, 'Commerce', 65),
(18, 'Arts', 76),
(18, 'History', 0),
(18, 'Computer Science', 85),
(18, 'Physics', 74),
(18, 'Statistics', 62),
(18, 'Mathematics', 80),
(18, 'Economics', 69),
(18, 'Physical Education', 60),
(18, 'English Language', 67),
(18, 'Chemistry', 71),
(18, 'Biology', 73),
(19, 'Commerce', 70),
(19, 'Arts', 71),
(19, 'History', 75),
(19, 'Computer Science', 66),
(19, 'Physics', 71),
(19, 'Statistics', 80),
(19, 'Mathematics', 71),
(19, 'Economics', 70),
(8, 'Literature', 66),
(19, 'Physical Education', 80),
(19, 'English Language', 68),
(19, 'Chemistry', 75),
(19, 'Biology', 71),
(20, 'Commerce', 63),
(20, 'Arts', 50),
(20, 'History', 0),
(20, 'Computer Science', 60),
(20, 'Physics', 67),
(20, 'Statistics', 54),
(20, 'Mathematics', 60),
(20, 'Economics', 63),
(20, 'Physical Education', 64),
(20, 'English Language', 49),
(20, 'Chemistry', 40),
(20, 'Biology', 55),
(21, 'Commerce', 62),
(21, 'Arts', 47),
(21, 'History', 60),
(21, 'Computer Science', 35),
(21, 'Physics', 64),
(21, 'Statistics', 48),
(21, 'Mathematics', 60),
(21, 'Economics', 67),
(21, 'Physical Education', 68),
(21, 'English Language', 0),
(21, 'Chemistry', 0),
(21, 'Biology', 0),
(22, 'Commerce', 55),
(22, 'Arts', 70),
(22, 'History', 68),
(22, 'Computer Science', 63),
(22, 'Physics', 75),
(22, 'Statistics', 49),
(22, 'Mathematics', 60),
(22, 'Economics', 67),
(22, 'Physical Education', 61),
(22, 'English Language', 66),
(22, 'Chemistry', 41),
(22, 'Biology', 56),
(23, 'Commerce', 65),
(23, 'Arts', 67),
(23, 'History', 72),
(23, 'Computer Science', 72),
(23, 'Physics', 79),
(23, 'Statistics', 57),
(23, 'Mathematics', 65),
(23, 'Economics', 39),
(23, 'Physical Education', 87),
(23, 'English Language', 61),
(23, 'Chemistry', 36),
(23, 'Biology', 0),
(24, 'Commerce', 83),
(24, 'Arts', 83),
(24, 'History', 85),
(24, 'Computer Science', 97),
(24, 'Physics', 91),
(24, 'Statistics', 88),
(24, 'Mathematics', 91),
(24, 'Economics', 80),
(24, 'Physical Education', 89),
(24, 'English Language', 76),
(24, 'Chemistry', 82),
(24, 'Biology', 85),
(19, 'Literature', 65),
(20, 'Literature', 60),
(21, 'Literature', 62),
(22, 'Literature', 66),
(23, 'Literature', 53),
(24, 'Literature', 88)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment