Академический Документы
Профессиональный Документы
Культура Документы
Semester: ____________5th________
Section: ______2013-2017________
Name:
Roll #_____1055________
Instructions:
1. Submit your assignment in hard form in class on A4 paper size and it must include 1 st page: print of this
sheet.
2. Late submission policy: deduction @ of 10% of total marks per day.
3. 100% correct solution is required. There will be no partial marks.
4. The Assignment is individual task
5. Show your work for each step of the process.
6. Show each table at each stage of normalization and label it.
7. Label each table and provide a description of the assumptions that you made in bringing the table(s) to
the specified level of normalization.
8. Describe your assumptions and related logic.
9.
All elements should be neatly typed on plain white paper. You can use whatever documentation tools
that you find useful for this exercise.
10. You will be graded on the correctness, completeness, and quality of your effort.
Hint: you can visit PIA website to understand the problem statement more precisely.
http://www.piac.com.pk/
11.
Copy of assignment from web or any source such as classmate will not be tolerated.
policy will be implemented for such cases.
Strict
Q1) The first part will involve a table that is partially of your own design. Use a report such as a sales
summary, a telephone bill, a credit card invoice, etc. to build a single table. Extract the fields represented on the
report and build a single table from these fields. Next, identify the dependencies/anomalies between these
fields. Finally, if appropriate, normalize the table up to 3NF.
(50%)
Q2) for the following description of an airline reservation system, identify the functional dependencies between
each field and build normalized tables based on these dependencies.
(50%)
PIA Airlines wants to develop database for its advanced reservation system. Some of the information that are
of particular importance for the reservation system include the following:
Flight information such as a flight number, the origin city, the destination city, scheduled departure time,
and scheduled arrival time need to be recorded. All of their flights are non-stop,
A specific flight will occur on a specific day and have a specific crew assigned to the flight. In
particular, the crew information that needs to be recorded included the employee ID and the employees
role on the flight (e.g., captain, flight attendant, etc.).
Specific pieces of equipment (i.e., planes) will need to be accounted for. Information such as the
Airplane ID, model, and capacity will need to be recorded.
Employee information will include their ID, name, cell/office phone, and title.
Information about customers includes their ID, name, phone number, and mailing address.
Reservations made by customers are recorded with a reservation number, the flight information,
customer information, the date, the fare, the payment method.
In the process of completing this assignment, perform the following steps for each of the two problems
discussed above.
1. List the fields in one table horizontally across the page and add some data (of your own design) below
each field You only need to include as much data as needed to understand the relationships between the
fields (i.e., you only need as many records as it takes to understand the dependencies between the
fields).
2. Make sure that the initial table is in 1NF. At this stage, it is probably still a good idea to maintain some
of your example data in the table. Make certain that you identify the primary key for each [mega] table.
3. Identify the functional dependencies that exist between the fields. You can probably drop the data from
the tables (unless it helps you to understand the functional dependencies). This also implies that you
will need to identify and display the candidate keys. When defining candidate keys, make certain that
you think about how to truly make each key unique
4. Convert the tables into higher levels of normalization. All tables should be normalized to at least 3NF to
complete the process (if you don't bring a table to a higher level of normalization, explain why this was
not done). Show all steps. It is probably a good idea to include an explanation of your rationale for the
actions taken at each step of the process
Throughout the normalization process, make certain that you identify the primary key by underlining the
field(s) that constitutes the primary key (when you build new tables, also italicize any foreign keys that you
identify -- this will help you verify that you are completing the normalization process properly). It is also
important that you show and explain your work and the logic that helps me to understand why you made the
changes that you made for each stage of normalization. Make certain that you show the progression from
lower levels of normalization to the higher levels. In other words, do not jump from normalized table to the
highest level of normalization (I want to see the logic and stages that you progressed through
in completing the project).
Q1) The first part will involve a table that is partially of your own design. Use a report such as a sales
summary, a telephone bill, a credit card invoice, etc. to build a single table. Extract the fields represented
on the report and build a single table from these fields. Next, identify the dependencies/anomalies
between these fields. Finally, if appropriate, normalize the table up to 3NF.
What is Normalization?
Database normalization is the process of efficiently organizing data in a database. There are two reasons of the
normalization process:
Normalization is very important part of the database. To remove redundancy of data i.e. having same
information stored at multiple places, which eventually be difficult to maintain and will also increase the size of
our
database.
With normalization we will have tables with fewer columns which will make data retrieval and insert, update
and delete operations more efficient.
There are some steps we use in normalization process called normalization forms. They are five but mostly we
use first three.
1NF
2NF
3NF
Teacher Table:
Teacher
Ahmad
Ali
Faisal
Age
25
34
27
Su
Biolo
M
M
In First Normal Form, any row must not have a column in which more than one value is saved, like separated
with commas. Rather than that, we must separate such data into multiple rows.
Age
Subject
Ahmad
25
Biology
Ahmad
25
Math
Ali
34
Math
Stuart
27
Math
Using the First Normal Form, data redundancy increases, as there will be many columns with same data in
multiple rows but each row as a whole will be unique.
Age
25
34
27
In Student Table the candidate key will be Student column, because all other column i.e. Age is dependent on it.
Subject
Ahmad
Biology
Ahmad
Math
Ali
Math
Faisal
Math
In Subject Table the candidate key will be {Student, Subject} column. Now, both the above tables qualify for
Second Normal Form and will never suffer from Update Anomalies. Although there are a few complex cases in
which table in Second Normal Form suffers Update Anomalies, and to handle those scenarios Third Normal
Form is there.
Teacher_name
DOB
Street
city
State
Zip
In this table Teacher_id is Primary key, but street, city and state depends upon Zip. The dependency between zip
and other fields is called transitive dependency. Hence to apply 3NF, we need to move the street, city and state
to new table, with Zip as primary key.
Teacher_name
Teacher_Street
DOB
city
Zip
state
Q2) for the following description of an airline reservation system, identify the functional dependencies
between each field and build normalized tables based on these dependencies.
PIA Airlines wants to develop database for its advanced reservation system. Some of the information that
are of particular importance for the reservation system include the following:
Flight information such as a flight number, the origin city, the destination city, scheduled
departure time, and scheduled arrival time need to be recorded. All of their flights are non-stop,
A specific flight will occur on a specific day and have a specific crew assigned to the flight. In
particular, the crew information that needs to be recorded included the employee ID and the
employees role on the flight (e.g., captain, flight attendant, etc.).
Specific pieces of equipment (i.e., planes) will need to be accounted for. Information such as the
Airplane ID, model, and capacity will need to be recorded.
Employee information will include their ID, name, cell/office phone, and title.
Information about customers includes their ID, name, phone number, and mailing address.
Reservations made by customers are recorded with a reservation number, the flight information,
customer information, the date, the fare, the payment method.
Departure
Arrival
Total Passenge
Flight information such as a flight number, the origin city, the destination city. All of their flights are
non-stop
Plane Details
Plane_ID
Flight_ID
Model
Capacity
Specific pieces of equipment (i.e., planes) will need to be accounted for. Information such as the
Airplane ID, model, and capacity will need to be recorded.
Schedule
Schedule_ID
Departure_time
Departure_date
Arrival_time
Arrival_date
Flight_ID
Schedule table includes Schedule id, departure time, and scheduled arrival time need to be recorded.
Employee Information
Employee_ID
Employee_job
Flight_ID
Customers Information
Cus_ID
Phone_no
Mailing_address
Payment_Method
Reservation
Cus_ID
F_name
L_name
NIC_no
Nationality
Gender
Passport_ID
BookingDate
Flight_ID
Normalization
Plane Details
Plane_ID
Flight_ID
Model
Capacity
Flight table
Flight_ID
Departure
Arrival
Total Passenge
Customers Information
Cus_ID
Phone_no
Mailing_address
Payment_Method
Schedule
Schedule_ID
Departure_time
Departure_date
Arrival_time
Arrival_date
Flight_ID
Employee Information
Employee_ID
Employee_job
Flight_ID
Reservation
Cus_ID
F_name
L_name
NIC_no
Nationality
1NF
Gender
Passport_ID
BookingDate
Flight_ID
2NF
THANK YOU