Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!