Commit 54751e98 authored by Stefan Vercillo's avatar Stefan Vercillo
Browse files

scripts update

parent caf4768f
......@@ -5,16 +5,17 @@
# 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="ece356"
db_name="education"
user="snvercil"
password="32darklink"
mysql -u root --verbose --verbose $db_name < "scripts/script1.sql"
mysql -u root --verbose --verbose $db_name < "scripts/script2.sql"
mysql -u root --verbose --verbose $db_name < "scripts/script3.sql"
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 scripts/update_course_offering_date.py
# # tested up to there ^
python3 update_course_offering_date.py
python3 update_imd_band.py
mysql -u root --verbose --verbose $db_name < "scripts/script4.sql"
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'
......
import mysql.connector
cnx = mysql.connector.connect(host='localhost', user='snvercil', database='Education', password="32darklink")
cnx = mysql.connector.connect(host='localhost', user='snvercil', database='education', password="32darklink")
cursor = cnx.cursor()
cursor.execute("USE EDUCATION;")
cursor.execute("SELECT * FROM courseOfferings;")
......
......@@ -36,7 +36,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