Assume the following relational model representing the design for BurgerBay
1.
Using BurgerBay relational model, write the SQL statements to create the tables Supply, Schedule and Employees.
Use the following information to define your attributes.
SupplierID : integer ; Each supplier must provide supplies
RestaurantLicense : integer ; Each restaurant must have supplies ;
Each restaurant must have an employee schedule
ScheduleID: integer
EmployeeID: integer
Day: date format ; required value
StartTime: integer; required value
EndTime: integer; required value
EmployeeName: 50 characters maximum; required value
NbrYearEmployed: integer; optional value
Employee_Type: 1 character; required value; only allowed values are ‘C’ (for Cook) and ‘M’ (for Manager)
2.
Using BurgerBay relational model, write the SQL statements answering the following queries :
a. Display the name and city of all suppliers.
SELECT SupplyName, City
FROM Suppliers;
b. Display the EmployeeID, employee name and number of years employed of all the Managers employed for more than 5 years. Display your results from the most recent to the most experienced managers.
c. Count the number of restaurants located in each of the following states : California (CA) , Oregon (OR) and Nevada (NV).
Assume that states are stored in the database using two characters code, meaning CA, OR and NV.
Make sure your query displays the number of restaurants for each state; NOT the number of restaurants for all states combined.
d. Using Subqueries, display the name and contract fee of the advertisement agencies working with restaurants located in the state of California.
e.
Using Join queries, display the name and contract fee of the advertisement agencies working with restaurants located in the state of California.
f. Using the method of your choice, display the EmployeeID, employee name , schedule day ,start time and end time of the employees who work for a restaurant located in the city of San Francisco.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps
- EMPLOYEE Frame Minit Lname Sen Bdate Address Sex Salary Super sen Dno +444 DEPARTMENT Dname Dnumber Mor an Mgr start date DEPT LOCATIONS Dnumber Dlocation PROJECT Prame Prumber Plocation Dnum WORKS ON Ennn Pno Hoir Hours DEPENDENT Esen Dependent name Se Bdate Relationship Reforential integrity constraints displayed on the COMFWNY relational database schema. One possible database state for the COMPANY relational database schema. EMPLOYEE Fname Minit Lname John Frankin T Sex Salary 30000 333445555 5 M 40000 Jo00665555 F 25000 Joe7e54321 43000 J88Ge5556 San Bdate Address Super en Dno 123456789 1965-01-09 731 Fondren, Hounton, TX M 333445555 1955-12-08 638 Voas, Houston, TX Go0087777 1960-01-19 3321 Castle, Spring. TX 987654321 1941-06-20 291 Berry, Bellaire, TX Narayan 666884444 1962-09-15 975 Fire Oak, Humibile, TX M B Smith Wong Zelaya Wallace 5 Alicia 4 Jennifer F 38000 333445655 25000 333445555 M 25000 007654321 M 55000 NULL Ramesh English 453453453 1972-07-31 5631 Rice, Houston, TX F…arrow_forwardAssume the e-commercial database shown in the Appendix. Write the following queries in (a) relational algebra and (b) SQL. State your assumptions if the semantics is not clear. 1) Find the names of all students who have not taken any courses. APPENDIX STUDENTS(student id, first_name, last _name, email, major_code, class_year) COURSES(course id, course_name, course_description, credits, department_code) ENROLLMENTS(student id, course id, semester, grade) MAJORS(major code, major_name, department_code) DEPARTMENTS(department code, department_name)arrow_forwardPLz help with the following: Translate your ER diagram into a relational schema in the form of SQL DDLs. Choose appropriate data types for each attribute and include primary key and foreign key constraints, Check and Not Null constraints.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY