Answered step by step
Verified Expert Solution
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 InspectionPoint. 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 Followup Inspection.
Each InspectionPoint can apply to multiple Violations. Each Violation is for one InspectionPoint.
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 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 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 hisher manager. Show Employee ID Employee First and Last Names, and hisher
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 licenseno Inspection Date, Inspection Results, the
fine imposed for the violation, Inspection Point ID and description of the inspection point violated.
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