-
Notifications
You must be signed in to change notification settings - Fork 516
Week3 MAKEME
This homework is divided into several exercises. Please submit each exercise in a separate folder.
Hack Your Future is building a new website and we need your help. This is the data we want to show for each course/class.
The idea was to create two tables: class(id, description, numberofstudents, startdate, teacherid, teachername, teacheremail)
and students(id, name, grade)
.
Can you help us to normalize the database? Write a single javascript file with commands to create the tables for the database and insert the data from the example above.
In this exercise you will use the company database.
It turns out that many department are adopting a flat structure. In this flat structure, there is one manager for the department and everyone reports to him. There are no middle-managers. You need to write a javascript function that access as parameters a department number and employee number function flatify(dept_no, emp_no)
. The function then updates the database and makes this employee a manager for the department and also sets all employees in that department to report to him. Because the function uses two queries make sure to use transactions. In case of an error rollback the transaction.