Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this considered a normal form failure?

When storing a user's religion in a "User Table", so that if you look down a column you would see "Christian" many times, "Muslim" many times, etc considered a failure of a normal form? Which form?

The way I see it:

  • 1nf: There are no repeating columns.

  • 2nf: There is no concatenated primary key, so this does not apply.

  • 3nf: There is no dependency on a nonkey attribute.

Storing user religion this way does not seem to fail any normal form, however it seems very inefficient. Comments?

like image 263
user Avatar asked Dec 30 '11 03:12

user


People also ask

How do you know if a relation is a normal form?

Steps to find the highest normal form of relation:Divide all attributes into two categories: prime attributes and non-prime attributes. Check for 1st normal form then 2nd and so on. If it fails to satisfy the nth normal form condition, the highest normal form will be n-1.

What is the normal form?

The stage at which a table is organized is known as its normal form (or a stage of normalization). There are three stages of normal forms are known as first normal form (or 1NF), second normal form (or 2NF), and third normal form (or 3NF).

Which normal forms are important?

Each rule is referred to as a normal form (1NF, 2NF, 3NF). The first three forms are the most important ones. There are more than 3 normal forms but those forms are rarely used and can be ignored without resulting in a non flexible data model. Each normal form constrains the data more than the previous normal form.

What is 1st 2nd and 3rd normal form?

First, second, and third normal forms are the basic normal forms in database normalization: The first normal form (1NF) states that each attribute in the relation is atomic. The second normal form (2NF) states that non-prime attributes must be functionally dependent on the entire candidate key.


1 Answers

Your design supports all normal forms. It's fine that your attribute has a string value. The size of the data type is irrelevant for normalization.

The goal of normalization is not physical storage efficiency -- the goal is to prevent anomalies. And to support logical efficiency, i.e. store a given fact only once. In this case, the fact that the user on a given row is Christian.

like image 138
Bill Karwin Avatar answered Sep 22 '22 06:09

Bill Karwin