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
f1d30fb2
Commit
f1d30fb2
authored
Dec 22, 2021
by
Richard
Browse files
script update
parent
d7035a4e
Changes
4
Hide whitespace changes
Inline
Side-by-side
run.sh
View file @
f1d30fb2
...
...
@@ -5,6 +5,7 @@
# 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
# 4. update connection info inside the python scripts
db_name
=
"ece356"
mysql
-u
root
--verbose
--verbose
$db_name
<
"scripts/script1.sql"
...
...
@@ -13,7 +14,7 @@ mysql -u root --verbose --verbose $db_name < "scripts/script3.sql"
#tested up to there ^
python3 scripts/update_course_offering_date.py
python3 update_imd_band.py
python3
scripts/
update_imd_band.py
mysql
-u
root
--verbose
--verbose
$db_name
<
"scripts/script4.sql"
...
...
scripts/script4.sql
View file @
f1d30fb2
...
...
@@ -78,6 +78,6 @@ alter table assessments
drop
column
assessment_type_o
;
drop
table
Courses
;
-- alter table studentInfo
-- drop column imd_band_o;
\ No newline at end of file
scripts/update_course_offering_date.py
View file @
f1d30fb2
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")
cnx
=
mysql
.
connector
.
connect
(
host
=
'127.0.0.1'
,
user
=
'root'
,
database
=
'ece356'
)
cursor
=
cnx
.
cursor
()
cursor
.
execute
(
"USE
EDUCATION
;"
)
cursor
.
execute
(
"USE
ece356
;"
)
cursor
.
execute
(
"SELECT * FROM courseOfferings;"
)
...
...
scripts/update_imd_band.py
View file @
f1d30fb2
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")
cnx
=
mysql
.
connector
.
connect
(
host
=
'127.0.0.1'
,
user
=
'root'
,
database
=
'ece356'
)
cursor
=
cnx
.
cursor
()
cursor
.
execute
(
"USE
EDUCATION
;"
)
cursor
.
execute
(
"USE
ece356
;"
)
cursor
.
execute
(
"SELECT * FROM studentInfo;"
)
c
=
cursor
.
fetchall
()
...
...
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