473,902 Members | 4,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Normalisation

38 New Member
Hi freinds,

pls contribute any idia on;

what is the difference between two normal forms (1NF,2NF)
Dec 26 '06 #1
27 6494
r035198x
13,262 MVP
Hi freinds,

pls contribute any idia on;

what is the difference between two normal forms (1NF,2NF)
There are many equivalent definitions for normal forms. Here is a version:

1NF
Each table must have a primary key, i.e., a minimal set of attributes that can uniquely identify a record.There must be atomicity i.e each attribute must contain a single value, not a set of values.There should be no repeating groups (categories of data that would seem to be required a different number of times on different records) by defining keyed and non-keyed attributes appropriately.

2NF
The database must meet all the requirements of the 1NF. In addition, if a table has a composite key, all attributes must be related to the whole key. And, data that is redundantly duplicated across multiple rows of a table should be moved out to a separate table.
Dec 27 '06 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi freinds,

pls contribute any idia on;

what is the difference between two normal forms (1NF,2NF)
Alem

Check out the following

Mary

First Normal Form


  • Eliminate repeating groups in individual tables.
  • Create a separate table for each set of related data
  • Identify each set of related data with a primary key
Do not use multiple fields in a single table to store similar data.




Second Normal Form
  • Create separate tables for sets of values that apply to multiple records
  • Relate these tables with a foreign key
Records should not depend on anything other than a table's primary key (a compound key, if necessary). For example, consider a customer's address in an accounting system. The address is needed by the Customers table, but also by the Orders, Shipping, Invoices, Accounts Receivable, and Collections tables. Instead of storing the customer's address as a separate entry in each of these tables, store it in one place, either in the Customers table or in a separate Addresses table.
Jan 3 '07 #3
Banfa
9,065 Recognized Expert Moderator Expert
Alem, on a point of board etiquette, I notice that you title all of the threads you start with your user name (Alem). It would be better for all concerned if you could make your thread titles an short description of the problem you are having.

It will also make the experts on the board more inclined to have a look at your threads.
Jan 4 '07 #4
Banfa
9,065 Recognized Expert Moderator Expert
mmccarthy/r035198x

Are there any other normal forms. This has direct relevence to my work (where I have been designing a database for the past 6 months).

However I kind of new NF1 and NF2, seem like common sense to me (they come directly from the programming equivilent 'no magic numbers' which basically states that you should only store data in your program 1 place then you are less likely to make a mistake if you need to change it).

Got any good links to references about this subject?
Jan 4 '07 #5
MMcCarthy
14,534 Recognized Expert Moderator MVP
mmccarthy/r035198x

Are there any other normal forms. This has direct relevence to my work (where I have been designing a database for the past 6 months).

However I kind of new NF1 and NF2, seem like common sense to me (they come directly from the programming equivilent 'no magic numbers' which basically states that you should only store data in your program 1 place then you are less likely to make a mistake if you need to change it).

Got any good links to references about this subject?
The next one is 3NF and then you have BCNF (Boyce-Codd Normal Form)

3NF
The third normal form requires that all columns in a relational table are dependent only upon the primary key. A more formal definition is:
A relational table is in third normal form (3NF) if it is already in 2NF and every non-key column is non transitively dependent upon its primary key. In other words, all nonkey attributes are functionally dependent only upon the primary key.


The process of transforming a table into 3NF is:
  1. Identify any determinants, other the primary key, and the columns they determine.
  2. Create and name a new table for each determinant and the unique columns it determines.
  3. Move the determined columns from the original table to the new table. The determinate becomes the primary key of the new table.
  4. Delete the columns you just moved from the original table except for the determinate which will serve as a foreign key.
  5. The original table may be renamed to maintain semantic meaning.
The advantage of having relational tables in 3NF is that it eliminates redundant data which in turn saves space and reduces manipulation anomalies.

BCNF

A relation is in Boyce-Codd Normal Form (BCNF) if every determinant is a candidate key. BCNF is very similar to 3NF but deals with dependencies within the primary keys.

Most relations that are in 3NF are also in BCNF. It only happens that a relation which is in 3NF is not in BCNF when:
(a) the candidate keys in the relation are composite keys (that is, they are not single attributes),
(b) there is more than one candidate key in the relation, and
(c) the keys are not disjoint, that is, some attributes in the keys are common.

The BCNF differs from the 3NF only when there are more than one candidate keys and the keys are composite and overlapping.

Although 4NF, 5NF and even 6NF do exist they are not normally referred to.

A database is said to be normalised if it is in 3NF and/or BCNF.

MAry
Jan 4 '07 #6
r035198x
13,262 MVP
The next one is 3NF and then you have BCNF (Boyce-Codd Normal Form)

3NF


The third normal form requires that all columns in a relational table are dependent only upon the primary key. A more formal definition is:


A relational table is in third normal form (3NF) if it is already in 2NF and every non-key column is non transitively dependent upon its primary key. In other words, all nonkey attributes are functionally dependent only upon the primary key.




The process of transforming a table into 3NF is:
  1. Identify any determinants, other the primary key, and the columns they determine.
  2. Create and name a new table for each determinant and the unique columns it determines.
  3. Move the determined columns from the original table to the new table. The determinate becomes the primary key of the new table.
  4. Delete the columns you just moved from the original table except for the determinate which will serve as a foreign key.
  5. The original table may be renamed to maintain semantic meaning.
The advantage of having relational tables in 3NF is that it eliminates redundant data which in turn saves space and reduces manipulation anomalies.

BCNF

A relation is in Boyce-Codd Normal Form (BCNF) if every determinant is a candidate key. BCNF is very similar to 3NF but deals with dependencies within the primary keys.

Most relations that are in 3NF are also in BCNF. It only happens that a relation which is in 3NF is not in BCNF when:
(a) the candidate keys in the relation are composite keys (that is, they are not single attributes),
(b) there is more than one candidate key in the relation, and
(c) the keys are not disjoint, that is, some attributes in the keys are common.

The BCNF differs from the 3NF only when there are more than one candidate keys and the keys are composite and overlapping.

Although 4NF, 5NF and even 6NF do exist they are not normally referred to.

A database is said to be normalised if it is in 3NF and/or BCNF.

MAry
In practice, of course, people rarely go as far as BCNF.
Jan 5 '07 #7
MMcCarthy
14,534 Recognized Expert Moderator MVP
In practice, of course, people rarely go as far as BCNF.
We're lucky sometimes if they go as far as 3NF.

Mary
Jan 5 '07 #8
r035198x
13,262 MVP
We're lucky sometimes if they go as far as 3NF.

Mary
I thought you were the database expert?
Jan 5 '07 #9
MMcCarthy
14,534 Recognized Expert Moderator MVP
I thought you were the database expert?
I'm the one who spends half my time fixing databases that aren't fully normalised.
Jan 5 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1437
by: Michael Lauzon | last post by:
Database Normalisation Advisor Designated Contact: thox, xpl2 Status: Open Open Date: 2004-10-26 11:53 For Project: Lands of Myths & Legends (http://sourceforge.net/projects/lamyle/) Long Description: Our project requires someone to advise us on the database structure for a game that we are planning to create. The key requirements are
1
1621
by: Michael Lauzon | last post by:
Database Normalisation Advisor Designated Contact: thox, xpl2 Status: Open Open Date: 2004-10-26 11:53 For Project: Lands of Myths & Legends (http://sourceforge.net/projects/lamyle/) Long Description: Our project requires someone to advise us on the database structure for a game that we are planning to create. The key requirements are
0
1343
by: Michael Lauzon | last post by:
Database Normalisation Advisor Designated Contact: thox, xpl2 Status: Open Open Date: 2004-10-26 11:53 For Project: Lands of Myths & Legends (http://sourceforge.net/projects/lamyle/) Long Description: Our project requires someone to advise us on the database structure for a game that we are planning to create. The key requirements are
2
1929
by: David Allison | last post by:
Should Lookup fields be replaced by table normalisation? Then the Tables brought together in a Query for a Form to be based on? -- Dave Allison ~ Scotland
2
3831
by: James W. | last post by:
Hi everyone, I would like to ask you lot if you know of a great place on the internet for a fool proof idiots guide to Normalisation 1st, 2nd, 3rd. I looked at webopedia but that is just as confusing. I am looking for a complete idiots guide that really is so simple all it needs is pictures to turn it into a kiddies book
11
2487
by: Michael Thomas | last post by:
Hi everyone Not sure if this is the right newsgroup to be posting to for this question, but I am using Access 2002 to develop a database solution for the company that I work for. It's basically as stock control system where I need to keep track of the quantities of products. Our company is a retail chain, and we have eight shops or locations and a head office. The tables that I've set up are as follows
3
1477
by: Macbane | last post by:
Hello All, This has been bugging me for too long. I have a database that records medical interventions. I am familiar with the theory behind normalisation but am unsure what to do with the following data. Firstly, I have a main table which records the specifics of the intervention (date, reporter, details, location etc). It has links and the database is normalised ok as far as I can make out. However, I have 6 check box fields in...
1
2125
by: shauna | last post by:
hi, i am an As level student studying Applied ICT, im having problems with normalisation. our problem is to computerise a made up business.mine for example is a beauty salon. below are my attributes and they need to be normalised to 3rd normal form! i have also shown what i have come up with but i am unsure as to whether it is correct! please help as im finding this very difficult. Normalisation The goal of normalisation is to create a...
2
1715
by: hiyamwah | last post by:
Hi i am a little unsure of how you do this problem: A company wishes to allocate staff to a new project that as been proposed by the company. As a result, a new relation was created for this propose as follows: Staff_Project (Staff_No, Proj_Id, Proj_Name Proj_Location, Staff_Hours, Staff_Name, Staff_Address) Assuming that, Staff_No stands for staff number of the employee; Proj_Id is identifies of one of the projects that the...
2
1845
mikek12004
by: mikek12004 | last post by:
I have a table for categories (id->the primary key, and name) and I want to add another column parent (one category might be inside another) with the id's range of values so in fact parent will be a foreign key of the id right?Can I declare a foreign key of a primary key in the same table as that primary key or it is better make a seperate table for the relationships between categories? (lately been reading about db normalisation and wandering...
0
9997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11279
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10981
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9675
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7205
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4725
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4307
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.