Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    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?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    please show your ER diagram
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    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"
    www.LobsterShot.blogspot.com

  4. #4
    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 12:12.

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    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"
    www.LobsterShot.blogspot.com

  6. #6
    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 14:06.

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    here's an example of a portion of the ER diagram

    really, it's easy
    Attached Thumbnails Attached Thumbnails ER.gif  
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    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.

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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!!
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  10. #10
    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 11:24.

  11. #11
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  12. #12
    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 11:45.

  13. #13
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    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"
    www.LobsterShot.blogspot.com

  14. #14
    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 15:03.

  15. #15
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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)

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •