0% found this document useful (0 votes)
37 views7 pages

Software Normalization Steps Explained

The document contains details about normalizing several relations into third normal form (3NF). It includes instructions to normalize a student grade report containing student details and course grades into 0NF, 1NF, 2NF and 3NF, showing the tables and data in each form. It also asks to list the primary keys and foreign keys of the tables in 3NF. Similarly, it provides data about a student club's positions in competitions and instructs to normalize it into the four forms, showing the tables and data, and to list the keys of the 3NF tables. Finally, it gives data about a bill from an art shop with customer, salesman and product details and instructs to normalize it into

Uploaded by

hawra.sayed.ali
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views7 pages

Software Normalization Steps Explained

The document contains details about normalizing several relations into third normal form (3NF). It includes instructions to normalize a student grade report containing student details and course grades into 0NF, 1NF, 2NF and 3NF, showing the tables and data in each form. It also asks to list the primary keys and foreign keys of the tables in 3NF. Similarly, it provides data about a student club's positions in competitions and instructs to normalize it into the four forms, showing the tables and data, and to list the keys of the 3NF tables. Finally, it gives data about a bill from an art shop with customer, salesman and product details and instructs to normalize it into

Uploaded by

hawra.sayed.ali
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Question

Consider a table that stores information about customers and their orders, with the following
:columns

CustomerID (primary key)

CustomerName

CustomerAddress

CustomerCity

CustomerState

OrderID (primary key)

OrderDate

OrderTotal

OrderItem

OrderQuantity

Normalize it to Third Normal Form. Show all the necessary step and explanation for first and
second normal form too.

Question

Consider the following grade report of a student in different courses. The first part of the report
contains general details of the student such as ID of the student, name of the student, department
code, and department name. The second part of the report contains the details of the courses in
which the student obtained a grade. The Id of the course, name of the course, Id of the teacher,
name of the teacher, country of the teacher and the grade obtained by the student in the course is
.given in this part

(a) Normalize the report into 0NF, 1NF, 2NF and 3NF. Show the complete relations with the
given data in each normal form. [11 marks]
Student Grade Report

Student ID: S8799 Student Name: Asma

Department Code: CS Department Name: Computer Studies


TeacherNam TeacherId
Grade TeacherCountry CourseName CourseCode
e

Introduction to
A Jordan [Link] T1 Computers CS01

+B Oman [Link] T2 Networks CS04

B Jordan [Link] T1 Web Technology CS09

.Note: Grade means the grade obtained by the student in a course

(b) List primary keys & foreign keys (if any) of all tables in 3NF in the following format.

[4 marks]

Table Name Primary key Foreign key

]Question

Consider the following position report of a student club in different competitions. The first part
of the report contains general details of the club such as code of the club, name of the club,
university code, and university name. The club participates in different competitions. The second
part of the report contains the details of the competitions in which the club participated. The Id of
the competition, name of the competition, Id of the venue, name of the venue, city of the venue
.and the position won by the club in that competition is given in this part

(a) Normalize the report into 0NF, 1NF, 2NF and 3NF. Show the complete relations with the
given data in each normal form. [11 marks]
Position report of a student club in different competitions

Club Code: C001 Club Name: Winners

University Code: AOU University Name: Arab Open University


VenueId CompetitionNam CompetitionI
Position VenueCity VenueName
e d

Student
First Kuwait Al Jahra V1 Conference CP3

Student
Third Bahrain Manama V2 Symposium CP2

First Bahrain Manama V2 Hash Code CP1

.Note: Position means the position obtained by the club in a competition

(b) List primary keys & foreign keys (if any) of all tables in 3NF in the following format.

[4 marks]

Table Name Primary key Foreign key

Question
Consider the following bill of an art shop. The first part of the bill contains details of the
customer and the salesman. The second part of the report contains the details of the product
purchased.

(a) Normalize the report into 0NF, 1NF, 2NF and 3NF. Show the complete relations with the
given data in each normal form. [10 marks]
Bill report

Customer Id: 790 Customer Name: Ahmed


Customer Address: Muscat
Salesman code: EM003 Salesman Name: Khamis

ProductCod ProductPrice QuantityPurchas


ProductName
e ed

OL988 Oil Painting 35 2

PS032 Pencil Sketch 24 1

PS451 Pencil Sketch 20 1


Note:-
QuantityPurchased depends on Customer Id and ProductCode.

b) Write suitable table names resulting in 3NF and list primary keys & foreign keys (if any) of all
tables in 3NF in the following format.

[5 marks]

Table Name Primary key Foreign key

Question
Answer the following questions related to the accommodation of guests in a hotel as shown
:below

ACCOMMODATION (room_no, guest_no, room_type, room_rate, guest_name,


guest_nationality_code,guest_nationality_name, start_date_of_stay, end_date_of_stay)

:Suppose that the following functional dependencies hold

 guest_no determines guest_name, guest_nationality_code and guest_nationality_name


 guest_nationality_code determines guest_nationality_name
 room_no determines room_type and room_rate
 guest_no and room_no determines start_date_of_stay and end_date_of_stay
a. What is the highest normal form that this relation conforms to and why? [3 Marks]
b. Normalise this relation to 3NF, showing the new relations in the manner the
relation ACCOMMODATION is shown above. Make sure you identify the primary key for each
normalized relation by underlining it [6 Marks]
c. Write simple select SQL queries to produce the required normalized relations [6 marks]

Question
Answer the following questions related to a project allocation of a company as shown below:

PROJECT_ALLOCATION (staff_id, project_code department_id, staff_name,


staff_date_of_birth, staff_salary, department_name, project_code, project_name,
hours_worked)

Suppose that the following functional dependencies hold:

 staff_id determines staff_name, staff_date_of_birth, staff_salary and department_id


 department_id determines department_name
 project_code determines project_name
 staff_id, project_code determines hours_worked

a. What is the highest normal form that this relation conforms to and why? [3 Marks]
b. Normalise this relation to 3NF, showing the new relations in the manner the
relation PROJECT_ALLOCATION as shown above. Make sure you identify the primary
key for each normalized relation by underlining it [6 Marks]
c. Write simple ‘select’ SQL queries to produce the required normalized relations [6
marks]

Question
Consider the following bill of an art shop. The first part of the bill contains details of the
customer and the salesman. The second part of the report contains the details of the product
purchased.

(a) Normalize the report into 0NF, 1NF, 2NF and 3NF. Show the complete relations with the
given data in each normal form. [10 marks]
Bill report

Customer Id: 790 Customer Name: Ahmed


Customer Address: Muscat
Salesman code: EM003 Salesman Name: Khamis

ProductCod ProductPrice QuantityPurchas


ProductName
e ed

OL988 Oil Painting 35 2

PS032 Pencil Sketch 24 1

PS451 Pencil Sketch 20 1


Note:-
QuantityPurchased depends on Customer Id and ProductCode.

b) Write suitable table names resulting in 3NF and list primary keys & foreign keys (if any) of all
tables in 3NF in the following format.

[5 marks]

Table Name Primary key Foreign key


Question
Answer the following questions related to a project allocation of a company as shown below:

PROJECT_ALLOCATION (staff_id, project_code department_id, staff_name,


staff_date_of_birth, staff_salary, department_name, project_code, project_name,
hours_worked)

Suppose that the following functional dependencies hold:

 staff_id determines staff_name, staff_date_of_birth, staff_salary and department_id


 department_id determines department_name
 project_code determines project_name
 staff_id, project_code determines hours_worked

d. What is the highest normal form that this relation conforms to and why? [3 Marks]
e. Normalise this relation to 3NF, showing the new relations in the manner the
relation PROJECT_ALLOCATION as shown above. Make sure you identify the primary
key for each normalized relation by underlining it [6 Marks]
f. Write simple ‘select’ SQL queries to produce the required normalized relations [6
marks]

Common questions

Powered by AI

