If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > ER diagram from tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-15-06, 12:47
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
Lightbulb ER diagram from tables

i have got tables perfectly designed for my project. but i have to design the er diagram for sending the first review (sw req spec), i.e., for formality. how do i do it. is there an easy way to do it?

i feel it must be simple but it turns out to be very difficult. does this mean that the db design faulty or that the er diagrams cannot be drawn to exactly represent all the tables?

there r many probs out of which one is non-availability of table for representing relation. they r related just like that. new tables r required inbetween relations. many such problems r there. maybe there is a diff method to follow which is what i want to know.

for eg., A->BC, D->E and ADF->G. Here, F is not a primary key in any table. How do we represent it? The eg is just a sample and this prob is just an eg. I've got many probs like this. also, is there any formal approach or any sw for generating the er diagram from tables?
Reply With Quote
  #2 (permalink)  
Old 10-15-06, 14:54
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
please show your ER diagram
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-16-06, 10:07
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Quote:
Originally Posted by r937
please show your ER diagram
I think that's what he wants to know how to do....
You can use a built-in tool for your database platform (Enterprise Manager will allow you to create ER diagrams for SQL Server), or you can buy a third party tool such as Visio (mild learning curve, so not something you want to do with a deadline loominig), or you can link an Access database to your backend server and create a diagram within Access, or heck you can just use Powerpoint to illustrate tables and relations.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #4 (permalink)  
Old 10-16-06, 11:00
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
Unhappy sure it's a simple affair?

i have not started implementation at all. im yet to start implementing in DB2. i have actually produced a theoretical design and want to convert it into a practical one which i can use to represent as an er diag! the design is very much enough for implementation but as i have alredy said, i want to design the er diag. for the sole purpose of sending the sw req spec before october 30th.


here is an eg of a problem occuring in the er diag.

5)Class Password table
ClassNo DeptNo Class Section ClassTeacherPassword
___PK_ _FK(2)____CK_______
7)Roll. No. table
RegIndex RegNo Class Section RollNo
___PK__ _FK(1)_CK__

Note:-DeptNo and RegNo are the FK's and the underlined attributes are the PK's and the CK's.

i think both of them r supposed to be relations ignoring the PK's as they r just surrogate keys for optimization purposes (which my thread on Surrogate keys was about). So the CK's r the actual PK's.
When these tables r relations, the problem comes when, Class is not an FK, or atleast I dont know how to represent such cases in the er diag.

i also think, there cannot be relations bet 2 relations. also relation sharing an attrib with an attrib of a table (if it had been a PK in that table, then, the table could be directly related) is not possible as far as i know.

i hope i am not confusing u. anyway, this is the exact problem.

Last edited by trss; 10-16-06 at 11:12.
Reply With Quote
  #5 (permalink)  
Old 10-16-06, 12:30
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Quote:
Originally Posted by trss
i hope i am not confusing u. anyway, this is the exact problem.
Sorry. Not a clue what you are talking about. Post your DDL with a specific question, and maybe we can help you.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #6 (permalink)  
Old 10-16-06, 12:57
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
im sure this easily explains my problem.

5)Class Password table
ClassNo DeptNo Class Section ClassTeacherPassword
___PK_ _FK(2)____CK_______

7)Roll. No. table
RegIndex RegNo Class Section RollNo
___PK__ _FK(1)_CK__

the Class does not require a table as it does not have any other descriptive attributes. Hence it is not a foreign key.
the DeptNo is PK in the Dept table (table no. 2) and the RegNo is PK in the Student table (table no. 1) to be more specific.

ive just given the 5th and 7th tables of my design where FK(i) means it is a PK in the ith table.

im forced to give the underscores because, if i give spaces, only a single space gets displayed! i dont know what to do abt that.

anyway, how does this get represented in the er diag????????
should i give all the 12 tables (the entire design) for u to understand the problem properly and clearly and help me draw the er diag?

Last edited by trss; 10-16-06 at 13:06.
Reply With Quote
  #7 (permalink)  
Old 10-16-06, 13:07
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
here's an example of a portion of the ER diagram

really, it's easy
Attached Thumbnails
ER diagram from tables-er.gif  
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #8 (permalink)  
Old 10-17-06, 09:59
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
ohhhhhhh! thanks a lot for taking the effort, r937.

