Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2009
    Posts
    12

    Question how did you learn to design DBs?

    Any tutorial that can CLEARLY explain how to create table relationships?

    I've got a few tables (maybe too many?!?) and I just can't get my head around establishing relationships between them. I'm sure it's there in front of me but just won't see it, the more I look the more I feel I'm in deep sh|t, not a great feeling. Any advice?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Alistair View Post
    how did you learn to design DBs?
    same as learning anything else -- practice, practice, practice

    Quote Originally Posted by Alistair View Post
    Any tutorial that can CLEARLY explain how to create table relationships?
    there are hunnerts of these

    do a web search for foreign key tutorial, read a few of them, then come back and ask more specific questions if you need to

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

  3. #3
    Join Date
    Jul 2009
    Location
    Michigan
    Posts
    125
    A relationship can only be between two tables, so break the job down to considering the relationship between every possible pair of tables. Most won't have any relationship, but at least you have considered it.

  4. #4
    Join Date
    Nov 2003
    Posts
    2,934
    Quote Originally Posted by r937 View Post
    same as learning anything else -- practice, practice, practice
    It's not only practice in "designing" the database, but using the model in your day-to-day work as well.
    Only if you use the model in a real-world application you are going to understand the benefits and the drawbacks of a relational model and potential pitfalls.

  5. #5
    Join Date
    Dec 2009
    Posts
    12
    Quote Originally Posted by r937 View Post
    same as learning anything else -- practice, practice, practice
    Yeah, fair enough, but you make it sound like I didn't even try. On the contrary I watched a lot of video tutorials on the matter and printed out a few large ebooks as well (at work), but still I find it hard to follow the examples as their tables and fields are obviously different from mine and it's just hard to compare their scenery with mine.
    I'm building a booking DB and thought I was on the right track but then I decided to add a loyalty scheme and I just can't seem to find the correct relationships no matter how many trial & errors I go through. I have now 7/8 tables and every trial takes a long time, books and tutorials are not giving me the answers I'm looking for. Well, tonight I'm a bit knackered, hopefully a good sleep will do me good. Thanks anyway.

  6. #6
    Join Date
    Nov 2003
    Posts
    2,934
    Quote Originally Posted by Alistair View Post
    Yeah, fair enough, but you make it sound like I didn't even try.
    I don't think that's what he was trying to say.

    On the contrary I watched a lot of video tutorials on the matter and printed out a few large ebooks as well (at work), but still I find it hard to follow the examples as their tables and fields are obviously different from mine and it's just hard to compare their scenery with mine.
    As I said: unless you are really using the models, you will have a hard time understanding certain decisions and/or patterns.

    I'm building a booking DB and thought I was on the right track but then I decided to add a loyalty scheme and I just can't seem to find the correct relationships no matter how many trial & errors I go through. I have now 7/8 tables and every trial takes a long time, books and tutorials are not giving me the answers I'm looking for.
    In those situations it always helps me to ask myself the following questions:

    - What information do I want to retrieve?
    - How complicated will it be to get the information I want?
    - How do I update and maintain the information (is that very complicated? can I do it with a single statement?)

  7. #7
    Join Date
    May 2009
    Location
    India
    Posts
    66
    The classic introductory book (because you need a reference and not a video) was James Martin's "Principles of Data Base Management" published by Prentice Hall International havin ISBN no ISBN-0-87692-176-4

    It is simple, clear an illustrated.

    End

  8. #8
    Join Date
    Jun 2003
    Posts
    4
    It's like riding a bike. Tough at first but now I barely even have to think about it. I learned by having a job that allowed me to use prototyping for my first project. Design-build-show, tear it down and do it again. Over and Over until you get it right. Also it helps to ask questions. I used co-workers, forums, and even talking to a non-technical person who uses similiar software often knows the concepts of how the databsae works wiothout even knowing databases. The names and relationships of tables are usually reflected in the UIs and workflows. Unless it'd one those rediculous "One Ring to rule them all and in the darkness bind them" databases. See here for a good article:

    Ten Common Database Design Mistakes

  9. #9
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Quote Originally Posted by Alistair View Post
    how did you learn to design DBs?
    I started by getting advanced certification in Lego Blocks when I was a kid, followed by some independent research in Dungeons And Dragons. These prepared me well for a career as a DBA. Also, I highly recommend you acquire some Origami skills as well.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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