-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestdata.sql
33 lines (26 loc) · 857 Bytes
/
testdata.sql
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
-- testdata.sql
-------------------------------
-- student_milestone table
-- new student
-- should i move begin_date to this table?
-- student has taken test
INSERT INTO student_milestone (
student_id, milestone_id, date_completed)
VALUES (
2, 1, "2014-06-12");
-- student has taken test and been screened
INSERT INTO student_milestone (
student_id, milestone_id, date_completed)
VALUES
(3, 1, "2014-06-12"),
(3, 2, "2014-06-12");
--
INSERT INTO student_milestone (
student_id, milestone_id, date_completed)
VALUES
(3, 1, "2014-06-12"),
(3, 2, "2014-06-12");
-- see joined table with all student's info.
SELECT s.first_name, s.last_name, s.begin_date, m.milestone_name, sm.date_completed, s.exit_date
FROM student AS s, student_milestone AS sm, milestone AS m
WHERE s.student_id = sm.student_id;