but i thought er diagrams r not supposed to be mere representations of tables but must show the relation bet them using diamonds (or rhombuses) which r once again tables! i didnt know u could connect 2 tables in an er diag directly without a diamond inbetween! i had already asked if connecting 2 relations (diamonds) is possible. my dbms teacher at coll said she doesnt think its poss.

i really dont know and would like to know as it makes things extremely simple as ill just have to draw all the tables and connect all the FKs and stuff, right? no need for any relations at all except for the direct links between attributes which i thought was absolutely prohibited.

i may be totally wrong and would welcome any suggestions or info which would help me get corrected.
Reply With Quote
  #9 (permalink)  
Old 10-17-06, 10:01
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
i think you had better just follow the guidelines that your teacher gives you

if you are being marked on the ER diagram having triangles, then your ER diagram had better have some triangles!!
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #10 (permalink)  
Old 10-17-06, 10:16
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
oye, it is not an assignment man. it is for a contest where uve got to select projects and submit them within the deadline.
Quote:
Originally Posted by r937
i think you had better just follow the guidelines that your teacher gives you
its not that only my teacher told me so, but even the books ive read so far have those 45 degree tilted squares standing on their corners(not triangles). also, the attribs are not given as uve shown but within ovals connected to the rect which contains the table name like a fan. and those ovals r not supposed to be connected directly as far as i know.

hope im not irritating u, r937. maybe ive just learnt one way of representing it or maybe they've given like that in the books to explain relations but even otherwise (connecting attribs, etc...) it is possible to draw.

please try to understand how little i know. then i suggest u start explaining to me.

Last edited by trss; 10-17-06 at 10:24.
Reply With Quote
  #11 (permalink)  
Old 10-17-06, 10:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by trss
then i suggest u start explaining to me.
drawing ER diagrams in order to understand your own table relationships so that you come up with an optimum design is a totally different thing than drawing an ER diagram to enter some contest

follow the contest rules

no database was ever unsuccessful because its ER diagram was missing the little rhombus symbols

ER diagrams are an analysis tool, that's all, and as such, you can draw them any way you want

unless, of course, you are submitting homework or entering some contest

good luck
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #12 (permalink)  
Old 10-17-06, 10:42
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
thanks a lot. if that design (the one which i was sticking to) is not possible to represent my db design, then maybe ive got to resort to ur idea (thanks a lot for that), r937.

Quote:
Originally Posted by r937
follow the contest rules
the contest doesnt have any rules for drawing er diags and all. theyve just asked for the first review (sw req spec) including use case diags and db design.

i still think the one ive read is a better way of representing er diag and will fetch me more points and would like to know more abt it if poss. but i think, as of know, as there dosent appear to be a choice, ill do it in that simple way of just connecting the attribs as u have shown, r937. anyway, thanks a lot.

Last edited by trss; 10-17-06 at 10:45.
Reply With Quote
  #13 (permalink)  
Old 10-17-06, 10:59
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
I have to ask...what the heck contest is this? Will it be shown on ESPN? Do you partner with a celebrity ("Coding With The Stars")? Do you and the other coders have to share a house with a lot of video cameras?
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #14 (permalink)  
Old 10-18-06, 12:51
trss trss is offline
Registered User
 
Join Date: Sep 2006
Posts: 20
No, im really sorry but i dont understand why u people get so irritated. the thing is just that i probably got along the wrong path a bit while learning er diags.
i didnt know it was an informal thing used for our own convenience and hence can be drawn anyway.
also, i thought there was a formal standard method of drawing er diagrams (the one im talking abt.) which i have come to know is wrong.
maybe i have given too much importance for nothing at all.
thanks all for your kind help.

Last edited by trss; 10-18-06 at 14:03.
Reply With Quote
  #15 (permalink)  
Old 10-18-06, 15:13
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
please, don't worry, we are not irritated

there are formal methods for drawing ER diagrams

i think one of them is called IDEF1X

i personally do not adhere to a formal method

i think you will find formal methods in use only in very large organizations

perhaps the contest holders are asking for an ER diagram as part of a submission in order to decide to whom to award a development project?

if this is the case, i would wager that they are more interested in your actual design rather than how closely you adhered to some methodology or another

i could be wrong (wouldn't be the first time)

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On