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
|
# CU Boulder Grade Data
## Steps to Update Database:
1. Fetch Latest Data from [CU's ODA Website](https://www.colorado.edu/oda/student-data/courses) (Over Time Reports -> Grades -> Grade distributions) (should be a file named gradesall on Google Drive)
2. Export `Data` sheet as a CSV file. Say `data2.csv`
3. Using `sqlite3` import the CSV file.
```
$ sqlite3 newdb.sqlite
```
```
sqlite> CREATE TABLE IF NOT EXISTS "raw_data" (
"YearTerm" INTEGER,
"CrsPBADept" TEXT,
"CrsPBAColl" TEXT,
"CrsPBADiv" TEXT,
"Subject" TEXT,
"Course" INTEGER,
"CourseTitle" TEXT,
"Level" TEXT,
"CrsLvlNum" TEXT,
"Activity_Type" TEXT,
"Instruction_Mode" TEXT,
"Hours" REAL,
"N_EOT" INTEGER,
"N_ENROLL" INTEGER,
"N_GRADE" REAL,
"PCT_GRADE" TEXT,
"AVG_GRD" REAL,
"PCT_A" TEXT,
"PCT_B" TEXT,
"PCT_C" TEXT,
"PCT_D" TEXT,
"PCT_F" TEXT,
"PCT_C_MINUS_OR_BELOW" TEXT,
"PCT_DF" TEXT,
"PCT_DFW" TEXT,
"PCT_WDRAW" TEXT,
"PCT_INCOMP" TEXT,
"N_PASS" INTEGER,
"N_NOCRED" INTEGER,
"N_INCOMP" INTEGER,
"RAP" INTEGER,
"Honors" INTEGER,
"insname1" TEXT,
"insgrp1" TEXT,
"insttl1" TEXT,
"insname2" TEXT,
"insgrp2" TEXT,
"insttl2" TEXT,
"insname3" TEXT,
"insgrp3" TEXT,
"insttl3" TEXT,
"Section" TEXT,
"NComb" INTEGER,
"Subject_Label" TEXT
);
sqlite> .mode csv
sqlite> .import data2.csv raw_data
sqlite> DELETE from raw_data where YearTerm < 20161;
sqlite> VACUUM;
```
Now, you can replace the database with the latest version:
```
$ mv newdb.sqlite grades.sqlite
```
|