Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help in creating an ER diagram and translating it to SQL statements based on the yelp dataset? I have taken some screenshots of
Can someone help in creating an ER diagram and translating it to SQL statements based on the yelp dataset? I have taken some screenshots of the parsed data.
yelp_Business:
yelp_checkin
yelp_review
yelp_user
In this milestone you will parse the Yelp JSON data and develop a simple database application. The goal of this exercise is to get you started in database programming early on. In Milestone3 you will develop a larger application with all required features. stone Description: 1) Download the Yelp dataset from the Project Description course item on the Learning Management Service website. Look at each JSON file and understand what information the JSON objects provide. Pay attention to the data items in JSON objects that you will need for your application. Download the JSON Parser program (Python) from Blackboard (ProjectResources|Milestone1|JSON Parsing Code). This programs: reads the JSON objects form the data files and extracts certain key and value pairs from JSON objects, writes extracted data into text files. Please make sure that you can run this program successfully and parse all files (yelp_business.json, yelp_review.json, yelp_user.json, yelp_checkin.json) in the given Yelp data. The code assumes that the data files are in the current directory. In milestone-2, you will update this code and directly insert the data onto a PotgreSQL database. Parsing Check-in Data: The check-in objects include information about the number of check-ins for a particular business. The "time" check-in JSON objects are in the form of: "day": { "hour": number of checkins, ,... } For example "Friday": { "20:00": 5, "21:00": 10} shows that there are 5 check-ins between 20:00pm and 20:59pm and 10 check-ins between 21:00pm and 21:59pm on Friday. (time values are based on 24hour clock (i.e., military time)) 2) i) Design a database schema that models the database for the described application scenario in Appendix-A and provide the ER diagram for your database design. Your database schema doesn't necessarily need to include all the data items provided in the JSON files. Your schema should be precise but yet complete. It should be designed in such a way that all queries/data retrievals on/from the database run efficiently and effectively. In Milestone2 you will revise your ER model. ii) Translate your ER model into relations and produce DDL SQL statements for creating the corresponding tables in a relational DBMS. Note the constraints, including key constraints, referential integrity constraints, not NULL constraints, etc. needed for the relational schema to capture and enforce the semantics of your ER design. |'Blimpie', '4719 N 20Th St', 'Phoenix', 'AZ' , '85016', 33.5059283, -112.0388474,4.5,10,0 'duHFBe87uNSXImQmvBh87Q' , 'Sandwiches. 'duHFBe87unSXImQmvBh87Q' , 'Restaurants ' 'duHFBe87unSXImQmvBh87Q' , 'RestaurantsTableService ', 'False' 'duHFBe87unSXImQmvBh87Q' , 'dessert' , 'False' 'duHFBe87uNSXImQmvBh87Q' , 'latenight' , 'False ' 'duHFBe87uNSXImQmvBh87Q' , 'lunch ', 'False ' 'duHFBe87uNSXImQmvBh87Q', ' dinner', ' False ' 'duHFBe87uNSXImQmvBh87Q' , 'breakfast ', 'False' 'duHFBe87uNSXImQmvBh87Q', ' brunch ', 'False' 'duHFBe87uNSXImQmvBh87Q', 'Alcohol', 'none' ' duHFBe87uNSXImQmvBh87Q' , 'Caters ', 'True ' ' duHFBe87uNSXImQmvBh87Q' , 'HasTV' , 'False ' 'duHFBe87uNSXImQmvBh87Q' , 'RestaurantsGoodForGroups ', 'True ' 'duHFBe87uNSXImQmvBh87Q', ' Noiselevel ', 'quiet. ' duHFBe87unSXImQmvBh87Q' , 'WiFi' , 'no' 'duHFBe87uNSXImQmvBh87Q' , 'RestaurantsAttire ' , 'casual' ' duHFBe87unSXImQmvBh87Q' , 'RestaurantsReservations ' , 'False ' ' duHFBe87unSXImQmvBh87Q' , 'OutdoorSeating ' , 'False ' ' duHFBe87unSXImQmvBh87Q' , 'BusinessAcceptsCreditCards ', 'True ' 'duHFBe87unSXImQmvBh87Q' , 'RestaurantsPriceRange2' , '1' ' duHFBe87unSXImQmvBh87Q', ' BikeParking' , 'True' 'duHFBe87uNSXImQmvBh87Q' , 'RestaurantsDelivery ', 'False' 'duHFBe87unSXImQmvBh87Q' , 'romantic', ' False' ' duHFBe87uNSXImQmvBh87Q', 'intimate ', 'False' 'duHFBe87unSXImQmvBh87Q' , 'classy ', 'False' 'duHFBe87unSXImQmvBh87Q' , 'hipster' ', 'False' 'duHFBe87uNSXImQmvBh87Q' , 'divey' , 'False' 'duHFBe87uNSXImQmvBh87Q', 'touristy ', 'False ' 'duHFBe87uNSXImQmvBh87Q' , 'trendy', ' False' 'duHFBe87uNSXImQmvBh87Q', 'upscale' , 'False ' 'duHFBe87unSXImQmvBh87Q' , 'casual ', 'False' ' duHFBe87uNSXImQmvBh87Q' , 'RestaurantsTake0ut' , 'True ' 'duHFBe87uNSXImQmvBh87Q' , 'GoodForKids ', 'True' 'duHFBe87unSXImQmvBh87Q', 'garage ', 'False' 'duHFBe87unSXImQmvBh87Q', ' street', ' False' 'duHFBe87unSXImQmvBh87Q', 'validated ', 'False' 'duHFBe87unSXImQmvBh87Q' , 'lot' , 'False' 'duHFBe87uNSXImQmvBh87Q' , 'valet ', 'False ' 'Back-Health Chiropractic', '4425 N 24th St, Ste 125', 'Phoenix', 'AZ' , '85016' , 33.5028476, -112.012696, 5.0, 19,1 '2eJEUJIP54tex7T9Y0cLSw' , 'Chiropractors ' '2eJEUJIP54tex7T9Y0cLSw', 'Health \& Medical' '2eJEUJIP54tex7T9YOcLSw', ' Friday ' , '9:00' , '12:00' '2eJEUJIP54tex7T9YOcLSw', 'Tuesday ', '14:00' , '19:00' '2eJEUJIP54tex7T9YOcLSw' , 'Thursday ' , 14:00' , '19:00' '2eJEUJIP54tex7T9Y0cLSw' , 'Wednesday' , '14:30' , ' 17:00' '2eJEUJIP54tex7T9Y0cLSw' , 'Monday ' , '14:30' , '17:00' '2eJEUJIP54tex7T9Y0cLSw' , 'AcceptsInsurance ', 'True ' '2eJEUJIP54tex7T9YOcLSw' , 'ByAppointment0nly' , 'True ' '2eJEUJIP54tex7T9YOcLSw', 'BusinessAcceptsCreditCards' , 'True ' 'QQ Foot Spa', '6162 W Flamingo Rd', ' Las Vegas ', 'NV' , '89103' , 36.115465, -115.226764, 4.5, 20, 1 'xmYOpzNvZKEzuNOXEqeV5w' , 'Massage ' 'xmYOpzNvZKEzuNOXEqeV5w', 'Beauty \& Spas' |' dwQEZBFen2GdihLLfWeexA', 'Friday' , '20:00', 2 'dwQEZBFen2GdihLLfWeexA', 'Friday' , '19:00', 1 'dwQEZBFen2GdihLLfWeexA' , 'Friday' , '22:00' , 10 'dwQEZBFen2GdihLLfWeexA' , 'Friday' , '21:00' , 5 'dwQEZBFen2GdihLLfWeexA' , 'Friday' , '23:00' ,14 'dwQEZBFen2GdihLLfWeexA', 'Friday', ' :00 ', 2 'dwQEZBFen2GdihLLfWeexA', 'Friday' , '18:00', 2 'dwQEZBFen2GdihLLfWeexA', 'Thursday', '23:00' , 1 'dwQEZBFen2GdihLLfWeexA', 'Thursday' , '0:00', 1 'dwQEZBFen2GdihLLfWeexA', 'Thursday', '19:00',1 'dwQEZBFen2GdihLLfWeexA' , 'Thursday' , '18:00' , 1 ' dwQEZBFen2GdihLLfWeexA' , 'Thursday' , '16:00' , 2 'dwQEZBFen2GdihLLfWeexA' , 'Thursday' , '22:00', 2 'dwQEZBFen2GdihLL fWeexA', 'Wednesday' , '17:00', 2 'dwQEZBFen2GdihLLfWeexA', 'Wednesday' , '23:00', 3 'dwQEZBFen2GdihLL fWeexA', 'Wednesday' , '16:00 ', 1 'dwQEZBFen2GdihLLfWeexA', 'Wednesday' , '22:00', 1 'dwQEZBFen2GdihLLfWeexA', 'Wednesday' , '19:00', 1 'dwQEZBFen2GdihLLfWeexA', 'Wednesday' , '21:00', 1 'dwQEZBFen2GdihLLfWeexA' , 'Sunday' , '16:00' , 2 'dwQEZBFen2GdihLLfWeexA', 'Sunday ', '17:00', 2 'dwQEZBFen2GdihLLfWeexA', 'Sunday' , '19:00', 1 'dwQEZBFen2GdihLLfWeexA', 'Sunday' , '22:00' , 4 'dwQEZBFen2GdihLLfWeexA', 'Sunday' , '21:00' ,4 'dwQEZBFen2GdihLLfWeexA', 'Sunday', ' 0:00 ', 3 'dwQEZBFen2GdihLLfWeexA', 'Sunday' , '1:00', 2 'dwQEZBFen2GdihLLfWeexA', 'Saturday' , '21:00', 4 'dwQEZBFen2GdihLLfWeexA', 'Saturday', '20:00', 3 'dwQEZBFen2GdihLLfWeexA' , 'Saturday' , '23:00', 10 'dwQEZBFen2GdihLLfWeexA', 'Saturday', '22:00', 7 'dwQEZBFen2GdihLLfWeexA', 'Saturday' , '18:00', 1 'dwQEZBFen2GdihLLfWeexA', 'Saturday' , '15:00', 2 'dwQEZBFen2GdihLLfWeexA', 'Saturday' , '16:00', 1 'dwQEZBFen2GdihLLfWeexA', 'Saturday' , '17:00', 1 'dwQEZBFen2GdihLLfWeexA' , Saturday' , '0:00' , 8 'dwQEZBFen2GdihLLfWeexA' , 'Saturday', '1:00', 1 'dwQEZBFen2GdihLLfWeexA' , 'Tuesday' , '19:00', 1 'dwQEZBFen2GdihLLfWeexA' , 'Tuesday', '17:00', 1 'dwQEZBFen2GdihLLfWeexA', 'Tuesday', '1:00', 2 'dwQEZBFen2GdihLLfWeexA', 'Tuesday' , '21:00', 1 'dwQEZBFen2GdihLLfWeexA' , 'Tuesday' , '23:00', 3 'dwQEZBFen2GdihLLfWeexA' , 'Monday' , '18:00' , 2 'dwQEZBFen2GdihLLfWeexA' , 'Monday' , '23:00', 1 'dwQEZBFen2GdihLLfWeexA' , 'Monday', '22:00', 2 'QpRfQtlbwlmqUsq4DKjqqw', 'Thursday' , '22:00' , 2 'QpRfQtlbwlmqUsq4DKjqqw', 'Thursday' , '19:00' ,1 'QpRfQtlbwlmqUsq4DKjqqw', 'Thursday' , '15:00', 3 'QpRfQtlbwlmqUsq4DKjqqw' , 'Thursday' , '14:00', 1 'QpRfQtlbwlmqUsq4DKjqqw' , 'Thursday' , '12:00', 1 'QpRfQtlbwlmqUsq4DKjqqw' , 'Friday' , '19:00 ',1 'QpRfQtlbwlmqUsq4DKjqqw' , 'Friday' , '15:00' , 4 'QpRfQtlbwlmqUsq4DKjqqw' , 'Friday' , '14:00 ',1 'QpRfQtlbwlmqUsq4DKjqqw', 'Friday', '22:00', 1Step 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