Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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.
Make a list of inspection_id, fine, and inspector_comment from violations with an inspection_point category of
'toxic items'. Only include those violations where the assessed fine was zero dollars.
List the inspections (inspection_id) with their date and type for all inspections that had a violation, including the
category, in the category of 'personnel' for January 2016. Also print the description of the inspection_point that
was violated.
List Employee_id and Employee First and Last Name of those employees who earn at least 90% as much as their
manager's salary. Include in your answer the employee's salary and the manager's id number and salary. Name the
column of the Supervisor's Salary as Sup_Salary.
For employee 173558, make a list of all the establishments he/she has inspected. Include the employee's first and
last names, the license number of the establishment, and the DBA name. Also include the date of the inspection
with the results and the fine that was imposed. Sort the output by inspection date.
Make a list of all establishments that have had an inspection violation in the category of 'Toxic Items'. Include in
your answer DBA Name, inspection date and type, and any fine as well as the category.
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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions

Question

6. Describe to a manager the different types of distance learning.

Answered: 1 week ago