Вы находитесь на странице: 1из 29

Contents

Introduction .................................................................................................................................................. 2
Task 1 ............................................................................................................................................................ 4
Entity-Relationship diagram...................................................................................................................... 4
Task 2 ............................................................................................................................................................ 5
Data Dictionary ......................................................................................................................................... 5
Relationship .................................................................................................................................................. 7
Task3 ........................................................................................................................................................... 12
Task 4 .......................................................................................................................................................... 14
Creating SQL Table .................................................................................................................................. 14
Task 5 .......................................................................................................................................................... 18
Task 6 .......................................................................................................................................................... 20
Task 7 .......................................................................................................................................................... 24
Task 8 .......................................................................................................................................................... 27
Transactions ............................................................................................................................................ 27
Concurrency control ............................................................................................................................... 28
Recovery control ..................................................................................................................................... 28
Task 9 .......................................................................................................................................................... 28
Reflective Overview ................................................................................................................................ 28
Candidate Name: LANG DANE

Candidate ID Number: 00152811

Qualification: B.Sc(Hons)BCIS(UCLAN)
ADVANCED DATABASE MANAGEMENT SYSTEMS
Module

Centre: IBCT MANDALAY,MYANMAR

I have read and understood both NCC Educations Academic Misconduct Policy and the Referencing and
Bibliographies document. To the best of my knowledge my work has been accurately referenced and all
sources cited correctly.

I confirm that this is my own work and that I have not colluded or plagiarised any part of
it.

Candidate Signature: DANE

Date: 5/11/2017
Introduction
I am Lang Dane, I am studying BIT Degree class at IBCT campus Mandalay. This Assignment
Title is Hyperion Boats. I am very interested in Computer Science. Databases is my favorite
subject. This subject is essential for IT Student. If a student wants to be an IT Professional, must
study and well know about databases, nowadays. My responsibility is to accomplish this
assignment to familiarize with databases.
Task 1

Entity-Relationship diagram
External_Contract
Workers or

external_contractor_V
Repair Type essel

Job_title_Ve
ssel
Vessel Customer
Job title

Lying_at(port) Vessel_Type Vessel_Model


Task 2
Data Dictionary
Entity : Vessel
Description : Details of Vessel
Identification Attribute : Vessel_id (PK)
Other Attributes : Vessel_Type_id(FK), Lying_at(Port)_id(FK), Customer_id(FK),
Vessel_Name, Vessel_length, Vessel_colour

Entity : Customer
Description : Details of Customer
Identification Attribute : Customer_id (PK)
Other Attributes : Customer_name, Customer_address, Customer_Telephone,
Customer_email, Customer_postcode

Entity : Vessel_type
Description : Details of Vessel_type
Identification Attribute : Vessel_type_id (PK)
Other Attributes : Vessel_type_name

Entity : Vessel_Model
Description : Details of Vessel_Model
Identification Attribute : Vessel_Model_id (PK)
Other Attributes : Vessel_type_id(FK), Vessel_Model_name

Entity : Lying_at(Port)
Description : Details of Lying_at(Port)
Identification Attribute : Lying_at(Port)_id (PK)
Other Attributes : Lying_at(Port)_name

Entity : Workers
Description : Details of Workers
Identification Attribute : Workers _id (PK)
Other Attributes : Job_title_id(FK), Workers _name

Entity : Job_title
Description : Details of Job_title
Identification Attribute : Job_title _id (PK)
Other Attributes : Job_title_name

Entity : Repair_type
Description : Details of Repair_type
Identification Attribute : Repair_type _id (PK)
Other Attributes : Job_title_id(FK),Description

Entity : External_Contractor_Vessel
Description : Details of External_Contractor_Vessel
Identification Attribute :-
Other Attributes : External_Contractor_id(FK), Vessel_id(FK)

Entity : External_Contractor
Description : Details of External_Contractor
Identification Attribute : External_Contractor_ id (PK)
Other Attributes : External_Contractor_name

Entity : Job_title_vessel
Description : Details of Job_title_vessel
Identification Attribute :-
Other Attributes : Job_title_id(FK), Vessel_id(FK)
Relationship
Customer Vessel

Relationship ID: R1

Relationship Name: Customer and Vessel relationship

Description: Customer and Vessel are connected by one to many relationship

Participating Entity: Customer

Cardinality: one

Optionality: Mandatory

Participating Entity: Vessel

Cardinality: many

Optionality: Mandatory

Lying_at(port) Vessel

Relationship ID: R2

Relationship Name: Lying_at(port) and Vessel relationship

Description: Lying_at(port) and Vessel are connected by one to many relationship

Participating Entity: Lying_at(port)

Cardinality: one

Optionality: Mandatory

Participating Entity: Vessel

Cardinality: many
Optionality: Mandatory

Vessel_Type Vessel

Relationship ID: R3

Relationship Name: Vessel_type and Vessel relationship

Description: Vessel_type and Vessel are connected by one to many relationship

Participating Entity: Vessel_type

Cardinality: one

Optionality: Mandatory

Participating Entity: Vessel

Cardinality: many

Optionality: Mandatory

Vessel_Type Vessel_Model

Relationship ID: R4

Relationship Name: Vessel_type and Vessel_Model relationship

Description: Vessel_type and Vessel_Model are connected by one to many relationship

Participating Entity: Vessel_type

Cardinality: one

Optionality: Mandatory

Participating Entity: Vessel_Model

Cardinality: many
Optionality: Mandatory

Job_title Workers

Relationship ID: R5

Relationship Name: Job_title and Workers relationship

Description: Job_title and Workers are connected by one to many relationship

Participating Entity: Job_title

Cardinality: one

Optionality: Mandatory

Participating Entity: Workers

Cardinality: many

Optionality: Mandatory

Job_title Repair_Type

Relationship ID: R6

Relationship Name: Job_title and Repair_type relationship

Description: Job_title and Repair_type are connected by one to many relationship

Participating Entity: Job_title

Cardinality: one

Optionality: Mandatory

Participating Entity: Repair_type

Cardinality: many

Optionality: Mandatory
Job_title Job_title_Vessel

Relationship ID : R7
Relationship Name : Job_title and Job_title_Vessel relationship
Description : Each Job_title and Job_title_Vessel are depended one to many
relationship
Participating Entity : Job_title
Cardinality : One
Optionality : Mandatory
Paritcipating Entity : Job_title_Vessel
Cardinality : Many
Optinality : Mandatory

Vessel Job_title_Vessel

Relationship ID : R8
Relationship Name : Vessel and Job_title_Vessel relationship
Description : Each Vessel and Job_title_Vessel are depended one to many
relationship
Participating Entity : Vessel
Cardinality : One
Optionality : Mandatory
Paritcipating Entity : Job_title_Vessel
Cardinality : Many
Optinality : Mandatory
Vessel External_contractor_Vessel

Relationship ID : R9
Relationship Name : Vessel and External_Contractor_Vessel relationship
Description : Vessel and External_Contractor_Vessel are one to many
relationship
Participating Entity : Vessel
Cardinality : One
Optionality : Mandatory
Paritcipating Entity : External_Contractor_Vessel
Cardinality : Many
Optinality : Mandatory

External_Contractor External_contractor_Vessel

Relationship ID : R10
Relationship Name : External_Contractor and External_Contractor_Vessel relationship
Description : External_Contractor and External_Contractor_Vessel are one to
many
relationship
Participating Entity : External_Contractor
Cardinality : One
Optionality : Mandatory
Paritcipating Entity : External_Contractor_Vessel
Cardinality : Many
Optinality : Mandatory
Task3
3rd Normal Form

Customer
Customer_id (PK)
Customer _name
address
telephone_number
postCode

Vessel
Vessel_id (PK)
Vessel_type_id (FK)
Customer_id (FK)
Lying_at(Port)_id (FK)
Vessel_Name
length
colour

Job_title
Job_title_id(PK)
Job_title_name

Workers
Workers_id(PK)
Worker_name
Job_title_id(FK)

Repair_type
Repair_type_id(PK)
Job_title_id(FK)
Description

Job_title_Vessel
Job_title_id(FK)
Vessel_id(FK)
External_Contractor_Vessel
External_Contractor_id(FK)
Vessel_id(FK)

External_Contractor
External_Contractor_id(PK)
External_Contractor_name
referral for

Lying_at(Port)
Lying_at(Port)_id(PK)
Lying_at(Port)_name

Vessel_type
Vessel_type_id(PK)
Vessel_type_name

Vessel_Model
Vessel_Model_id(PK)
Vessel_Model_name
Task 4
Creating SQL Table

create table customer(


customer_id varchar(20) not null primary key,
First_Name Varchar(20),
Surname Varchar(20),
Street Varchar(20),
Town varchar(20),
County Varchar(20),
Postcode varchar(10),
Telephone varchar(20),
Email varchar(30));

create table vessel_type(


vessel_type_id integer not null primary key,
vessel_type varchar(20));

Create table vessel_Model(


vessel_Model_id integer not null primary key,
vessel_Model varchar(50),
vessel_type_id integer,
foreign key(vessel_type_id)references vessel_type(vessel_type_id));
Create table Lying_at(
Lying_at_id integer not null primary key,
Lying_at varchar(20));

create table Job_title(


job_title_id integer not null primary key,
job_title varchar(20));

create table Repair_type(


Repair_type_id varchar(20) not null primary key,
Description varchar(50),
job_title_id integer not null,
foreign key(job_title_id)references Job_title(job_title_id));

create table workers(


Workers_id varchar(20) not null primary key,
First_Name varchar(20),
Surname varchar(20),
Job_title_id integer,
foreign key(job_title_id)references Job_title(job_title_id));
create table Vessel(
vessel_id varchar(20) not null primary key,
Vessel_Name varchar(20),
vessel_type_id integer,
customer_id varchar(20),
length varchar(20),
Hull_Colour varchar(10),
Lying_at_id integer,
foreign key(vessel_type_id)references vessel_type(vessel_type_id),
foreign key(customer_id)references customer(customer_id),
foreign key(Lying_at_id)references lying_at(Lying_at_id));

create table External_Contrator(


External_contrator_id integer not null primary key,
Name_Of_Contractor varchar(20),
Referral_For varchar(50));

create table External_contrator_Vessel(


External_contrator_id integer,
Vessel_id varchar(20),
foreign key(external_contrator_id )references external_contrator(external_contrator_id),
foreign key(vessel_id)references vessel(vessel_id));
create table Job_title_vessel(
Job_title_id integer,
vessel_id varchar(20),
foreign key(Job_title_id)references Job_title(Job_title_id),
foreign key(vessel_id)references vessel(vessel_id));
Task 5

desc customer;

desc vessel;

desc vessel_type;

desc vessel_model;
desc workers;

desc repair_type;

desc external_contrator;

desc external_contrator_vessel;

desc job_title_vessel;
Task 6

a)select
customer.customer_id,customer.First_name,customer.Surname,vessel.vessel_id,vessel.vessel_name

from customer,vessel

where customer.customer_id=vessel.customer_id;

b) select job_title.job_title_id,job_title.job_title,repair_type.Description

from job_title,repair_type

where job_title.job_title_id=repair_type.job_title_id and

job_title.job_title='chief mechanic';

c)

select customer.customer_id,customer.First_name,customer.Surname,vessel.vessel_id,job_title

from customer,vessel,job_title_vessel,job_title

where customer.customer_id=vessel.customer_id and


vessel.vessel_id=job_title_vessel.vessel_id and

job_title.job_title_id=job_title_vessel.job_title_id and

customer.First_name='Evan'and

customer.Surname='Zigomalas';

d) select vessel.vessel_id,vessel.vessel_name,lying_at

