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 > Data Access, Manipulation & Batch Languages > ANSI SQL > Normalization

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-07, 19:58
truetaurus truetaurus is offline
Registered User
 
Join Date: Apr 2007
Posts: 5
Question Normalization

I am a bit confused with normalization, hopefully someone here can help me out.
I got the following unnormalized list:

PHP Code:
UNNORMALIZED
R1 
= (ward_noward_namepatient_nofirst_namelast_namedrug_card_no (drug_codedrug_namedate_dispenseddosage)) 
Now i want to normalize it to the 3NF.
This is what i have tried:

PHP Code:
1NF
R11 
= (ward_noward_name (patient_nofirst_namelast_namedrug_card_no))
R12 = (drug_codedrug_namedate_dispenseddosage)

2NF
R111 
= (ward_noward_name)
R112 = (ward_nopatient_nofirst_namelast_namedrug_card_no)
R12 = (drug_codedrug_namedate_dispenseddosage)

3NF
R111 
= (ward_noward_name)
R1121 = (ward_nopatient_nofirst_name)
R1122 = (first_namelast_namedrug_card_no)
R12 = (drug_codedrug_namedate_dispenseddosage
But now am not sure if its right. I think i may be missing somethings. could someone advise?
Thanks
Reply With Quote
  #2 (permalink)  
Old 04-28-07, 06:37
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
1NF means no repeating groups

it looks like R11 repeats patients in a ward, so that fails 1NF

what are you using as your reference for normalization? a textbook or the internet? if a textbook, please give its title and author, if the internet, please give urls of the sites you're using
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 04-28-07, 06:41
truetaurus truetaurus is offline
Registered User
 
Join Date: Apr 2007
Posts: 5
Question ok

Well im just using the lecture slide note we got in class.
now for that 1NF i know what you mean so i was thinking like this:
PHP Code:
1NF 
R11 
= (ward_noward_name patient_nofirst_namelast_namedrug_card_no)
R12 = (drug_codedrug_namedate_dispenseddosage
without that new group? anything else
Reply With Quote
  #4 (permalink)  
Old 04-28-07, 07:02
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 04-28-07, 08:49
truetaurus truetaurus is offline
Registered User
 
Join Date: Apr 2007
Posts: 5
hmm

i understand the rules but then once i try doin on i jus get confused i u can see in the above.
Reply With Quote
  #6 (permalink)  
Old 04-30-07, 06:00
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
Can you give us a sample of your data. Then we can show you the transition to 1NF, 2NF, 3NF. The problem is that you have a represented your initial data in a column related format so we can't actually see where data repeats itself.

The two rules to follow for 1NF are :
1. A row of data cannot contain repeating groups of similar data (atomicity); and
2. Each row of data must have a unique identifier (or Primary Key).

You initial line actually looks like 1NF already to me, however it doesn't identify primary keys.
Reply With Quote
  #7 (permalink)  
Old 04-30-07, 13:44
truetaurus truetaurus is offline
Registered User
 
Join Date: Apr 2007
Posts: 5
Question ok

ummm well this is what i was given:

R1 = (ward_no, ward_name, patient_no, first_name, last_name, drug_card_no (drug_code, drug_name, date_dispensed, dosage))

thats all i can give u sorry.
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