Answered step by step
Verified Expert Solution
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
customerid Primary Key
Firstname
Lastname
Contact
Address
Email
Driver
Driverid Primary Key
Firstname
Lastname
Contact
Address
Rating
Vehicletype
ActiveJob
Jobid Primary Key
Customerid Foreign Key from Customer
Pickup
Dropoff
Vehiclepreference
Bidding
Bidid Primary Key
Jobid Foreign Key from ActiveJob
Driverid Foreign Key from Driver
Fare
Status
AssignedJob
Jobid Foreign Key from ActiveJob
Driverid Foreign Key from Driver
Pasttrip
Jobid Foreign Key from ActiveJob
Status
Timeappointed
Timecompleted
Relationships:
Customer to ActiveJob: OnetoMany One customer can post multiple jobs
ActiveJob to Bidding: OnetoMany One job can have multiple bids
Driver to Bidding: OnetoMany One driver can bid on multiple jobs
Bidding to AssignedJob: OnetoOne Each accepted bid results in one assigned job
ActiveJob to AssignedJob: OnetoOne Each job can only be assigned once
ActiveJob to Pasttrip: OnetoOne Each job can only have one past trip record
Additional Rules:
In the Bidding table, only drivers whose Vehicletype matches the Vehiclepreference of the ActiveJob can bid.
In the AssignedJob table, a job is assigned to a driver only if their bid is accepted Status in Bidding table 'Accepted'
The Pasttrip 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
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