Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > General > Chit Chat > normalisation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-29-03, 12:27
deviate1966 deviate1966 is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
normalisation

What would be the best way to normalise the below. I have got it so far but end up getting really stuck. This needs to go to 3NF

0NF
ISBN Number
Book Name
Supplier Contact
Supplier
Supplier Address
Purchase Price Paid
Member No
Member Name
Member Address
Date of Rental Out
Date of Rental Due In
Date of Actual Return
Fine to be Charged?

Any help would be welcome
Reply With Quote
  #2 (permalink)  
Old 11-29-03, 15:24
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
hmmm, looks like a homework assignment

not gonna do it for you, but i will give you a hint that the independent entities are book, supplier, and member

there appears to be an intersection entity bookpurchase, and another, bookrental, which will have relationships to book and supplier, and book and member respectively

you should be able to work out the primary and foreign keys from that


rudy
http://r937.com/
Reply With Quote
  #3 (permalink)  
Old 11-30-03, 13:13
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
Re: normalisation

Quote:
Originally posted by deviate1966
What would be the best way to normalise the below.
ISBN Number
Book Name
---
Supplier Contact
Supplier
Supplier Address
Purchase Price Paid
---
Member No
Member Name
Member Address
---
Date of Rental Out
Date of Rental Due In
Date of Actual Return
Fine to be Charged?


Yes indeed, this looks like homework. But notice where I have placed the dotted lines. Here in a single poorly-designed table we see information about at least four "things": books, suppliers, members, and rentals. Observe also that there may sensibly be "more than one" of these things in several cases, some related to a Book and some not, at least not directly.

When you transform the structure of this database, you won't simply re-arrange these fields; you'll make copies of some of them to form foreign-key relationships.

Set aside the computer-lingo a minute and grab a deck of 3x5 cards (if you can find them anymore). How many stacks of cards would you need and what information would you put on each card? "What can happen" to these data in real life that you might need to represent, and what would you need to do to which cards in each case?

Imagine only that each of these stacks of cards will be put into a magic box that has one magic trick it can do: when you speak a number or word out loud and tap the side of the box three times with your magic wand while mumbling the magic word, "query," all of the cards having that number or word on them will magically float into the air, neatly assemble themselves and place themselves on your outstretched hand in a pile marked "query result."

How would you solve this problem with 3x5 cards and a few of these magic boxes? Forget the computer-lingo and think about the problem itself. You really could solve this problem and manage this data with 3x5 cards, although instead of magic boxes you'd have to use Graduate Students.
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
  #4 (permalink)  
Old 11-30-03, 14:04
deviate1966 deviate1966 is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Smile normalisation

Thanks guys. New to all this and it takes a while for the penny to drop!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On