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 > Bcnf 2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-04, 11:52
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
Bcnf 2

here is another example that i have tried to normalise to BCNF- does n e 1 know if this is correct.
Attached Files
File Type: doc table3.doc (60.0 KB, 105 views)
Reply With Quote
  #2 (permalink)  
Old 03-11-04, 05:37
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Bcnf 2

What do the colours mean in this diagram? Something looks "fishy" to me, but as I'm not sure what the primary keys are I may be incorrect. If red indicates a primary key, then you have 2 relations with the same primary key and Client No appears as a non-key attribute 2 relations with different keys!

BTW, it would help if you named each relation so that we could refer to them by name. R1, R2, R3 would do.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 03-11-04, 05:43
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
red means primary key, blue means foriegn key and pink means both primary and foriegn key. i have changed it a litle is this better?
Attached Files
File Type: doc table3.doc (60.0 KB, 102 views)
Reply With Quote
  #4 (permalink)  
Old 03-11-04, 05:50
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Looks the same as before to me.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #5 (permalink)  
Old 03-11-04, 06:05
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
sorry i forgot to save -it here it is
Attached Files
File Type: doc table3.doc (58.5 KB, 95 views)
Reply With Quote
  #6 (permalink)  
Old 03-11-04, 07:34
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
I'm not clear about the relationship between Client and Office: can many Clients have same Office? (Yes, according to your tables).

Can the same Contract No be used by many Clients? (again, yes according to your tables).

Trouble is, I don't know what the real FDs are anyway!
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #7 (permalink)  
Old 03-11-04, 07:37
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
clients contracts are based at a office. so many clients can be based at the same office. and only one client can have 1 contact number but many job id's . where do i go from here then?
Reply With Quote
  #8 (permalink)  
Old 03-11-04, 07:51
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
IGNORE THE ABOVE

clients contracts are based at a office. so many clients can be based at the same office. and only one client can have many contract numbers and many job id's . where do you think i should go from here then?
Reply With Quote
  #9 (permalink)  
Old 03-11-04, 08:01
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Your relationships between Client and Office may be correct then, but your model allows 2 clients to have the same Contract No.

My suspicion would be that if you know the Contract No, you know the Client too. i.e. Contract->Client. Your model doesn't say that.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #10 (permalink)  
Old 03-11-04, 08:04
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
does that mean i need another table with just contractno and clientno in it?
Reply With Quote
  #11 (permalink)  
Old 03-11-04, 08:06
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Why not just add ClientNo to R1 as a foreign key?
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #12 (permalink)  
Old 03-11-04, 08:08
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
is this correct then for 3NF and BCNF?
Attached Files
File Type: doc table3.doc (59.5 KB, 93 views)
Reply With Quote
  #13 (permalink)  
Old 03-11-04, 08:25
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
I don't know. What does R3 mean now? Each Office can have only 1 contract?

The trouble is (I think) you are reacting to each feedback comment from me in a piecemeal way, reposting your modified solution here within seconds almost. You need to slow down and review your full set of relations against the original relations and FDs, and verify them.

A primary key means: every other attribute in this relation is functionally dependent on this key. So it is easy to compare FDs and relations to see if they agree:

Relation (key, otheratt1, otheratt2) means:

key -> otheratt1, otherat2
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #14 (permalink)  
Old 03-11-04, 08:43
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
r3 is needed to show which clients are based at which office. i have now changed that to this. i have also changed relation 2. i got a little confused there as i though this was the offices details but it's not it should be the clients details. it looks alot better now and i think it's in 3NF and BCNF. please can you check this for me. p.s i am very greatful for your help- i do feel i am learning
Attached Files
File Type: doc table3.doc (68.0 KB, 97 views)
Reply With Quote
  #15 (permalink)  
Old 03-11-04, 09:08
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
R3 isn't quite right: it shows OfficeNo as the PK, but has 2 rows with same value! Did you mean both columns to be in the PK?
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
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