Commit 3fde56d1 authored by Richard's avatar Richard
Browse files

update script run

parents f1d30fb2 02ce2a03
#!/bin/bash
# ** README **
# Requirements:
# 1. mysql-connector pip module installed
# 2. local path to loading data files updated in script1
# 3. input your database name for the db_name variable
db_name="education"
user="snvercil"
password="PASSWORD"
mysql -u $user --password=$password --verbose --verbose $db_name < "script1.sql"
mysql -u $user --password=$password --verbose --verbose $db_name < "script2.sql"
mysql -u $user --password=$password --verbose --verbose $db_name < "script3.sql"
# # tested up to there ^
python3 update_course_offering_date.py
python3 update_imd_band.py
mysql -u $user --password=$password --verbose --verbose $db_name < "script4.sql"
......@@ -89,46 +89,46 @@ create table studentVle (
load data LOCAL infile '/Users/rzhang/workspace/356/356-group-40-project/data_files/courses.csv' ignore into table courseOfferings
load data LOCAL infile '/home/stefan/stefan/3B/356/ece356/project/data_files/courses.csv' ignore into table courseOfferings
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
load data LOCAL infile '/Users/rzhang/workspace/356/356-group-40-project/data_files/assessments.csv' ignore into table assessments
load data LOCAL infile '/home/stefan/stefan/3B/356/ece356/project/data_files/assessments.csv' ignore into table assessments
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
load data LOCAL infile '/Users/rzhang/workspace/356/356-group-40-project/data_files/vle.csv' ignore into table vle
load data LOCAL infile '/home/stefan/stefan/3B/356/ece356/project/data_files/vle.csv' ignore into table vle
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
load data LOCAL infile '/Users/rzhang/workspace/356/356-group-40-project/data_files/studentInfo.csv' ignore into table studentInfo
load data LOCAL infile '/home/stefan/stefan/3B/356/ece356/project/data_files/studentInfo.csv' ignore into table studentInfo
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
load data LOCAL infile '/Users/rzhang/workspace/356/356-group-40-project/data_files/studentAssessment.csv' ignore into table studentAssessment
load data LOCAL infile '/home/stefan/stefan/3B/356/ece356/project/data_files/studentAssessment.csv' ignore into table studentAssessment
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
load data LOCAL infile '/Users/rzhang/workspace/356/356-group-40-project/data_files/studentRegistration.csv' ignore into table studentRegistration
load data LOCAL infile '/home/stefan/stefan/3B/356/ece356/project/data_files/studentRegistration.csv' ignore into table studentRegistration
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
load data LOCAL infile '/Users/rzhang/workspace/356/356-group-40-project/data_files/studentVle.csv' ignore into table studentVle
load data LOCAL infile '/home/stefan/stefan/3B/356/ece356/project/data_files/studentVle.csv' ignore into table studentVle
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
......
......@@ -79,5 +79,5 @@ alter table assessments
drop table Courses;
-- alter table studentInfo
\ No newline at end of file
alter table studentInfo
drop column highest_education;
......@@ -37,7 +37,7 @@ for row in c:
s = f"update studentInfo set imd_band = {d} where id_student = {row[0]}"
print(s)
cursor.execute(s)
# Make sure data is committed to the database
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment