• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

First Normal Form

Hi All,

I am a bit confused about 1NF. What must the relationship be between primary key and its fields in the first normal form? It has to be one to one or it can be one to many ?

Cheers,
0
Delidumrul
Asked:
Delidumrul
2 Solutions
 
thenelsonCommented:
It can be one to one, one to many or many to many and still follow 1NF rules. For a brief explanation of first normal form rules see http://en.wikipedia.org/wiki/First_normal_form
0
 
DelidumrulAuthor Commented:
For example;


1NF
Module_Code PK
Module Title
Module Leader
Office

In the above example, each non-key attributes (module title, module leader, office) have a relationship with Module code attribute. Do you mean the relationship can be between them many to many , one to many and one to one?

Cheers,
0
 
thenelsonCommented:
I am not following. What do you mean by "each non-key attributes (module title, module leader, office) have a relationship with Module code attribute."?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
harfangCommented:
You probably mean "relation" and not "relationship". These very similar words have different meanings in database design.

The table below creates "relations" between numbers, names, and expressions representing a status. The relation between ID and name is similar to a one-to-one "relationSHIP" in that both columns are unique and required. They are both key columns. The relation between the number (or the name) and a status is similar to a many-to-one relationSHIP between a table of EE members and a table of account types.

However, if a relation looks like a one-to-many relationSHIP, then the table doesn't follow the first normal form. For example, if a user could have several account types expressed directly in that table.

(°v°)
ID       name          status
-------  ------------  -------------------------
  94825  harfang       Qualified Expert
 354821  thenelson     Qualified Expert
5143244  Delidumrul    Premium Service Member

Open in new window

0
 
SheilsCommented:
I normally think about it as object and subject. The primary key is the object and everything else in the record are its subject. Then for each subject item I ask "Can their be more than one of this for the current object". If the answer is no then that subject can be a field in that table otherwise a separate table is required.
1NF
Module_Code PK
Module Title
Module Leader
Office
 
In your example:
Module_Code is the PK(Object)
Can it have more than one title? NO . We put it in this table
Can it have more than one Module Leader? No. We put it in this table
Can it be found in more that one Office? yes We cannot put the office field in this table
The following website gives a good introduction to normalisation
http://www.databasedev.co.uk/1norm_form.html 
SB9
 
 
0
 
DelidumrulAuthor Commented:
thanks for both answer
0
 
dportasCommented:
In fact every relation is in 1NF because a relation is a set of unique tuples and therefore has at least one candidate key. A table is said to be in 1NF if it accurately represents some relation: no duplicate rows or column names, no nulls and at least one candidate key constraint.

A primary key is not formally necessary at all, but by convention one of the candidate key(s) is usually deemed to be a "primary" key, whether identified explicitly in metadata or just by convention among the users of the database.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now