Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Q1. What are the anomalies in the following?

StudentName AdvisorName AdvisorPhone AdvisorDept AdvisorDeptLocation


Tolstoy Caplice 253-3233 ESD Campus1
Thoreau Caplice 253-3233 ESD Campus1
James Lapide 253-1111 ESD Campus1
Woolf Toomre 253-6322 Mathematics Permanent Campus
Shakespeare Smith 253-8453 Physics Campus1
Pushkin Griffith 253-9833 Bio Engr Campus2
StudentAdvisor table

StudentAdvisor(StudentName, AdvisorName, StudentPhone ,AdvisorPhone, AdvisorDept


AdvisorDeptLocation)

Repetition anomaly: We are repeating AdvisorDept, AdvisorPhone, AdvisorDeptLocation, etc..


AdvisorName → AdvisorPhone, AdvisorName → AdvisorDept, AdvisorName →
AdvisorDeptLocation

Updation anomaly: Updation of AdvisorPhone would require updation of several records which is
time-consuming and prone to error

Insertion anomaly: If a department is introduced but no advisor is attached, there is no way of


inserting the department. Likewise, for if an advisor has joined but has no student to advise, there is no
way to insert that record

Deletion anomaly: If advisor Smith is deleted, we need to delete the student Shakespeare as well.

Q2. What are the anomalies present?


Definitions (for Q3 to 4):
1NF: All the attributes should contain atomic values.
2NF: All non-key attributes are fully functional dependent on the primary key (and every candidate
keys)
3NF: All non-key attribute must be non-transitively dependent on primary key (and every candidate
key)

Q3. Reduce the scenario presented in Q1 to 2NF


Assumptions – Primary key: StudentName, AdvisorName
Answer:
In reality, the following dependencies are true
StudentName → StudentPhone, AdvisorName → AdvisorPhone, AdvisorName → AdvisorDept, etc.

But, in the present form the following dependencies are held:


StudentName, AdvisorName → AdvisorPhone

The following is in 2NF


Student(StudentName, StudentPhone, AdvisorName)
Advisor(AdvisorName,AdvisorPhone,AdvisorDept, AdvisorDeptLocation)

Q4. Reduce the scenario presented in Q1 to 3NF


We will remove the transitive dependecy AdvisorName → AdvisorDept, AdvisorDept →
AdvisorDeptLocation
Student(StudentName, AdvisorName)
Advisor(AdvisorName,AdvisorPhone,AdvisorDept, AdvisorDeptLocation)
Department(DepartmentName, DepartmentLocation)

Q5. Reduce the scenario presented in Q2 to 2NF

Q4. Reduce the scenario presented in Q2 to 3NF

Q5. a. Detect anomalies and b. Reduce to 3NF:


Assumption: primary key (staffNo, apptDate, apptTime)

You might also like