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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Assume the following relational model representing the design for BurgerBay database and use it to answer questions

 

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.

Specialty
SpecialtyID SpecialtyName
Suppliers
SupplierlD SupplierName
City
AdvertisementAgency
Supply
AdAgencylD
AgencyName
City
State
ZipCode
ContractFee
SupplierID Restaurantlicense
Restaurant
Restaurantlicense
Size
Street
City
State
ZipCode
Drive Thru
Dineln
AdAgencylD
Express
ERestaurantlicense DTOpenTime DTCloseTIme
Dine-In
DRestaurantLicense Max_Capacity
Schedule
SchedulelD
EmployeelD
RestaurantLicense
Day
StartTime
EndTime
Employees
EmployeelD
EmployeeName
NbrYearEmployed
Employee_Type
Manager
MEmployeelD
OfficePhone
Cook
CEmployeelD
CookingStation
Cooking Station
StationName
CEmployeelD
Transcribed Image Text:Specialty SpecialtyID SpecialtyName Suppliers SupplierlD SupplierName City AdvertisementAgency Supply AdAgencylD AgencyName City State ZipCode ContractFee SupplierID Restaurantlicense Restaurant Restaurantlicense Size Street City State ZipCode Drive Thru Dineln AdAgencylD Express ERestaurantlicense DTOpenTime DTCloseTIme Dine-In DRestaurantLicense Max_Capacity Schedule SchedulelD EmployeelD RestaurantLicense Day StartTime EndTime Employees EmployeelD EmployeeName NbrYearEmployed Employee_Type Manager MEmployeelD OfficePhone Cook CEmployeelD CookingStation Cooking Station StationName CEmployeelD
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY