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 > Database Concepts & Design > Normalization

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-27-08, 07:19
dbconcept dbconcept is offline
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
Reply With Quote
  #2 (permalink)  
Old 05-27-08, 07:44
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 4,874
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://tonyandrews.blogspot.com
Reply With Quote
  #3 (permalink)  
Old 05-27-08, 07:49
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,539
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #4 (permalink)  
Old 05-27-08, 09: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, 09: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, 09:17
pootle flump pootle flump is offline
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
Reply With Quote
  #7 (permalink)  
Old 05-27-08, 09: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, 09:28
r937 r937 is offline
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
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #9 (permalink)  
Old 05-27-08, 09: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, 09:59
r937 r937 is offline
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?
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #11 (permalink)  
Old 05-27-08, 10:08
andrewst andrewst is offline
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).
__________________
Tony Andrews
http://tonyandrews.blogspot.com
Reply With Quote
  #12 (permalink)  
Old 05-27-08, 11: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, 11:59
r937 r937 is offline
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?
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon
Reply With Quote
  #14 (permalink)  
Old 05-27-08, 12: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, 12:35
georgev georgev is offline
SQL Apprentice
 
Join Date: Jan 2007
Location: hiding
Posts: 8,131
I'm still confused.
__________________
George
You only stop learning when you stop asking questions.
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