Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete the following setup tasks before attempting the assignment Connect to MySQL through the command line prompt to DO THIS ASSIGNMENT Next, please answer

Please complete the following setup tasks before attempting the assignment

Connect to MySQL through the command line prompt to DO THIS ASSIGNMENT

Next, please answer the questions:

1) How many total rows are in the data set?.

2) Write the SQL that returns just the name, inspection_type, score, and violation for all restaurants that had a score less than 50.

3) How many rows of restaurants had a score of at least 60 and had High Risk risk categories for their inspections? What was the lowest? Include the SQL

4) How many unique restaurants had a violation that mentioned vermin? Include the SQL.

5) How many unique violations did King Ling have? Include the SQL for your solution.

------ - - -- - - -- -- - - ------------------------------------ ---------- -------------------- ------- ---- --- --- -- - --------------

use This script BELOW to answer above questions:

Create the database

Create the schema (a single table)

Type show tables (this will return a single table, called business)

Type desc business (this will show the attribute/column types)

The instructor will go over the meaning of each column

------------- --------------------------- drop database if exists cs4660a1; create database cs4660a1; use cs4660a1; DROP TABLE IF EXISTS `business`; CREATE TABLE `business` ( `id` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, `address` varchar(45) DEFAULT NULL, `zip` varchar(45) DEFAULT NULL, `inspection_date` varchar(20) DEFAULT NULL, `score` int(11) DEFAULT NULL, `inspection_type` varchar(255) DEFAULT NULL, `violation` varchar(255) DEFAULT NULL, `risk_category` varchar(255) DEFAULT NULL ); INSERT INTO `business` VALUES (1350,'KING OF THAI NOODLE HOUSE','639 CLEMENT St','94118','5/18/16 0:00',77,'Routine - Unscheduled','Improper thawing methods','Moderate Risk'),(13426,'Trader Joe\'s','401 Bay St','94133','9/2/14 0:00',0,'Complaint','High risk vermin infestation','High Risk'),(80419,'San Francisco Farmers Market','4929 Mission St','94112','9/30/16 0:00',79,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(2755,'SOCIALE','3665 SACRAMENTO St','94118','12/5/16 0:00',85,'Routine - Unscheduled','Inadequate and inaccessible handwashing facilities','Moderate Risk'),(85037,'The Temporarim','3414 22nd St','94110','12/6/16 0:00',90,'Routine - Unscheduled','Food safety certificate or food handler card not available','Low Risk'),(79406,'Marla Bakery','3619 Balboa St','94121','4/12/16 0:00',87,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(69762,'Chili House Inc.','726 Clement St','94118','4/13/16 0:00',68,'Routine - Unscheduled','Unclean hands or improper use of gloves','High Risk'),(62943,'Irving Pizza','928 Geary St','94109','9/2/16 0:00',75,'Routine - Unscheduled','No thermometers or uncalibrated thermometers','Low Risk'),(86362,'Aina','900 22nd St','94107','9/23/16 0:00',98,'Routine - Unscheduled','Improper food storage','Low Risk'),(18369,'Dong Bei Mama','4737 Geary Blvd','94118','11/8/16 0:00',63,'Routine - Unscheduled','Improper storage of equipment utensils or linens','Low Risk'),(85952,'Juice Craze','3251 20th Ave 5517','94132','10/18/16 0:00',76,'Routine - Unscheduled','Insufficient hot water or running water','Moderate Risk'),(65238,'La Quinta Restaurant','2425 MISSION St','94110','12/6/16 0:00',92,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(78220,'Howard & 6th Street Food Market Inc.','1000 Howard St','94103','3/27/14 0:00',0,'New Ownership','Moderate risk food holding temperature','Moderate Risk'),(14568,'THE Art Bistro','6900 GEARY BLVD','94121','5/2/16 0:00',88,'Routine - Unscheduled','Inadequate and inaccessible handwashing facilities','Moderate Risk'),(71804,'La Urbana','661 Divisadero St','94117','2/21/14 0:00',80,'Routine - Unscheduled','Improper cooking time or temperatures','High Risk'),(68454,'Kippu Japanese Restaurant','1707 BUCHANAN St','94115','2/23/16 0:00',77,'Routine - Unscheduled','Unclean or degraded floors walls or ceilings','Low Risk'),(9164,'WORKING GIRLS\' CAFE #4','122 NEW MONTGOMERY STREET','94105','8/12/16 0:00',83,'Routine - Unscheduled','Food safety certificate or food handler card not available','Low Risk'),(1747,'Nara Sushi','1515 Polk St','94109','4/13/16 0:00',78,'Routine - Unscheduled','Unapproved or unmaintained equipment or utensils','Low Risk'),(3659,'SQUAT & GOBBLE CAFE #4','001 WEST PORTAL Ave','94127','6/3/16 0:00',88,'Routine - Unscheduled','Moderate risk food holding temperature','Moderate Risk'),(82036,'AT&T PARK - Food Stand','24 Willie Mays Plaza','94107','8/14/16 0:00',96,'Routine - Unscheduled','Improper food storage','Low Risk'),(4672,'IRVING SEAFOOD MARKET','2130 IRVING St','94122','12/6/16 0:00',84,'Routine - Unscheduled','Unclean or unsanitary food contact surfaces','High Risk'),(79753,'Mazarine Coffee','720 Market St','94102','10/14/16 0:00',94,'Routine - Unscheduled','Wiping cloths not clean or properly stored or inadequate sanitizer','Low Risk'),(68865,'Grant Place Restaurant','737 Washington St','94108','6/28/16 0:00',74,'Routine - Unscheduled','Wiping cloths not clean or properly stored or inadequate sanitizer','Low Risk'),(61856,'Yoppi Yogurt','101 California St','94111','4/13/16 0:00',90,'Routine - Unscheduled','Inadequate and inaccessible handwashing facilities','Moderate Risk'),(60544,'Manzoni','2790 Diamond St','94131','9/29/16 0:00',92,'Routine - Unscheduled','Moderate risk food holding temperature','Moderate Risk'),(328,'Miyako','1470 Fillmore St','94115','3/5/14 0:00',94,'Routine - Unscheduled','Unclean or degraded floors walls or ceilings','Low Risk'),(328,'Miyako','1470 Fillmore St','94115','3/5/14 0:00',94,'Routine - Unscheduled','Unclean nonfood contact surfaces','Low Risk'),(328,'Miyako','1470 Fillmore St','94115','3/5/14 0:00',94,'Routine - Unscheduled','Food safety certificate or food handler card not available','Low Risk'),(18369,'Dong Bei Mama','4737 Geary Blvd','94118','11/8/16 0:00',63,'Routine - Unscheduled','Inadequate or unsanitary refuse containers or area or no garbage service','Low Risk'),(5478,'AT&T - (CART 60) Murph\'s Pub [145147]','24 WILLIE MAYS PLAZA','94107','8/14/16 0:00',96,'Routine - Unscheduled','Inadequate and inaccessible handwashing facilities','Moderate Risk'),(63136,'Sodexo at PG & E Energy Center','851 HOWARD St','94103','11/9/16 0:00',96,'Routine - Unscheduled','Moderate risk vermin infestation','Moderate Risk'),(2652,'VILLAGE PIZZERIA','1243 VAN NESS Ave','94109','10/18/16 0:00',77,'Routine - Unscheduled','Sewage or wastewater contamination','High Risk'),(68454,'Kippu Japanese Restaurant','1707 BUCHANAN St','94115','2/23/16 0:00',77,'Routine - Unscheduled','Moderate risk food holding temperature','Moderate Risk'),(78604,'Tu Kim\'s Cafe','609 Ellis St','94109','4/30/14 0:00',86,'Routine - Unscheduled','Unapproved or unmaintained equipment or utensils','Low Risk'),(84037,'Pinkies Bakery','833 Cortland Ave','94110','3/29/16 0:00',84,'Routine - Unscheduled','Permit license or inspection report not posted','Low Risk'),(3228,'THANH LONG RESTAURANT','4101 JUDAH St','94122','3/30/16 0:00',92,'Routine - Unscheduled','Food safety certificate or food handler card not available','Low Risk'),(473,'Caffe Greco','423 Columbus Ave','94133','7/20/15 0:00',0,'Complaint','High risk food holding temperature','High Risk'),(1677,'PRIMO PATIO CAFE','214 Townsend St','94107','1/5/17 0:00',88,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(83589,'City Pizza and Burger Inc.','464 Broadway St','94133','10/13/15 0:00',70,'Routine - Unscheduled','Inadequate ventilation or lighting','Low Risk'),(4542,'Shaws San Francisco','122 West Portal Ave','94127','6/3/16 0:00',94,'Routine - Unscheduled','Unsanitary employee garments hair or nails','Low Risk'),(79252,'E & J Fine Meats','1706 Church St','94122','7/15/16 0:00',0,'Complaint','Unsanitary employee garments hair or nails','Low Risk'),(81987,'Celtic Coffee Company','142 McAllister St','94102','6/27/16 0:00',83,'Routine - Unscheduled','Food safety certificate or food handler card not available','Low Risk'),(14568,'THE Art Bistro','6900 GEARY BLVD','94121','5/2/16 0:00',88,'Routine - Unscheduled','Inadequately cleaned or sanitized food contact surfaces','Moderate Risk'),(64513,'Gold Coast Grill & Catering','1650 HOLLOWAY Ave','94132','5/18/16 0:00',92,'Routine - Unscheduled','Unapproved or unmaintained equipment or utensils','Low Risk'),(62357,'Mariscos Frescos Estilo Masatlan','975 Bayshore blvd.','94124','1/19/16 0:00',0,'Structural Inspection','',''),(1754,'Fisherman\'s Pizzeria Inc [#50]','2800 Leavenworth St','94133','12/2/16 0:00',86,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(82123,'Cafe New Honolulu','888 Stockton St','94108','4/27/15 0:00',0,'New Ownership','Foods not protected from contamination','Moderate Risk'),(78374,'AT&T PARK - Food Cart','24 Willie Mays Plaza','94107','8/14/16 0:00',96,'Routine - Unscheduled','Inadequate and inaccessible handwashing facilities','Moderate Risk'),(5645,'AT&T - SAY HEY SAUSAGE room 2127 [145177]','24 WILLIE MAYS PLAZA','94107','8/14/16 0:00',100,'Routine - Unscheduled','',''),(86180,'Tian Tian Market Inc.','1117 Stockton St','94133','12/5/16 0:00',84,'Routine - Unscheduled','Inadequate dressing rooms or improper storage of personal items','Low Risk'),(89143,'Sno-Crave Tea House','1181 Ocean Ave','94112','12/20/16 0:00',0,'New Construction','',''),(2833,'Lefty O`Doul`s','333 Geary St','94102','9/9/14 0:00',0,'Complaint','Foods not protected from contamination','Moderate Risk'),(70713,'Uni\'s Deli','1200 VERMONT St','94110','5/3/16 0:00',90,'Routine - Unscheduled','Wiping cloths not clean or properly stored or inadequate sanitizer','Low Risk'),(1005,'CHAVITA\'S MEXICAN RESTAURANT','3006 MISSION St','94110','5/2/16 0:00',84,'Routine - Unscheduled','Inadequately cleaned or sanitized food contact surfaces','Moderate Risk'),(68692,'Sidewalk Juice','3100 24th St','94110','4/28/16 0:00',92,'Routine - Unscheduled','Unclean or degraded floors walls or ceilings','Low Risk'),(33700,'Casa Guadalupe #3','2999 MISSION','94110','11/17/14 0:00',90,'Routine - Unscheduled','Improper food storage','Low Risk'),(2497,'PLUTO\'S','3258 SCOTT St','94123','6/7/16 0:00',85,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(68442,'Sauce Belden','56 Belden Pl','94104','1/24/14 0:00',92,'Routine - Unscheduled','Unclean or degraded floors walls or ceilings','Low Risk'),(903,'Sabra Restaurant','419 Grant Ave','94108','2/25/14 0:00',0,'Reinspection/Followup','',''),(86301,'Cafe Murano','2301 Bryant St','94110','3/24/16 0:00',0,'New Ownership','Moderate risk food holding temperature','Moderate Risk'),(83553,'B On The Go LLC','2794 California St','94115','9/28/16 0:00',92,'Routine - Unscheduled','Moderate risk vermin infestation','Moderate Risk'),(37344,'Civic Restaurant & Bar','272 McAllister St','94102','10/19/15 0:00',0,'Complaint','Food safety certificate or food handler card not available','Low Risk'),(84387,'Lucky Ocean Cafe','1501 Ocean Ave','94112','8/18/15 0:00',0,'New Ownership','Other low risk violation','Low Risk'),(383,'King Ling','683 Geary St','94102','8/22/14 0:00',88,'Routine - Unscheduled','Improper storage of equipment utensils or linens','Low Risk'),(383,'King Ling','683 Geary St','94102','8/22/14 0:00',88,'Routine - Unscheduled','Wiping cloths not clean or properly stored or inadequate sanitizer','Low Risk'),(68600,'Black Point Cafe','882 North Point St','94109','8/15/16 0:00',0,'Reinspection/Followup','',''),(383,'King Ling','683 Geary St','94102','8/22/14 0:00',88,'Routine - Unscheduled','Inadequate food safety knowledge or lack of certified food safety manager','Moderate Risk'),(7496,'Peralta','Pier 41','94133','5/18/16 0:00',88,'Routine - Unscheduled','Improper storage of equipment utensils or linens','Low Risk'),(59397,'Basa Seafood Express','3064 24th St','94110','1/14/16 0:00',90,'Routine - Unscheduled','Unapproved or unmaintained equipment or utensils','Low Risk'),(5257,'LITTLE BAOBAB','3388 19th St','94110','1/6/17 0:00',0,'Reinspection/Followup','',''),(79632,'Buttermilk Southern Kitchen','2848 23rd St','94110','3/22/16 0:00',89,'Routine - Unscheduled','Moderate risk food holding temperature','Moderate Risk'),(2055,'Sun Kwong Restaurant','1400 Jackson St','94109','3/23/16 0:00',88,'Routine - Unscheduled','Unsanitary employee garments hair or nails','Low Risk'),(59838,'OTD','2232 Bush St','94115','5/31/16 0:00',92,'Routine - Unscheduled','Insufficient hot water or running water','Moderate Risk'),(69792,'Samiramis Imports','2990 MISSION St','94110','4/12/16 0:00',88,'Routine - Unscheduled','Non service animal','Low Risk'),(75380,'Zee Cooks LLC','1760 Cesar Chavez St Unit L','94124','4/28/16 0:00',91,'Routine - Unscheduled','Unclean hands or improper use of gloves','High Risk'),(69026,'GM Market Inc.','958 Geneva Ave','94112','6/7/16 0:00',92,'Routine - Unscheduled','Employee eating or smoking','Moderate Risk'),(1754,'Fisherman\'s Pizzeria Inc [#50]','2800 Leavenworth St','94133','12/2/16 0:00',86,'Routine - Unscheduled','Unapproved or unmaintained equipment or utensils','Low Risk'),(85908,'Yummy Sticks','428 11th St','94103','1/28/16 0:00',0,'New Construction','',''),(69147,'Mission Rock Resort','817 TERRY FRANCOIS Blvd','94107','12/5/16 0:00',91,'Routine - Unscheduled','Improper cooling methods','High Risk'),(2807,'Grandeho\'s Kamekyo II','2721 Hyde St','94109','8/15/16 0:00',0,'Reinspection/Followup','',''),(61595,'Hog & Rocks','3431 19th St','94110','4/13/16 0:00',86,'Routine - Unscheduled','Low risk vermin infestation','Low Risk'),(3729,'Ruby Skye','420 Mason St','94102','9/8/14 0:00',78,'Routine - Unscheduled','Unclean or unsanitary food contact surfaces','High Risk'),(81667,'Crazy Pepper','2257 San Jose Ave','94112','9/6/16 0:00',0,'Reinspection/Followup','',''),(2943,'Tarantino\'s','206 Jefferson St','94133','6/6/16 0:00',0,'Reinspection/Followup','',''),(66536,'Cypress Grill','99 Harding Park Rd','94132','4/13/16 0:00',90,'Routine - Unscheduled','Moderate risk food holding temperature','Moderate Risk'),(3237,'LAM HOA THUAN RESTAURANT','2337 IRVING St','94122','4/28/14 0:00',83,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(79406,'Marla Bakery','3619 Balboa St','94121','4/12/16 0:00',87,'Routine - Unscheduled','High risk food holding temperature','High Risk'),(89453,'Burger King #4668','1690 Valencia St','94110','10/19/16 0:00',0,'New Ownership','Improper or defective plumbing','Low Risk'),(40212,'Borderlands Cafe','870 Valencia St','94110','1/20/16 0:00',100,'Routine - Unscheduled','',''),(5313,'S.F. Bay Concessionaires Commissary','Pier 41','94133','5/18/16 0:00',92,'Routine - Unscheduled','Low risk vermin infestation','Low Risk'),(1103,'STARBUCKS COFFEE','4094 18th St','94114','5/19/15 0:00',100,'Routine - Unscheduled','',''),(2974,'LEAPING LEMUR CAFE','1 ZOO Rd','94132','7/22/16 0:00',89,'Routine - Unscheduled','Inadequately cleaned or sanitized food contact surfaces','Moderate Risk'),(12199,'El Gallo Giro','3055 23rd St','','6/28/16 0:00',92,'Routine - Unscheduled','Unclean or degraded floors walls or ceilings','Low Risk'),(37633,'100% Dessert Cafe','2512 Clement St','94121','5/19/16 0:00',72,'Routine - Unscheduled','Foods not protected from contamination','Moderate Risk'),(393,'SUPER STAR RESTAURANT','4919 MISSION St B','94112','7/7/15 0:00',90,'Routine - Unscheduled','Inadequate warewashing facilities or equipment','Low Risk'),(393,'SUPER STAR RESTAURANT','4919 MISSION St B','94112','7/7/15 0:00',90,'Routine - Unscheduled','Unclean nonfood contact surfaces','Low Risk'),(393,'SUPER STAR RESTAURANT','4919 MISSION St B','94112','7/7/15 0:00',90,'Routine - Unscheduled','Food safety certificate or food handler card not available','Low Risk'),(393,'SUPER STAR RESTAURANT','4919 MISSION St B','94112','7/7/15 0:00',90,'Routine - Unscheduled','Inadequate and inaccessible handwashing facilities','Moderate Risk'),(4957,'Safeway Stores Inc #711','15 MARINA BL','94123','8/28/14 0:00',0,'Reinspection/Followup','',''); 

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

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago

Question

6. Testing equipment that will be used in instruction.

Answered: 1 week ago