| |
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.
|
 |
|

05-27-08, 07:19
|
|
Registered User
|
|
Join Date: May 2008
Posts: 7
|
|
|
Normalization
|
Hi
Can anyone let me know in detail the Following with Specific Example
1- First Normal Form
2- Second Normal Form
3-Third Normal Form
4- Fourth Normal Form
5- Fifth Normal Form
6- BCNF
Thanks
|
|

05-27-08, 07:44
|
|
Moderator.
|
|
Join Date: Sep 2002
Location: UK
Posts: 4,874
|
|
|
|

05-27-08, 07:49
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
|
|
|
|

05-27-08, 09:10
|
|
Registered User
|
|
Join Date: May 2008
Posts: 25
|
|
Quote:
|
Originally Posted by dbconcept
Hi
Can anyone let me know in detail the Following with Specific Example
1- First Normal Form
2- Second Normal Form
3-Third Normal Form
4- Fourth Normal Form
5- Fifth Normal Form
6- BCNF
Thanks
|
Ok take this example with explanation;
Let us take below table which is not normalized
Invoice (Invoive#,Cust#,Name,Address,Quant1,Part1,Amt1,Qua nt2,Part2,Amt2,Quant3Part3,Amt3)
INF: (One to many relationship and remove duplication of groups )
remove duplication of groups: (remove repeating group by making a new entity
Invoice (Invoive#,Cust#,Name,Address)
Items (Item#,Quant,Part,Amt)
One to many relationship: Put PK of one table to other table
Invoice (Invoive#,Cust#,Name,Address)
Items (Item#,Quant,Part,Amt,Invoice#)
Here it is 1 NF
2NF: (many to one relationship,Each column must depend on the entire primary key)
Invoice (Invoive#,Cust#)
Customer (Cust#,Name,Address)
Items (Item#,Quant,Part,Amt,Invoice#)
decompose table invoice into customer and Invoice. Here is many to one relationship. Copy PK from other table to main table.
Here it is 2 NF
3NF: (many to many relationship,Each column must depend on directly on the primary key)
So here only customer table and item table has many to many relationship
Invoice (Invoive#,Cust#)
Customer (Cust#,Name,Address)
Cust_Item (Cust#,Item#)
Items (Item#,Quant,Part,Amt,Invoice#)
this is 3NF
If I am Wrong plz seniors are welcome to correct me.
|
|

05-27-08, 09:11
|
|
Registered User
|
|
Join Date: May 2008
Posts: 25
|
|
Quote:
|
Originally Posted by r937
|
Ok take this example with explanation;
Let us take below table which is not normalized
Invoice (Invoive#,Cust#,Name,Address,Quant1,Part1,Amt1,Qua nt2,Part2,Amt2,Quant3Part3,Amt3)
INF: (One to many relationship and remove duplication of groups )
remove duplication of groups: (remove repeating group by making a new entity
Invoice (Invoive#,Cust#,Name,Address)
Items (Item#,Quant,Part,Amt)
One to many relationship: Put PK of one table to other table
Invoice (Invoive#,Cust#,Name,Address)
Items (Item#,Quant,Part,Amt,Invoice#)
Here it is 1 NF
2NF: (many to one relationship,Each column must depend on the entire primary key)
Invoice (Invoive#,Cust#)
Customer (Cust#,Name,Address)
Items (Item#,Quant,Part,Amt,Invoice#)
decompose table invoice into customer and Invoice. Here is many to one relationship. Copy PK from other table to main table.
Here it is 2 NF
3NF: (many to many relationship,Each column must depend on directly on the primary key)
So here only customer table and item table has many to many relationship
Invoice (Invoive#,Cust#)
Customer (Cust#,Name,Address)
Cust_Item (Cust#,Item#)
Items (Item#,Quant,Part,Amt,Invoice#)
this is 3NF
If I am Wrong plz seniors are welcome to correct me.
|
|

05-27-08, 09:17
|
|
COLOSSAL WIN
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 10,342
|
|
I hope you get some credit from dbconcept's course galaxy.
It is good to see you in this forum and keen to get involved though 
|
|

05-27-08, 09:22
|
|
Registered User
|
|
Join Date: May 2008
Posts: 25
|
|
Quote:
|
Originally Posted by pootle flump
I hope you get some credit from dbconcept's course galaxy.
It is good to see you in this forum and keen to get involved though 
|
thank u Sir;
Can u plzz verify that above detail is correct or has come errors.
|
|

05-27-08, 09:28
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
|
|
Quote:
|
Originally Posted by galaxy_thestars
Can u plzz verify that above detail is correct or has come errors.
|
dear galaxy
would you please stop typing "plzz"
once is fine, it's funny and whimsical, and reminds me of lolcats
repeatedly doing it is very annoying
and yes, you do have errors in your example -- for instance, it is unusual that an item would be related to only one invoice
|
|

05-27-08, 09:39
|
|
Registered User
|
|
Join Date: May 2008
Posts: 25
|
|
Quote:
|
Originally Posted by r937
dear galaxy
would you please stop typing "plzz"
once is fine, it's funny and whimsical, and reminds me of lolcats
repeatedly doing it is very annoying
and yes, you do have errors in your example -- for instance, it is unusual that an item would be related to only one invoice
|
i did not mentioned as One to one relationship
I made it as one to many; i have included invoice#(PK) of invoice table in Item table as foreign key
Can u correct me if I m wrong.
please tell me the correct one here
|
|

05-27-08, 09:59
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
|
|
you are saying that an item can belong to at most one invoice
if so, why does it have a Quant column?
|
|

05-27-08, 10:08
|
|
Moderator.
|
|
Join Date: Sep 2002
Location: UK
Posts: 4,874
|
|
Quote:
|
Originally Posted by r937
you are saying that an item can belong to at most one invoice
if so, why does it have a Quant column?
|
I think by "Item" Galaxy means an "Invoice Line" (or Invoice Item).
|
|

05-27-08, 11:48
|
|
Registered User
|
|
Join Date: May 2008
Posts: 25
|
|
Quote:
|
Originally Posted by andrewst
I think by "Item" Galaxy means an "Invoice Line" (or Invoice Item).
|
If anyone thinks there is problem in normalizing then he should put correct form.
Please try to correct anything wrong. Do not just point out that "some is wrong"
Kindly share the right solution with us.
|
|

05-27-08, 11:59
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
|
|
thanks tony
so what would the mysterious "Part" column be? a foreign key to some Part table?
if so, then what kinds of values are in Item#?
and why is Item in a many-to-many relationship with Customer?
|
|

05-27-08, 12:16
|
|
Registered User
|
|
Join Date: May 2008
Posts: 25
|
|
Quote:
|
Originally Posted by r937
thanks tony
so what would the mysterious "Part" column be? a foreign key to some Part table?
if so, then what kinds of values are in Item#?
and why is Item in a many-to-many relationship with Customer?
|
let me clear
Quant is quantity
Part is parts (may be vehicle)
Amt is say price
now is it correct or any confusion?
|
|

05-27-08, 12:35
|
|
SQL Apprentice
|
|
Join Date: Jan 2007
Location: hiding
Posts: 8,131
|
|
|
__________________
George
You only stop learning when you stop asking questions.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|