generated from CodeYourFuture/cyf-final-project-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathknowledge_checklist.sql
72 lines (59 loc) · 2.35 KB
/
knowledge_checklist.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
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
69
70
71
72
drop table if exists students cascade;
drop table if exists mentors cascade;
drop table if exists region;
drop table if exists learningobjectives cascade;
drop table if exists mappingskills cascade;
drop table if exists techskills cascade;
drop table if exists competencylevel cascade;
CREATE TABLE students (
id SERIAL PRIMARY KEY,
name VARCHAR (50)NOT NULL,
location VARCHAR (50)NOT NULL,
email VARCHAR (150) NOT NULL,
password VARCHAR(70) NOT NULL
);
CREATE TABLE mentors (
id SERIAL PRIMARY KEY,
name VARCHAR (50)NOT NULL,
location VARCHAR (50)NOT NULL,
email VARCHAR (150) NOT NULL,
password VARCHAR(70) NOT NULL
);
CREATE TABLE region (
id SERIAL PRIMARY KEY,
location VARCHAR(50) NOT NULL,
stud_id integer,
ment_id integer,
FOREIGN KEY (stud_id) REFERENCES students(id),
FOREIGN KEY (ment_id) REFERENCES mentors(id)
);
CREATE TABLE techskills (
id SERIAL PRIMARY KEY,
lessons VARCHAR(50)NOT NULL
);
CREATE TABLE learningobjectives (
id SERIAL PRIMARY KEY,
objectives VARCHAR (50)NOT NULL,
lesson_id integer, --references techskills(id),
FOREIGN KEY (lesson_id) REFERENCES techskills(id)
);
CREATE TABLE competencylevel (
id SERIAL PRIMARY KEY,
competency VARCHAR(50)NOT NULL
);
CREATE TABLE mappingskills (
id SERIAL PRIMARY KEY,
stud_id integer, --references students(id),
obj_id integer, --references learningobjectives(id),
comp_id integer, -- references competencylevel(id),
FOREIGN KEY (stud_id) REFERENCES students(id),
FOREIGN KEY (obj_id) REFERENCES learningobjectives(id),
FOREIGN KEY(comp_id) REFERENCES competencylevel(id)
);
INSERT INTO students (name, location, email, password) VALUES ('student', 'west mids', '[email protected]','password');
INSERT INTO mentors (name, location, email, password) VALUES ('mentors', 'west mids', '[email protected]', 'password');
INSERT INTO region (location, stud_id, ment_id) VALUES ('west mids', 1, 1);
INSERT INTO techskills (lessons) VALUES ('react');
INSERT INTO learningobjectives (objectives, lesson_id) VALUES ('fundmentals', 1);
INSERT INTO competencylevel(competency) VALUES ('very Confident');
INSERT INTO mappingskills (stud_id, obj_id, comp_id) VALUES (1,1,1);