Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2007
    Posts
    12

    can someone check this!

    hi! i have just designed a new database and i was wondering of any could just quickly check that is passes all the first 3 normal forms.
    this is an image of it:

    http://img233.imageshack.us/img233/4174/untitledqg6.jpg

    thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    the account type and its relationships are wrong

    either that, or the relationship lines drawn to it are backwards

    ask yourself: does an account have multiple account types?

    or is it the other way around?

    so which table has the foreign key?

    and if the account has a CustomerID FK, shouldn't there be a relationship between the account and the customer?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2007
    Posts
    12
    ok... thanks...

    the account has to be accessed through the account type first. e.g. if i want to check my savings account, i would put savings first and then check the details for it. why do u think the relationships are wrong?

    anyway thanks alot! )

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    "has to be accessed thru" does not work in relational database design

    a query can access any table it wants to

    i can show the relationships are wrong if you show a few rows of sample data from each table such that the data are consistent, i.e. foreign keys must be valid values

    if you could please show the data, i'll show you what's wrong
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Mar 2007
    Posts
    12
    omg i cant even create the tables. it gives me an error:



    Foreign key (CustomerID) references AccountType(CustomerID)
    *
    "no matching unique or primary key for this column list"



    when i try to create the account table in sqlplus. any suggestions? what do i need to do?

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    the table with the PK (AccountType) must exist before any FK can reference it from another table (Account)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Mar 2007
    Posts
    12
    k i fixed anyway thanks man! )

  8. #8
    Join Date
    Mar 2007
    Posts
    12
    ok i've done some chnages to it now..
    do u think it will work now:

    http://img129.imageshack.us/img129/820/untitledsc0.jpg

Posting Permissions

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