Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

These queries use the Chicago Food Establishment Inspections database as shown in the figure below. Chicago Food Establishment Inspections is a government regulatory entity that

These queries use the Chicago Food Establishment Inspections database as shown in the figure below. Chicago
Food Establishment Inspections is a government regulatory entity that inspects food establishments to verify that
they are meeting all the food regulations that have been established by the city. The structure of the database is
simple in order to facilitate understanding and writing of solution queries. Be sure that you understand the
database structure before attempting to write the SQL queries.
The database consists of five tables: Establishment, Employee, Inspection, Violation, and Inspection_Point. The key
symbol indicates which attribute is the key field for the table. The relationship lines indicate foreign keys.
, Each Establishment has multiple inspections. Each Inspection is for one Establishment.
, Each Employee has one Supervisor. Each Supervisor manages multiple Employees.
, Each Employee does multiple Inspections. Each Inspection is done by one Employee.
, Each Inspection can have multiple Violations. Each Violation occurs on one Inspection.
An Inspection can cause a single Follow-up Inspection.
, Each Inspection_Point can apply to multiple Violations. Each Violation is for one Inspection_Point.
For each information request below, formulate a single SQL query to produce the required information. In each
case, you should display only the columns requested. Be sure that your queries do not produce duplicate records
unless otherwise directed. In some cases, there are several queries that may be correct, but the problem definition
may specify a particular approach. In that case, be sure you write the query exactly as specified.
List the inspections for the establishments doing business as Chipotle Mexican Grill conducted during 2016. In the
list give the License Number, the DBA Name, the Inspection date, the Inspection Type, and the Results. Sort it by
inspection date.
List the inspections done by employee number 172276. Show the employee's full name, the inspection date and
inspection type, and the results. Sort the output by inspection date.
List the establishments that have been inspected by Cecelia Glenn. List the DBA Name, the Facility Type, the
Inspection Date and Type, and the Results.
List each employee with his/her manager. Show Employee ID, Employee First and Last Names, and his/her
manager's first and last names. Title the manager's name columns as ManagerFirst and ManagerLast. Sort the
output by the Manager's last name.
List the violations for the Happy Foods establishments. Provide license_no, Inspection Date, Inspection Results, the
fine imposed for the violation, Inspection Point ID, and description of the inspection point violated.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions