Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write an SQL database project of a courier mover company whose discription is as under. Customer customer _ id ( Primary Key ) First _

write an SQL database project of a courier mover company whose discription is as under.
Customer
customer_id (Primary Key)
First_name
Last_name
Contact
Address
Email
Driver
Driver_id (Primary Key)
First_name
Last_name
Contact
Address
Rating
Vehicle_type
Active_Job
Job_id (Primary Key)
Customer_id (Foreign Key from Customer)
Pick_up
Drop_off
Vehicle_preference
Bidding
Bid_id (Primary Key)
Job_id (Foreign Key from Active_Job)
Driver_id (Foreign Key from Driver)
Fare
Status
Assigned_Job
Job_id (Foreign Key from Active_Job)
Driver_id (Foreign Key from Driver)
Past_trip
Job_id (Foreign Key from Active_Job)
Status
Time_appointed
Time_completed
Relationships:
Customer to Active_Job: One-to-Many (One customer can post multiple jobs)
Active_Job to Bidding: One-to-Many (One job can have multiple bids)
Driver to Bidding: One-to-Many (One driver can bid on multiple jobs)
Bidding to Assigned_Job: One-to-One (Each accepted bid results in one assigned job)
Active_Job to Assigned_Job: One-to-One (Each job can only be assigned once)
Active_Job to Past_trip: One-to-One (Each job can only have one past trip record)
Additional Rules:
In the Bidding table, only drivers whose Vehicle_type matches the Vehicle_preference of the Active_Job can bid.
In the Assigned_Job table, a job is assigned to a driver only if their bid is accepted (Status in Bidding table = 'Accepted').
The Past_trip table records the history of the trip, including whether it was completed or cancelled.

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions