Sunteți pe pagina 1din 8

Database Systems -ITC 423 Assignment -1B

1|Page

Table of contents

Part A.......................................................................................03

Part B.......................................................................................04

Part C.......................................................................................07

2|Page

RDM & ER Modelling

Part A: Convert ERD to Relational Data Model


Question A.1 Nursery (nursery_id, nursery_name, nursery_address, nursery_code) Primary key (nursery_id) Alternative key (nursey_code) Staff (staff_id, staff_fname, staff_lname, staff_employ_date) Primary key (staff_id) Foreign key nursey_id References Nursery Question A.2 Qualification (qual_id, qual_name, contractor_id) Primary key (qual_id) Foreign key contractor_id References Contractor Alternative key (qual_name) Contractor (contractor_id, contractor_fname, contractor_lname) Primary key (contractor_id) Skill (skill_id, skill_description) Primary key (skill_id) Contractor_Skill (contractor_id, skill_id, skill_acquired_date) Primary key (contractor_id, skill_id) Foreign key contractor_id References Contractor Question A.3 Staff (staff_id, staff_fname, staff_lname) Primary key (staff_id) Plan (plan_id, staff_id) Primary key (plan_id) Foreign key staff_id References Staff Contractor (contractor_id, contractor_fname, contractor_lname) Primery key (contractor_id)

3|Page

Contractor_Plan (contractor_id,plan_id, contractor_work_start_date, contractor_work_end_date) Primary key (contractor_id, plan_id) Foreign key1 contractor_id References Contractor Foreign key2 plan_id Reference Plan

Part B: Normalization
1.) Dependency Diagram

Client_id Client_name Street Town Land_size Plan_id Plan_name Designer_name Desing_location


Partial Dependency Partial Dependency

Transitive Dependency

Transitive Dependency

Figure 1.1 Dependency Diagram

1NF(Client_id, Plan_id,client_name,Street, Town, Land_size, Plan_name, Designer_name,Designer_location) Partial Dependencies (Client_id (Plan_id Client_name, Town) Plan_name, Street, Land_size, Designer_name, Designer_location)

Transitive Dependencies (Designer_name (Street Designer_location)

Town, Land_size)

2.) The 1Normal Form (1NF) because: All of the key attribute are defined, no repeating group and all attributes are dependent on the primary key.

4|Page

3.) 3NF Table name: Client

Client_id

Client_name

Client (Client_id, Client_name)

Table Name: Plan

Plan_id

Plan_name

Street

Designer_name

Plan (Plan_id, Plan_name, Street, Designer_name)

Table Name: Street

Street_code

Land_size

Street (Street_code, Land_size)

(Street code is similar to street attribute in the question) Table Name: City

Client_id

Plan_id

Town

City (Client-Id, Plan_id, Town)

Table Name: Designer

Designer_name

Designer_location

5|Page

4.) Client (Client_id, Client_name) Primary key (Client_id)

Plan (Plan_id, Plan_name, Street, Designer_name) Primary key (Plan_id) Foreign key Designer_name References Designer

Street (Street_code, Land_size) Primary key (Street_code)

Designer (Designer_name, Designer_location) Primary key (Designer_name)

City (Client_id, Plan_id, Town) Primary Key (Client_id, Plant_id)

6|Page

Part C: Entity Relationship Diagram 01.)


Client PK client_id client_fname client_lname client_address client_telno client_email Plan Plants PK plants_id plants_name height Shrubs PK shrubs_id shrubs_name shrubs_type has has has Features PK Final_Size_Shape PK FK1 FK2 FK3 size_no, shape_no plan_id feature_id structure_id structure_final_shape structure_final_size feature_final_shape feature_final_size has has FK1 feature_id plan_id feature_desc feature_size feature_shape Vegetation PK FK1 vegetation_id plan_id vegetation_type vegetation_name has PK FK1 FK2 FK3 plan_id designer_id plants_id shrubs_id plan_name plan_land_size has PK FK1 Designer designer_id client_id designer_name designer_address designer_phone_number designer_email land_size client_structure client_feature client_vegetation

provide

Structures has PK FK2 structure_id plan_id structure_name structure_shape structure_size

has

Figure 1.2 Entity Relationship Diagram

Note: All the relationships should be in normal lines. But in my ERD all are in dotted line. The reason is that the designing software did not support for normal lines. Please kindly consider this circumstances.

7|Page

02.) Client (client_id, client _fname, client_lname, client_addres, client_telno, client_email) Primary key(Client_id) Alternative key (client_telno) Plants (plants_id, plant name,height) Primary key (plants_id) Shrubs (shrubs_id, shrubs_name, shabs_type) Primary key (shrubs_id) Plan (plan_id, designer_id, plant_id, shrubs_id, plan_name, plan_land_size) Primary key (plan_id) Foreign key1 designer_id References Designer Foreign key2 plan_id References Plan Foreign key3 shrubs_id References Shrubs Designer (designer_id, client_id, designer_address, designer_phone_nmber, designer_email, designer_size, designer_structure, designer_feature, designer_vegetation) Primary key (designer_id) Foreign key client_id Reference client Structure (Structure_id, plan_id, Structure_type, Structure_name) Primary key (Structure_id) Foreign key plan_id Reference Plan Final_size_shape (size_no, shape_no, plan_id, structure_id, structure_final_shape, structure_final_size, structure_final_shape, structure_final_size) Foreign key1 plan_id Reference Plan Foreign key2 feature_id Reference Features Foreign key3 structure_id Reference Structures Features (feature_id, plan_id, feature_desc, feature_size, feature_shape) Primary key (feature_id) Foreign key plan_id Reference Plan Vegetation (vegetation_id, plan_id, vegetation_type, vegetation_name) Primary key (vegetation_id) Foreign key plan_id Reference Plan Alternative key (vegetation_name)

8|Page

S-ar putea să vă placă și