Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Customer (CId, CName, CAddress, CPhone) Driver (DId, DName, DAddress, DPhone) Trip (CId DId.LicNo CallTime, StartLoc, EndLoc, StartTime, EndTime, Fare, Tip, TripRating) Taxi (LicNo, ModelName, ModelYear)

image text in transcribed
Customer (CId, CName, CAddress, CPhone) Driver (DId, DName, DAddress, DPhone) Trip (CId DId.LicNo CallTime, StartLoc, EndLoc, StartTime, EndTime, Fare, Tip, TripRating) Taxi (LicNo, ModelName, ModelYear) TaxiDriver (LicNo DId) In this scenario CId is the ID of a customer, DId is the ID of a driver, and LicNo is the license number of the taxi, CallTime is the time when the customer called for a taxi, and StartTime is the actual time when the trip started. Startloc and EndLoc are the start and end addresses of the trip. TripRating is a rating between 1 and 5 given by the customer for the particular trip. A driver can drive several different taxis and a taxi can have several drivers, and table TaxiDriver stores which driver is allowed to drive which taxi. A taxi can only be called via phone for immediate pickup, and cannot be booked in advance for future use. The primary key attributes for each relation have been underlined. I. Create an ER Diagram for the above Business Rules. Label all entities and relationships. Show cardinality and optionality. II. In the Trip table, (Cid, DId, LicNo, CallTime) is the primary key. Could (CId DId, LicNo, StartLoc) be a primary key? Could (DId, StartTime) be a primary key? Explain. III. Identify appropriate foreign key relationships between the tables. IV, Write statements in SQL for the following queries. a List the license numbers and model names of all taxis that are model b. List the driver and customer names for all trips with a fare greater c. List the destinations, fares, and tips of all trips that started from d. List the names of all drivers who have driven more than one taxi in year 2005. than $100. location 199 Chambers St. Manhattan. 2014. e. Provide the name of the driver(s) who received the highest (single- f. g. Output the DId and name of any driver who has never received a trip) tip ever. For each driver, output the Did, name, and average trip rating. rating of 5

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Are there any questions that you want to ask?

Answered: 1 week ago