I was wondering if the following in terms of tables and keys is possible:
Login(username, date_time_login)
Customer(username, surname, ...)
Driver(username, surname, ...)
Admin(username, surname, ...)
Booking(b_no, cust_id, driver_id, ...)
Primary keys are underlined and foreign keys are in italics.
I want the Customer, Driver and Admin username primary key fields to refernce the Login username primary key field. Also, i want the Booking cust_id to reference the Customer username primary key field and Booking driver_id to reference the Driver username primary key field. Is this possible?
Or is there a better way to organise the tables in terms of logins and bookings to avoid complications?
Thanks