DB Assignment 2
DB Assignment 2
Name
Address
TelNo
Position
Shift
Ward No
Ward Name
Location
Week Beginning
Charge Nurse
Charge Nurse No
Tel.Ext
S123 S0988
Razia Aslam
23A-XYZ 24-A/zzz
0512233445 052998877
Nurse Nurse
Un-Normalized Record
S123 S0988
Razia Aslam
23A-XYZ 24-A/zzz
0512233445 052998877
Nurse Nurse
Late Late
cardic cardic
Block E Block E
1/1/1998 1/1/1998
Sunbail Sunbail
7711 7711
We select the Staff No; Ward No and Charge Nurse No. as primary key. y y y Insertion Anomaly: Insertion Anomaly is present in the 1NF because a new Item cannot be includes it is issued to a Ward. Deletion Anomaly: Deletion Anomaly is also present in the 1NF because if we want to delete any Item we must lose some information. Updation Anomaly: Updation anomaly is also present in the 1NF because if an Item code is changed there are several places it will be changed.
All the three kinds of anomalies are present in the First Normal Form so we will step forward in the Second Normal Form.
Second Normal Form Staff No Name, Address, Telephone No, Position Ward No Ward Name, Location Charge Nurse, Tel Ext Charge Nurse No Staff No; Ward No; Cahrge Nurse No Position, Location, Tel Ext, Week Beginning, Shift
Name
Address
TelNo
Position
Shift
Ward No
Ward1 Ward1
Charge Nurse No
S011 S011
Razia Aslam
23A-XYZ 24-A/zzz
051-2233445 052-998877
Nurse Nurse
Late Late
Ward No
Ward1 Ward1
Ward Name
cardic cardic
Charge Nurse No
S011 S011
Charge Nurse
Sunbail Sunbail
Tel Ext
7711 7711
Third Normal Form Staff No Name, Address, Telephone No, Position Ward Name, Location Ward No Charge Nurse No Charge Nurse, Tel Ext Staff No; Ward No; Cahrge Nurse No Week Beginning, Shift
Staff No.
Shift
Charge Nurse No
S123 S0988
Late Late
Ward1 Ward1
1/1/1998 1/1/1998
S011 S011
Ward Name
cardic cardic
Charge Nurse No
S011 S011
Charge Nurse
Sunbail Sunbail
Tel Ext
7711 7711
Specialization Name SE AI AI SE Networks AI SE AI Faizan Faizan Zafar Ahmad Ahmad Ahmad Fahad Fahad
Specialization Semester Fall2009 Spring2010 Spring2010 Fall2009 Spring2010 Fall2010 Fall2010 Spring2011
Semester Start-Date 05-07-09 05-02-10 05-02-10 05-07-09 05-02-10 05-07-10 05-07-10 05-02-11
Semester End-Date 31-12-09 30-06-10 30-06-10 31-12-09 30-06-10 31-12-10 31-12-10 30-06-11
Specialization Supervisor Prof Majid Prof Saeed Prof Saeed Prof Majid Prof Wajid Prof Saeed Prof Majid Prof Saeed
Name Student ID Specialization Specialization Semester Student ID, Specialization Semester Start-Date, Semester End Date, Specialization Supervisor
Student-ID Vu001 Vu001 Vu002 Vu003 Vu003 Vu003 Vu004 Vu004 Specialization SE AI AI SE Networks AI SE AI Semester Start-Date 05-07-09 05-02-10 05-02-10 05-07-09 05-02-10 05-07-10 05-07-10 05-02-11 Semester End-Date 31-12-09 30-06-10 30-06-10 31-12-09 30-06-10 31-12-10 31-12-10 30-06-11 Specialization Supervisor Prof Majid Prof Saeed Prof Saeed Prof Majid Prof Wajid Prof Saeed Prof Majid Prof Saeed
Specialization Semester
Fall2009 Spring2010 Spring2010 Fall2009 Spring2010 Fall2010 Fall2010 Spring2011
Name
Faizan Faizan Zafar Ahmad Ahmad Ahmad Fahad Fahad
Name Student ID Specialization Specialization Semester Semester Start Date Semester End Date Semester Start-Date, Specialization Supervisor Student ID, Specialization
Info Table
Student-ID Vu001 Vu001 Vu002 Vu003 Vu003 Vu003 Vu004 Vu004 Specialization SE AI AI SE Networks AI SE AI Semester Start-Date 05-07-09 05-02-10 05-02-10 05-07-09 05-02-10 05-07-10 05-07-10 05-02-11 Specialization Supervisor Prof Majid Prof Saeed Prof Saeed Prof Majid Prof Wajid Prof Saeed Prof Majid Prof Saeed
Specialization Semester
Fall2009 Spring2010 Spring2010 Fall2009 Spring2010 Fall2010 Fall2010 Spring2011
Name
Faizan Faizan Zafar Ahmad Ahmad Ahmad Fahad Fahad
Semester End-Date
31-12-09 30-06-10 30-06-10 31-12-09 30-06-10 31-12-10 31-12-10 30-06-11
P.O. No
Date
Item ID.
Item Name
Supplie r ID.
Supplier Name
Supplier Address
Quotatio n No.
Payment Mode
Inden t No.
Units
2101 0034
1/1/98 6/1/99
01 016 0054
013 003
03 08
Cash Credit
0210 1086
5 6 3
Kg Num Doz
P.O. No
Date
Item ID.
Item Name
Supplie r ID.
Supplier Name
Supplier Address
Quotation No.
Payment Mode
Indent No.
Units
01 016 0054
03 08 08
5 6 3
Kg Num Doz
We select the Item ID; Supplier I.D and Indent No as primary key. y y y Insertion Anomaly: Insertion Anomaly is present in the 1NF because a new Item cannot be includes it is issued to a Supplier. Deletion Anomaly: Deletion Anomaly is also present in the 1NF because if we want to delete any Item we must lose some information. Updation Anomaly: Updation anomaly is also present in the 1NF because if an Item code is changed there are several places it will be changed.
All the three kinds of anomalies are present in the First Normal Form so we will step forward in the Second Normal Form.
Item Name Item ID Supplier ID Supplier Name, Supplier Address P.O. No, Date, Quotation No; Payment Mode, Units Item Id, Supplier Id, Indent No Quantity Order
Quotation No.
03 08 08
Payment Mode
Cash Credit Credit
Indent No.
0210 1086 1086
Quanti ty Order
5 6 3
Units
01 016 0054
Kg Num Doz
Item ID.
Item Name
01 016 0054
DEPT _CO DE
DEPT _NA ME
DEPT _PHO NE
COLLE GE_NA ME
ADV _NA ME
ADV_ OFFI CE
STU _GP A
STU_ HOU RS 96
STU _CLA SS
Eva ns Ada ms
201
Noble Hall
7211
2.8 8
Juni or
STU_NU M
DEPT_NAM E
DEPT_PHON E
DEPT_COD E
ADV_NAM E
ADV_OFFIC E
ADV_BUILDIN G
ADV_PHON E
289343
Computer Science
7644
CS
Evans Adams
201
Noble Hall
7211
STU_NUM STU_NAME
STU_MAJOR
STU_GPA STU_HOURS
STU_CLASS COLLEGE_NAME
v289343
James D. Smith
Computer Science
2.88
96
Junior
DEPT_NAME
DEPT_PHONE
DEPT_CODE
Computer Science
7644
CS
ADV_NAME
ADV_PHONE
ADV_OFFICE
ADV_BUILDING
Evans Adams
7211
201
Noble Hall
STU_NUM 289343
DEPT_CODE
ADV_NAME
CS
Evans Adams