from vessel,lying_at

where lying_at.lying_at_id=vessel.lying_at_id and

lying_at.lying_at='Weymouth';
e)

select vessel.vessel_id,vessel.vessel_name,name_of_contractor

from vessel,external_contrator_vessel,external_contrator

where vessel.vessel_id=external_contrator_vessel.vessel_id and

external_contrator.external_contrator_id=external_contrator_vessel.external_contrator_id and

external_contrator.name_of_contractor='star software';

f) select job_title.job_title_id,job_title.job_title,repair_type.repair_type_id,repair_type.description

from job_title,repair_type

where job_title.job_title_id=repair_type.job_title_id and

repair_type.description='Hull repair';
g) select
customer.customer_id,customer.First_name,customer.Surname,customer.County,vessel.vessel_id,vesse
l.vessel_name

from customer,vessel

where customer.customer_id=vessel.customer_id and

customer.county='kent';

h) select job_title.job_title,count(*) as Assigned_Jobs

from job_title,workers

where job_title.job_title_id=workers.job_title_id and

job_title.job_title='fitter';
Task 7

Select * from customer order by customer_id;

Select * from vessel order by vessel_id;

select * from vessel_type order by vessel_type_id;


select * from vessel_model order by vessel_model_id;

select * from lying_at order by lying_at_id;

select * from job_title;

select * from repair_type order by repair_type_id;


select * from worker order by workers_id;

select * from external_contrator order by external_contractor_id;

select * from external_contrator_vessel;

select * from job_title_vessel;


Task 8

Transactions
Transactions are events that occur on the database. Typically, a transaction reads a value from a
database or writes a value to a database. If you have any operating system concept, then we can say
that a transaction is similar to a process. Although the transaction can read and write the database, but
there are some fundamental differences between these two types of operations. The read operation
does not change the image of the database in any way. However, whether the write from the database,
update or delete the data to perform the write operation will change the database image. That is, we
can say that these transactions will be the database from the transaction before the existence of the
image (called Before Image or BFIM) to the transaction occurred after the existence of the image (called
After Image or AFIM).1

Concurrency control
When multiple transactions try to access the same shareable resources, if the access control is not
correct, there may be many problems. There are some important mechanisms that can maintain access
control. Earlier we discussed the concept of serializable theory, but we could implement this concept by
using locks and timestamps. Here, we will discuss some protocols in which locks and timestamps can be
used to provide an environment in which concurrent transactions can maintain their consistency and
isolate attributes.2

Recovery control
Logs are staggered when multiple transactions are executed in parallel. At recovery time, restoring the
system will be difficult to trace back all the logs and then resume. To alleviate this situation, most
modern DBMSs use the "checkpoint" concept.

Check point

Maintaining and maintaining logs in real-time and real-world environments may fill in all the
memory available in the system. As time goes by, the log file may grow too much to handle. A
checkpoint is a mechanism in which all previous logs are removed from the system and stored
permanently on the storage disk. The checkpoint declares a point where the DBMS is in a consistent
state and all transactions are committed.3

Task 9

Reflective Overview
I think this situation the integrity of information, detailed system requirements, requests
or the needs of users of the system point. In the Task 1, I draw ERD. In task 2 data dictionary
after the case and create a relational schema. And I carried out the standardization of data, so I
normalized these ERD to ensure that all are in normalizing status in task 3. In Task 4, I use the
Structure Query Language (SQL) to create tables and insert the test data into tables. And I make

1
http://www.eazynotes.com/pages/database-management-system/transaction-management.html
2
http://www.eazynotes.com/pages/database-management-system/concurrency-control.html
3
https://www.tutorialspoint.com/dbms/dbms_data_recovery.htm
a screen shoot for the SQL codes and output tables including data and print out them. In task- 6 I
show the data queries from my database. By the requirement of problem, I also make data
output and print out them. In Task -8 I show the transction management, concurrency control
and recovery. In task-9 I report my database.

Вам также может понравиться