New answers tagged mysql-workbench
1
It looks like you've used the option to create an Identifying relationship (this is the one with the unbroken line in the toolbox).
An Identifying relationship assumes that the primary key in the referenced table should be part of primary key of the referencing table.
Because Company_id is now part of Department's Primary Key, it must also be part of the ...
0
You could simplify your design and make it more powerful by keeping all of the opening times in a single table which includes a date range and a priority code for resolving conflicting records.
It would look something like this:
create table OPENING
( id INT
, entry_id INT
, from_date DATE
, to_date DATE
, priority INT
, weekday_id INT
, start TIME
, end ...
1
I think it would be best that you learned about relationship types without using an IDE.
If every employee is a user, then it should be a straight 1:1 relationship.
If every employee is not a user, then you should not be using userid as the primary key. Rather, create a surrogate primary key for the employee and make userid a nullable foreign key.
Top 50 recent answers are included
