-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLearningAPI.session.sql
More file actions
195 lines (136 loc) · 5.05 KB
/
Copy pathLearningAPI.session.sql
File metadata and controls
195 lines (136 loc) · 5.05 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
SELECT *
FROM public."LearningAPI_cohort";
SELECT *
FROM public."LearningAPI_opportunity";
SELECT *
FROM public."LearningAPI_learningrecord";
SELECT *
FROM public."socialaccount_socialaccount";
SELECT *
FROM public."auth_user"
ORDER BY id DESC;
SELECT *
FROM public."LearningAPI_studentassessment";
SELECT *
FROM public."authtoken_token";
DELETE
FROM public."LearningAPI_cohortcourse";
SELECT *
FROM public."LearningAPI_course";
SELECT *
FROM public."LearningAPI_studenttag";
DELETE
FROM public."LearningAPI_studenttag";
SELECT *
FROM public."LearningAPI_cohort";
SELECT *
FROM public."LearningAPI_cohortcourse";
insert into public."LearningAPI_cohortcourse" (cohort_id,
course_id,
active)
values (3,
1,
FALSE);
insert into public."LearningAPI_cohortcourse" (cohort_id,
course_id,
active)
values (3,
3,
TRUE);
select *
from pg_catalog.pg_tables;
SELECT *
FROM public."LearningAPI_studentpersonality";
DELETE
FROM public."LearningAPI_cohort"
where id = 12;
DELETE
FROM public."LearningAPI_cohortcourse";
UPDATE public."LearningAPI_nssuser"
SET slack_handle = 'G08NYBJSY' ;
UPDATE public."LearningAPI_studentpersonality"
SET briggs_myers_type = 'ESTJ'
WHERE student_id = 56;
INSERT INTO public."LearningAPI_studentpersonality" (student_id,
briggs_myers_type,
bfi_extraversion,
bfi_agreeableness,
bfi_conscientiousness,
bfi_neuroticism,
bfi_openness)
VALUES (56,
'ENTJ-A',
69,
96,
73,
0,
94);
SELECT *
FROM public."LearningAPI_capstone";
SELECT *
FROM public."LearningAPI_proposalstatus";
INSERT INTO public."LearningAPI_capstonetimeline" (capstone_id,
status_id, date)
VALUES (3,
1,
'2022-11-04');
INSERT INTO public."LearningAPI_capstone" (proposal_url,
repo_url,
course_id,
student_id,
description)
VALUES ('http://www.claire.com',
'http://www.claire.com',
3,
56,
'Client side capstone proposal');
SELECT "LearningAPI_cohort"."id",
"LearningAPI_cohort"."name",
"LearningAPI_cohort"."slack_channel",
"LearningAPI_cohort"."start_date",
"LearningAPI_cohort"."end_date",
"LearningAPI_cohort"."break_start_date",
"LearningAPI_cohort"."break_end_date",
COUNT("LearningAPI_nssusercohort"."id") FILTER (
WHERE NOT "auth_user"."is_staff" ) AS "students",
COUNT("LearningAPI_nssusercohort"."id") FILTER (
WHERE "auth_user"."is_staff" ) AS "instructors"
FROM "LearningAPI_cohort"
LEFT OUTER JOIN "LearningAPI_nssusercohort" ON ("LearningAPI_cohort"."id" = "LearningAPI_nssusercohort"."cohort_id")
LEFT OUTER JOIN "LearningAPI_nssuser" ON ("LearningAPI_nssusercohort"."nss_user_id" = "LearningAPI_nssuser"."id")
LEFT OUTER JOIN "auth_user" ON ("LearningAPI_nssuser"."user_id" = "auth_user"."id")
GROUP BY "LearningAPI_cohort"."id" ;
SELECT "LearningAPI_capstone"."id",
"LearningAPI_capstone"."student_id",
"LearningAPI_capstone"."course_id",
"LearningAPI_capstone"."proposal_url",
"LearningAPI_capstone"."repo_url",
"LearningAPI_capstone"."description",
COUNT("LearningAPI_capstonetimeline"."id") AS "status_count",
COUNT("LearningAPI_capstonetimeline"."id") FILTER (
WHERE "LearningAPI_proposalstatus"."status" = Approved) AS "approved"
FROM "LearningAPI_capstone"
LEFT OUTER JOIN "LearningAPI_capstonetimeline" ON ("LearningAPI_capstone"."id" = "LearningAPI_capstonetimeline"."capstone_id")
LEFT OUTER JOIN "LearningAPI_proposalstatus" ON ("LearningAPI_capstonetimeline"."status_id" = "LearningAPI_proposalstatus"."id")
WHERE "LearningAPI_capstone"."student_id" = 74
GROUP BY "LearningAPI_capstone"."id" ;
select w.id,
w.label,
w.weight,
w.tier,
r.achieved,
r.student_id
from public."LearningAPI_learningweight" w
left outer join public."LearningAPI_learningrecord" r on r.weight_id = w.id
and r.student_id = 19
where r.achieved is NULL
order by w.tier;
SELECT "LearningAPI_book"."id",
"LearningAPI_book"."name",
"LearningAPI_book"."course_id",
"LearningAPI_book"."description",
"LearningAPI_book"."index"
FROM "LearningAPI_book"
ORDER BY "LearningAPI_book"."course_id" ASC,
"LearningAPI_book"."index" ASC
;