Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alexander Jabbour
356 group 40 project
Commits
54751e98
Commit
54751e98
authored
Dec 23, 2021
by
Stefan Vercillo
Browse files
scripts update
parent
caf4768f
Changes
4
Hide whitespace changes
Inline
Side-by-side
run.sh
→
scripts/
run.sh
View file @
54751e98
...
...
@@ -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"
scripts/script1.sql
View file @
54751e98
...
...
@@ -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
'
...
...
scripts/update_course_offering_date.py
View file @
54751e98
import
mysql.connector
cnx
=
mysql
.
connector
.
connect
(
host
=
'localhost'
,
user
=
'snvercil'
,
database
=
'
E
ducation'
,
password
=
"32darklink"
)
cnx
=
mysql
.
connector
.
connect
(
host
=
'localhost'
,
user
=
'snvercil'
,
database
=
'
e
ducation'
,
password
=
"32darklink"
)
cursor
=
cnx
.
cursor
()
cursor
.
execute
(
"USE EDUCATION;"
)
cursor
.
execute
(
"SELECT * FROM courseOfferings;"
)
...
...
scripts/update_imd_band.py
View file @
54751e98
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment