0% found this document useful (0 votes)
2 views

CS614 Assignment 1

Uploaded by

ahsan sajjad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

CS614 Assignment 1

Uploaded by

ahsan sajjad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Student ID: BC200405572

Question No.1
Table 1: Staff Branch given below reflects a specific form of normalization.

Table 1: Staff Branch

Staff No. Name position Salary Branch No. Branch Address TelNo.
S17005 Rizwan Manager 300000 B001 7 — st. Al Anayat Co. G- 302-3332-2
Ahmed 11 Islamabad.
S15002 Arifa Javed Assistant 80000 B001 7th — st. Al Anayat Co. G- 302-3332-2
11 Islamabad.
S23361 Ahmed Ali Manager 300000 B002 City Center Plaza, 420-5847-5
Karachi
S40021 Salinan Ahmed Assistant 750000 B002 City Center Plaza, 420-5847-5
Karachi
S00129 Hafza Khan Supervisor 90000 B003 Naz Digital Plaza, 205-2584-3
Lahore.
S01352 Ameer Ali Manager 200000 B004 Yusif plaza Rawalpindi 305-4561-9
You are required to identify the normalization form(NF) of the given table and also transform the given table
into the 3rd normalization form (3NF) and provide the resultant tables.

Note: To convert in 3NF, first you need to convert it in 2NF, and resultant tables of 3NF are only required.

Solution:

Table 1.1: Staff Details’

StaffNo Name Position Salary


S17005 Rizwan Ahmed Manager 300000
S15002 Arifa Javed Assistant 80000
S23361 Ahmed Ali Manager 300000
S40021 Salman Ahmed Assistant 750000
S00129 Hafza Khan Supervisor 90000
S01352 Ameer Ali Manager 200000

Table 1.2: Branch Detail

Branch Branch Address TelNo


No
B001 7th — st. Al Anayat Co. G-11 Islamabad. 302-3332-2
B002 City Center Plaza, Karachi 420-5847-5
B003 Naz Digital Plaza, Lahore. 205-2584-3
B004 Yusif plaza Rawalpindi 305-4561-9

Now, let's further normalize the tables into 3NF. Since there are no transitive dependencies, both tables are
already in 3NF.

Resultant Tables:
Table 1.1: Staff Details
Staff No | Name | Position | Salary

Table 1.2: Branch Details


BranchNo | BranchAddress | TelNo

So, the tables after normalization are already in 3NF, and the decomposition has resulted in the Staff Details
and Branch Details tables.
Question No.2

CUSTOMER ID, int. PK CUSTOMER NAME. vai-


i ORDER_ID, int, PK
char[100}
CUSTOM ER I D int. FK
CUSTOMER ADDRESS varcilaril00) TAX
? ULP D,-A L d ate
IDENTIFIER varchar(20)
t>‘ P L:' L F_.A.‘ \ LJ U N T in-i in r i?',

Figure 1: CUSTOMER_ORDER Relationship

Table1 (Master):
Header Size of the CUSTOMER table: = 60 Bytes
Number of records stored in CUSTOMER table: = 70000
Table2 (Detail):
Header size ORDER table: = 70 Bytes
Number of records stored in ORDER table: = 5000000

Suppose you have applied the pre-joining De-Normalization technique on the ‘CUSTOMER’ and ‘ORDER’
tables.
Calculate the size of the resultant table in Megabytes (MB), Gigabytes (GB), and Terabytes (TB). The
reference column in these two tables is 8 bytes.

Hint: There would be 5000000 records in the De-normalized table.

Answer:
The header of resultant de-normalization = 60+70 =130 bytes
Subtract the reference column in these two tables bytes is = 130-8 =122 bytes
According to the records in de-normalized table the size of de-normalization is = 122*5000000
=61,000,000 bytes

For Convert bytes into MB divided by (1000) 2 = 61,000,0000 /(1000) 2 = 61 MB


For Convert bytes into GB divided by (1000) 3 61,000,0000 /(1000) 3 =0.61 GB
For Convert bytes into TB divided by (1000)’ = 61,000,0000 /(1000)’ = 0.00061TB

You might also like