In a database that have Orders, Customers tables, i need the relation between these two tables to be zero or one to many relationship, simply because in my application, an order can exist without being assigned to a customer.
One first idea that comes to my mind is to make the foreign key nullable, this way when creating an order the foreign key can be null, but i don't know how to do so. I'm working on a model so i can render it to my 'teacher', so i need to know how to do it using the EER diagram.
thanks in advance.
Mandatory option in "Foreign Key" tab in "Relationship" tab appears to be the way to control optionality.
Create your 1:n relationship as normal. Then double click the table to bring up the details. On your new FK field, uncheck the "NN" column. Now your FK can be NULL.
Simply do it this way
There you go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With