Timeline for ER Diagram translation to tables
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 23, 2013 at 11:19 | comment | added | Bogdan Sahlean |
a) [...]This is not an option[...] b) [...]I can't do this[...] c) [...]I don't like this option[...]
|
|
Feb 23, 2013 at 11:19 | vote | accept | DBGuest | ||
Feb 23, 2013 at 10:45 | answer | added | ypercubeᵀᴹ | timeline score: 2 | |
Feb 23, 2013 at 10:38 | comment | added | ypercubeᵀᴹ |
I think this is the best way (with a "type" attribute). The link above however does it without. Using nullable desktop_id and laptop_id in the Computer table.
|
|
Feb 23, 2013 at 10:30 | comment | added | DBGuest | The ER Diagram in the question doesn't have a type attribute, so I don't think I am allowed to add it to the tables. But thanks for the advice. :) | |
Feb 23, 2013 at 10:24 | history | tweeted | twitter.com/#!/StackDBAs/status/305261743196762112 | ||
Feb 23, 2013 at 10:21 | comment | added | ypercubeᵀᴹ | The disjoint constraint is easy to implement with (your option 3) and a "type" attribute in all 3 tables (Computer, Laptop, Desktop). The "total" constraint (if I understand well what you mean), the constraint that a Computer must be in exactly one of either Laptop or Desktop is not easy to do with DRI alone. If the DBMS has implement deferrable constraints, you can do it (See option 3 here: How to create multiple one to one's. If not, it can be enforced through transactions or out of the database. | |
Feb 23, 2013 at 8:41 | review | First posts | |||
Feb 23, 2013 at 9:58 | |||||
Feb 23, 2013 at 8:24 | history | asked | DBGuest | CC BY-SA 3.0 |