Entities

Ola Cab

Step 1: Entities

DRIVER(DriverID, [pk] DriverName, DarteofBirth, DriverLicense, ProofofIdentity, PassedPolice, Account, AccountName, BSBNumber, AccountNumber)

DRIVER_BEHAVIOUR(BehaviourID,[pk] BreachActivity, BreachDate, BreachLevel, DriverFeedBack)

DRIVER_SCHEDULE(DriverID, Date,[pk] StartTime, EndTime)

DRIVER_PAYMENT(PaymentID, [pk] RideHistory, RideStatus, RideCharge, StarRating, OlaFees)

CAR(CarNumber,[pk] Manufacturer, Model, Year, DateofPurchase, Insurance, Mileage)

CAR_MAINTENANCE(MaintenanceNumber, [pk] MaintenanceDate, MaintenanceType, CentreName, CarCondition)

MAINTENANCE_TEST(ResultNumber, [pk] DetectedProblems, RequiredParts, ResultStatus)

CAR_LOCATION(LocationNumber, [pk] Date, Time)

RIDE(BookingID, [pk] Destination, Pickup, Ridestart, RideEnd, DriverCall, DriverArrival)

RIDE_BOOKING(BookingID, [pk] FindBooking, BaseFare, TravelFee, WaitingFee, AppliedDiscount)

CAR_TYPE(TypeName, [pk] Passenger, Fareprice)

RIDE_INVOICE(InvoiceNumber, [pk] PaymentType, PaymentDate)

RIDER(RiderNumber, [pk] RiderName, RiderEmail, RiderPassword, MobileNumber)

COUPON(CouponCode, [pk] Discount, Condition)

CREDITCARD(CreditID, [pk] CreditDetails, CardLimit, ValidityDate, FullName)

Step 2: Many-to- many relationships

REGISTERS(DriverID[fk1], CarNumber[fk2], [pk])

INVITES(RiderNumber[fk1], Inviting-RiderNumber[fk2] [pk])

ACCESS(CouponCode[fk1], RiderNumber[fk2], [pk])

Step 2.5: one-to-one relationships

RIDE(BookingID,[pk] Destination, Pickup, Ridestart, RideEnd, DriverCall, DriverArrival, CarNumber[fk])

SENDS(BookingID[fk1], InvoiceNumber[fk2], [pk])

RIDE(BookingID, [pk] Destination, Pickup, Ridestart, RideEnd, DriverCall, DriverArrival, BookingID[fk])

Step 3: One-to-many relationships

DRIVER_BEHAVIOUR(BehaviourID, [pk] BreachActivity, BreachDate, BreachLevel, DriverFeedBack, DriverID [fk])

DRIVER_SCHEDULE(DriverID[fk], Date, [pk] StartTime, EndTime, DriverID[fk])

DRIVER_PAYMENT(PaymentID,[pk] RideHistory, RideStatus, RideCharge, StarRating, OlaFees, DriverID[fk])

RIDE(BookingID,[pk] Destination, Pickup, Ridestart, RideEnd, DriverCall, DriverArrival, DriverID[fk])

CAR_MAINTENANCE(MaintenanceNumber,[pk] MaintenanceDate, MaintenanceType, CentreName, CarCondition, CarNumber[fk])

MAINTENANCE_TEST(ResultNumber, [pk] DetectedProblems, RequiredParts, ResultStatus, MaintenanceNumber[fk])

CAR_LOCATION(LocationNumber,[pk] Date, Time, CarNumber [fk])

CAR(CarNumber, [pk] Manufacturer, Model, Year, DateofPurchase, Insurance, Mileage, TypeName[fk])

RIDE_INVOICE (InvoiceNumber, [pk] PaymentType, PaymentDate, RiderNumber[fk])

RIDER(RideNumber, [pk] RiderName, RiderEmail, RiderPassword, MobileNumber, Couponcode[fk])

CREDIT_CARD(CreditID,[pk] CreditDetails, CardLimit, ValidityDate, FullName, RiderNumber[fk])

RIDE_BOOKING(BookingID, [pk] FindBooking, Basefare, TravelFee, WaitingFee, AppliedDiscount, CouponCode [fk] )

RIDE_BOOKING(BookingID, [pk] FindBooking, Basefare, TravelFee, WaitingFee, AppliedDiscount, RiderNumber [fk] )

RIDE_BOOKING(BookingID, [pk] FindBooking, Basefare, TravelFee, WaitingFee, AppliedDiscount, TypeName [fk] )

Step 4: Final Relational Schema

DRIVER(DriverID, [pk] DriverName, DarteofBirth, DriverLicense, ProofofIdentity, PassedPolice, Account, AccountName, BSBNumber, AccountNumber)

DRIVER_BEHAVIOUR(BehaviourID, [pk] BreachActivity, BreachDate, BreachLevel, DriverFeedBack, DriverID [fk])

DRIVER_SCHEDULE(DriverID[fk], Date, [pk] StartTime, EndTime, DriverID[fk])

DRIVER_PAYMENT(PaymentID,[pk] RideHistory, RideStatus, RideCharge, StarRating, OlaFees, DriverID[fk])

RIDE(BookingID,[pk] Destination, Pickup, Ridestart, RideEnd, DriverCall, DriverArrival, DriverID[fk])

CAR_MAINTENANCE(MaintenanceNumber,[pk] MaintenanceDate, MaintenanceType, CentreName, CarCondition, CarNumber[fk])

MAINTENANCE_TEST(ResultNumber, [pk] DetectedProblems, RequiredParts, ResultStatus, MaintenanceNumber[fk])

CAR_LOCATION(LocationNumber,[pk] Date, Time, CarNumber [fk])

CAR(CarNumber, [pk] Manufacturer, Model, Year, DateofPurchase, Insurance, Mileage, TypeName[fk])

CAR_TYPE(TypeName, [pk] Passenger, Fareprice)

RIDE_INVOICE (InvoiceNumber, [pk] PaymentType, PaymentDate, RiderNumber[fk])

RIDER(RiderNumber, [pk] RiderName, RiderEmail, RiderPassword, MobileNumber, Couponcode[fk])

CREDIT_CARD(CreditID,[pk] CreditDetails, CardLimit, ValidityDate, FullName, RiderNumber[fk])

COUPON(CouponCode, [pk] Discount, Condition)

RIDE_BOOKING(BookingID, [pk] FindBooking, Basefare, TravelFee, WaitingFee, AppliedDiscount, CouponCode [fk] )

RIDE_BOOKING(BookingID, [pk] FindBooking, Basefare, TravelFee, WaitingFee, AppliedDiscount, RiderNumber [fk] )

RIDE_BOOKING(BookingID, [pk] FindBooking, Basefare, TravelFee, WaitingFee, AppliedDiscount, TypeName [fk] )

REGISTERS(DriverID[fk1], CarNumber[fk2], [pk])

INVITES(RiderNumber[fk1], Inviting-RiderNumber[fk2] [pk])

ACCESS(CouponCode[fk1], RiderNumber[fk2], [pk])

RIDE(BookingID,[pk] Destination, Pickup, Ridestart, RideEnd, DriverCall, DriverArrival, CarNumber[fk])

SENDS(BookingID[fk1], InvoiceNumber[fk2], [pk])

RIDE(BookingID, [pk] Destination, Pickup, Ridestart, RideEnd, DriverCall, DriverArrival, BookingID[fk])