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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-27-08, 06:19
dbconcept dbconcept is offline
Registered User
 
Join Date: May 2008
Posts: 9
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
Reply With Quote
  #2 (permalink)  
Old 05-27-08, 06:44
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Why would we go to the trouble of writing detailed descriptions and examples for all these in a reply when they are readily available in books and on the web? For example:

http://www.utexas.edu/its/archive/wi...ng/rm/rm7.html
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 05-27-08, 06:49
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
  #4 (permalink)  
Old 05-27-08, 08:10
galaxy_thestars galaxy_thestars is offline
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.
Reply With Quote
  #5 (permalink)  
Old 05-27-08, 08:11
galaxy_thestars galaxy_thestars is offline
Registered User
 
Join Date: May 2008
Posts: 25
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.
Reply With Quote
  #6 (permalink)  
Old 05-27-08, 08:17
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
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
Reply With Quote
  #7 (permalink)  
Old 05-27-08, 08:22
galaxy_thestars galaxy_thestars is offline
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.
Reply With Quote
  #8 (permalink)  
Old 05-27-08, 08:28
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #9 (permalink)  
Old 05-27-08, 08:39
galaxy_thestars galaxy_thestars is offline
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
Reply With Quote
  #10 (permalink)  
Old 05-27-08, 08:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
you are saying that an item can belong to at most one invoice

if so, why does it have a Quant column?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #11 (permalink)  
Old 05-27-08, 09:08
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
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).
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #12 (permalink)  
Old 05-27-08, 10:48
galaxy_thestars galaxy_thestars is offline
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.
Reply With Quote
  #13 (permalink)  
Old 05-27-08, 10:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #14 (permalink)  
Old 05-27-08, 11:16
galaxy_thestars galaxy_thestars is offline
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?
Reply With Quote
  #15 (permalink)  
Old 05-27-08, 11:35
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
I'm still confused.
__________________
George
Twitter | Blog
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