Over-normalization in database design can lead to increased complexity of SQL queries, as data is divided across numerous tables, requiring multiple joins to retrieve related information. This can result in reduced performance due to the overhead of processing these joins. Additionally, it can make database management more difficult, as maintaining multiple complex relational tables may lead to an increased risk of mistakes and maintenance overhead. The trade-off between normalization and performance needs careful consideration to avoid such downsides .

Achieving 3NF in database design is significant because it ensures that the database schema is free from transitive dependencies, which occur when non-key attributes depend on other non-key attributes rather than directly on the primary key. This normalization form reduces data redundancy, minimizes the potential for data anomalies during insert, update, and delete operations, and ensures data integrity by organizing data into tables that depict entities and relationships more accurately. Consequently, it leads to a more efficient and understandable database structure .

Functional dependencies are used to identify candidate keys by determining the minimum set of attributes necessary to uniquely identify each row in a table. A candidate key must have full functional dependency on all attributes it defines, meaning no sub-sets of the candidate key should be able to uniquely identify the table rows. By analyzing functional dependencies, one can ensure that all data-related dependencies are captured by these candidate keys, thereby preserving data integrity and allowing for accurate data retrieval .

Functional dependencies dictate how database normalization processes are carried out by determining relationships between columns in a database. They help identify what constitutes a primary key and how to eliminate redundancy and update anomalies. For instance, in a 1NF database, functional dependencies help identify partial dependencies that need to be removed to achieve 2NF by ensuring non-key attributes are fully dependent on the primary key. Furthermore, they are crucial in identifying transitive dependencies to separate them out in the 3NF .

Data redundancy is minimized in a 3NF database by ensuring that all non-key attributes are not only dependent on the primary key but do not have transitive dependencies on other non-key attributes. This means each piece of data is stored in the database only once, reducing the chance of inconsistent data. When data is required, joins are used to represent relationships that would otherwise be represented with redundant information, leading to a more efficient and organized data storage system .

Normalization to higher normal forms usually leads to more complex SQL queries because data is spread across multiple tables. In 1NF, queries are simpler as fewer tables are involved, but data redundancy can make it difficult to manage updates without errors. In 2NF, tables begin to specialize based on functional dependencies, reducing some redundancy and making queries more focused. In 3NF, data integrity is improved, but queries may require more joins to retrieve the same information due to data being split across more tables with reduced redundancy .

A database relation cannot be in Third Normal Form (3NF) without first being in Second Normal Form (2NF). Each step in normalization builds on the previous one, meaning a relation must satisfy the requirements of 1NF and 2NF to meet those of 3NF. A relation in 3NF must not have any transitive dependencies, which are only identifiable after all partial dependencies are removed in 2NF. Each step addresses a specific type of dependency that the subsequent step assumes has already been eliminated .

Eliminating partial dependencies is crucial when normalizing to 2NF to ensure that all non-key attributes are fully functionally dependent on the entire primary key, preventing redundancy and anomalies during updates. In databases where a composite key exists, partial dependencies occur when a non-key attribute depends only on part of the composite key rather than on the whole key, leading to redundancy. Eliminating these dependencies ensures each table accurately represents a single subject, enhancing data integrity and consistency .

In a 3NF relation, primary keys are identified as the minimal set of attributes needed to uniquely identify each tuple in a table, ensuring no duplicates. Foreign keys, on the other hand, are attributes that link one table to another, referencing the primary key of the related table to maintain referential integrity. Identifying these keys involves analyzing functional dependencies to ensure each non-prime attribute is fully dependent on the primary key, and any data shared across multiple tables is linked through a foreign key .

Normalization to 3NF involves three main steps. In the first step, ensure each table is in First Normal Form (1NF) by eliminating duplicative columns and ensuring that each column contains atomic values. Next, achieve Second Normal Form (2NF) by removing partial dependencies; every non-key attribute must be fully functionally dependent on the primary key. In the final step, achieve 3NF by removing transitive dependencies, ensuring all non-key attributes are directly dependent on the primary key alone without any intermediary dependency .

You might also like