Question: Tables are here I only need help for question 4 from Part 1, and question 2 & 3 from Part 2. I would appreciate if


Tables are here


I only need help for question 4 from Part 1, and question 2 & 3 from Part 2. I would appreciate if anyone can help me. :)
Page 1 of 2 TE H3720/ Fall 2017 Homework #2. Name: Dr. Huang Late penalty: 10 points per week after due date. No more submission after 12/21/2017 TECH 3720-01: given on 11/9, due on 12/14/2017 TECH 3720-02: given on 11/8, due on 12/13/2017 . Please create your tables, views and stored routines under TECH3720_2017F database . Please refer dreamhome database for all questions Part I: Please evaluate, analyze and answer the following questions (10 pts) Create a table tHW2_1xxxx with the following fields and their data types (id: int, auto increment, Name: varchar(10), birthday: date, bno: varchar(8)), where id is the rimary key and branchno is a foreign key to the branchno column of Branch table in the dreamhome dtabase. All fields cannot be null Ans 2. (10 pts) Insert five records into your tHW2 1 xxxx table. The name and birthday should be different. Ans: (10 pts) Create a view vHW2_3 xxxx showing the age for each person in your tHW2_1_xxxx table. You need to use timestampdiff function to calculate the age. Your view column names should be (name and age). The age cannot be NULL. You have to fix the person's birthday in tHW2 1 xxxx if you get a NULL value Ans 4 (10 pts) Create a view vHW2 4 xxxx displaying the profit for every vendor listed in A Vendors table that every product is sold in A_Products table. All tables are based on dreamhome database. Your view column names should be (name, profit) Ans Part Il: Write Stored Routines. Grading criteria is based on the test cases for cach question. XXXX is youir database login ID. The email ID of the testing statements is demo 1. (15 points) Please write a stored procedure named sDisplayStaff XXXX ( city ) which will display the staff fname and Iname who work at the iven parameter branch city (9 points) (3 points) mysql> call sDisplaystaff_demo (null); mysql call sDisplaystaff_demo(' London The above SQL statement should have output I Fnane lnane I I John I White I (3 points) mysqI> call sDisplayStaff-demo('); The above statement should have output: l nessage I Please enter a valid city. I I Julie Lee
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
