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 > can someone check this!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-22-07, 12:25
player123 player123 is offline
Registered User
 
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!
Reply With Quote
  #2 (permalink)  
Old 03-22-07, 12:40
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-23-07, 09:25
player123 player123 is offline
Registered User
 
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! )
Reply With Quote
  #4 (permalink)  
Old 03-23-07, 09:44
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
"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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 03-30-07, 08:16
player123 player123 is offline
Registered User
 
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?
Reply With Quote
  #6 (permalink)  
Old 03-30-07, 08:20
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
the table with the PK (AccountType) must exist before any FK can reference it from another table (Account)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 03-30-07, 09:04
player123 player123 is offline
Registered User
 
Join Date: Mar 2007
Posts: 12
k i fixed anyway thanks man! )
Reply With Quote
  #8 (permalink)  
Old 03-30-07, 09:08
player123 player123 is offline
Registered User
 
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
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