0% found this document useful (0 votes)
31 views2 pages

3rd Ques

1) The document discusses database normalization from 1NF to BCNF. It provides examples of tables that are not normalized and how to normalize them by eliminating repeating groups, creating separate tables for related data, and removing non-key fields. 2) The steps of normalization include 1NF to eliminate repeating groups, 2NF to create tables for non-key fields that apply to multiple records, and 3NF to remove non-key fields. BCNF further deals with tables that have overlapping candidate keys. 3) Examples show how to normalize a table with customer address, orders, and products into separate but linked tables for customers, addresses, orders, and products to conform with normalization forms through BCNF.

Uploaded by

Tanmay Basak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

3rd Ques

1) The document discusses database normalization from 1NF to BCNF. It provides examples of tables that are not normalized and how to normalize them by eliminating repeating groups, creating separate tables for related data, and removing non-key fields. 2) The steps of normalization include 1NF to eliminate repeating groups, 2NF to create tables for non-key fields that apply to multiple records, and 3NF to remove non-key fields. BCNF further deals with tables that have overlapping candidate keys. 3) Examples show how to normalize a table with customer address, orders, and products into separate but linked tables for customers, addresses, orders, and products to conform with normalization forms through BCNF.

Uploaded by

Tanmay Basak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Example of an un-normalized table----

A customer can have multiple orders but an order can be for only 1 product. CustName
and OrderNo pre-assigned as keys.

1NF –
• 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. For example, to track an
inventory item that may come from two possible sources, an inventory record may
contain fields for Vendor Code 1 and Vendor Code 2.
But what happens when you add a third vendor? Adding a field is not the answer; it
requires program and table modifications and does not smoothly accommodate a dynamic
number of vendors. Instead, place all vendor information in a separate table called
Vendors, then link inventory to vendors with an item number key, or vendors to inventory
with a vendor code key.

CUSTOMER (CustName, CustAddress)


ORDER (CustName, OrderNo, ProdNo, ProdDesc, Qty, DateOrdered)

2NF –
• 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.

CUSTOMER (CustName, CustAddress)


CUSTOMER ORDER (CustName, OrderNo)
ORDER (OrderNo, ProdNo, ProdDesc, Qty, DateOrdered)

3NF –
• Eliminate fields that do not depend on the key.

Values in a record that are not part of that record's key do not belong in the table. In
general, any time the contents of a group of fields may apply to more than a single record
in the table, consider placing those fields in a separate table.
For example, in an Employee Recruitment table, a candidate's university name and
address may be included. But you need a complete list of universities for group mailings.
If university information is stored in the Candidates table, there is no way to list
universities with no current candidates. Create a separate Universities table and link it to
the Candidates table with a university code key.

CUSTOMER (CustName, CustAddress)


CUSTOMER ORDER (CustName, OrderNo)
ORDER (OrderNo, ProdNo, Qty, DateOrdered)
PRODUCT (ProdNo, ProdDesc)

BCNF –
• When a relation has more than one candidate key, anomalies may result even
though the relation is in 3NF.
• 3NF does not deal satisfactorily with the case of a relation with overlapping
candidate keys i.e. composite candidate keys with at least one attribute in common.
• BCNF is based on the concept of a determinant.
• A determinant is any attribute (simple or composite) on which some other
attribute is fully functionally dependent.
• A relation is in BCNF is, and only if, every determinant is a candidate key.

CUSTOMER (CustName, CustAddress)


CUSTOMER ORDER (CustName, OrderNo) - CustName becomes just a foreign key
ORDER (OrderNo, ProdNo, Qty, DateOrdered)
PRODUCT (ProdNo, ProdDesc)

You might also like