views:

24

answers:

4

Yeah silly question. Its been a long time since I have designed a DB as a Database Diagram but the higher ups want to see it. I have totally become confused because I am a coder, not a DBA.

I have a main table which contains user id, name, username, password, etc. This main table has the primary key of ID. Should sub tables (such as address, phone, etc) have a key point toward the id of the primary user table or should it be the other way around?

Thanks in advance for the answer as this GUI crap is messing with my style.

+1  A: 

yes the yellow key will be at the primary key table...so if you have 3 foreign key tables then 3 yellow pk icons will be at the primary key table the fk tables will have icons that look like a number 8

example

alt text

SQLMenace
accepted for correct + first answer...in 10-15 minutes apparently. thx all!
ThaKidd
A: 

RE:

Its been a long time since I have designed a DB as a Database Diagram ... this GUI crap is messing with my style

You can generate a database diagram from an existing database so just design it however you normally would and add the appropriate FK constraints then generate the diagram afterwards.

Martin Smith
+1  A: 

The tip of the key points to the parent table (the one with the "ONE" in a one-to-many relationship) and the round end with the line goes to the child (many) table.

David Stratton
A: 

SQL Server's Database Diagram tool is not very good. One of its many disadvantages is that it doesn't use any of the standard notations for database diagrams. The daft picture syntax it uses is unique to Microsoft. As well as being non-standard it's also particularly useless as a pictorial language because it hides so much useful information - for instance it doesn't identify foreign key columns or optionality or alternate keys. I would strongly recommend you invest in a better tool if you are serious about data modelling.

dportas
Can you suggest a few that you have liked?
ThaKidd
CA ERWin, Sybase PowerDesigner or good old Microsoft Visio
dportas