Question
1. Using MySQL Workbench: Create a new schema for this lab. In the Lab07DB.sql file, add a USE statement in line 1, specify the schema
1. Using MySQL Workbench: Create a new schema for this lab. In the Lab07DB.sql file, add a USE statement in line 1, specify the schema name you just created. Import the data from Lab07DB.sql 2. Reverse-engineer the database to produce the ER diagram for this database. Rely on the ERD to perform tasks 3a to 3c. 3. You will write and execute SQL commands to get information from the database. a) Create a stored procedure called MentoredStudents which will display student first and last names. Only students who are being mentored are to be selected. Sort the output by student last name, then first name. Paste this SQL in a Word document for later submission to Brightspace; specify this requirement number before the SQL (3a) b) Create a stored procedure called MentoringCount which will display the professor name and the number of students he/she is mentoring. Sort the output by the professor name. Paste the SQL in above noted Word document; specify this requirement number before the SQL (3b). c) Create a stored procedure called NonMentoringProfessors which will display professor name of those who are not mentoring (meaning, there is no record for them in the student_professor table). Use a subquery to determine the output. Sort the output by the professor name. Paste the SQL in above noted Word document; specify this requirement number before the SQL (3c). d) Execute the MentoredStudents stored procedure and capture a screen image of the entire desktop. Image should show the number of records being returned by the stored procedure from the MySQL Workbench Output window. Paste the screen image in above noted Word document; specify this requirement number before the SQL (3d). e) Execute the MentoringCount stored procedure and capture a screen image of the entire desktop. Image should show the number of records being returned by the stored procedure from the MySQL Workbench Output window. Paste the screen image in above noted Word document; specify this requirement number before the SQL (3e). f) Execute the NonMentoringProfessors stored procedure and capture a screen image of the entire desktop. Image should show the number of records being returned by the stored procedure from the MySQL Workbench Output window. Paste the screen image in above noted Word document; specify this requirement number before the SQL (3f). 4. While referring to this video: https://www.youtube.com/watch?v=DaAbmHJUmKM a) Backup one of the database you have created duirng this course. Note, when you get the the Object Selection tab (as shown in video), make sure to select only the database you want to backup. b) Execute this SQL, make sure to change databasename on third line to the database you are backing up SELECT table_schema AS Database_Name, MIN(create_time) AS Creation_Time FROM information_schema.tables WHERE table_schema = 'databasename'; Capture a screen image of the output of this query and paste the image in above noted Word document; specify this requirement number before the SQL (4b). c) Restore the database using the backup file you just created d) Execute this SQL, make sure to change databasename on third line to the database you are backing up SELECT table_schema AS Database_Name, MIN(create_time) AS Creation_Time FROM information_schema.tables WHERE table_schema = 'databasename';
Tables and colums are
-professor - professorId, professorProgram, PhoneNo, Age, ProfessorName
-student - studentno, studentprogram, phoneno, age, firstname, lastname
-student_professor - student_professor_id, professorId, StudentNo, Mentor
thanks for your help!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started