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

Peyton Burger

Assignment 2

Part - A:

I am going to be translating the ER diagram that was provided to us into a relational schema. I
ensured to include all of the derived attributes, used primary and foreign keys, the weak entity
class included and subtypes.

REGION(RegionID, RegionName)
COUNTRY(CountryID, CountryName)
REGION_IN_COUNTRY(RegionID, CountryID) FK (RegionID) ref REGION, (CountryID) ref
COUNTRY

EMPLOYEE(EmpID, EmpName, EmpType)


EMPLOYEE_SKILLS(EmpID, EmpSkills) FK (empID) ref EMPLOYEE
EMPLOYEE_MANAGES(EmpID, ManagerID) FK (EmpID) ref EMPLOYEE

COUNTRY_MANAGER(EmpID, PhoneNumber) FK (EmpID) ref EMPLOYEE


DEVELOPMENT_MANAGER(EmpID, HourlyRate) ) FK (EmpID) ref EMPLOYEE
DEVELOPER(EmpID, PrimarySkill) ) FK (EmpID) ref EMPLOYEE
PROJECTS(ProjectID, StartDate, EndDate)
DEVELOPER_PROJECT_RECORDS(Dev_Proj_ID, ProjectID) FK (ProjectID) ref PROJECTS

MANGED_COUNTRY(CountryID, EmployeeID) FK (countryID) ref COUNTRY, (employeeID) ref


EMPLOYEE

REGION_IN_COUNTRY(RegionID, CountryID) FK (RegionID) ref REGION, (CountryID) ref


COUNTRY

DEVELOPER_PROJECT_RELATIONSHIP(EmpID,ProjectID) FK (EmpID) ref EMPLOYEE, (ProjectID)


ref PROJECT

Part B:

Inside of this part of the question I am going to address the normal form that table is presented
in, give examples of all the anomalies and translate the table provided into 3NF.

1)
a. It is currently presented in 1NF form because there are no multiple
multivalued attributes present. There is also one row for one value per cell in
this table making it possible to be in 1NF.
b.
Insertion Anomaly: Cant insert new product into the data without knowing
the supplier and details surrounding it.
Peyton Burger

Deletion Anomaly: Deleting a supplier (ex: John) would disrupt keyboard and
we would no longer have the details about the product.
Modification Anomaly: If we were to update the name of Smith we would
need to also update the other smiths inside the table.
c.
SUPPLIER(SupplierNo, SupplierName, SupplierCommission, YearHired,
ManagerName)
PRODUCT(ProductID, ProductName, ProductUnitPrice)
SUPPLIER_PRODUCT_RELATION(SupplierNo,ProductID) FK (SupplierNo) ref
SUPPLIER, (ProductID) ref PRODUCT
2)

Here in part two of the second section I am going to show you the normal form the example
currently is in, my reasoning behind why it is in this form and translate it into the 3NF.

a. The table is currently in 1NF


b. We classify this as 1NF because we still need to remove the partial dependencies
that it still contains. We are assuming that it has a valid relation is without any
multi-valued attributes. We have removed all of the repeating groups that were
in the the relation originally.
c.
CLASS(CourseID, CourseName, CourseType)
INSTUTION(InstID, InstName)
CLASS_INSTITUTION_RELATION(CourseID, InstID) FK (courseID) ref CLASS,
(instID) ref INSITUTION

You might also like