I am making a booking app. There is one table that holds the bookings.
A second table holds details for the (business)users for WHOM the bookings are made. Details such as name etc.
I want to make also a 3rd table that will hold staff names, staff of the business users.
So, the bookings table must ALSO hold the staff name the end user chose (such as the case of a hair salon).
The problem is how to connect all these tables, the relationship between them.
This is the scheme I have concluded.
The staff table should have 3 cols:
And to be precise here the SQL for the table;
CREATE TABLE `staff` (
`name` varchar(45) NOT NULL,
`staff_b_user` int(11) NOT NULL,
`staff_ID` int(11) NOT NULL,
PRIMARY KEY (`staff_ID`),
KEY `fk_staff_business_users1_idx` (`staff_b_user`),
CONSTRAINT `fk_staff_business_users1` FOREIGN KEY (`staff_b_user`) REFERENCES `business_users` (`crID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8
What do you think?