Database Semester 1 Assignment

You might also like

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

Introduction

Synergy Exhibition Services provides facilities for putting on displays and demonstration at
exhibition for promotional purposes. They are hired by the external customer to perform
these tasks. Those exhibition can be hired by single external customer or large group of
customer can do that same as according to their need. They provide stalls and displays
instalment for the exhibitions. This is might include virtual reality tour or slide in PowerPoint.
Here, I am hired by Synergy Exhibition Services to develop a database for its data. For this,
my job is categorized into three steps. First I need to design the database, data and queries
for the customer, staffs, software, staffs role, exhibition and their types. An installation can
be a projected slide presentation using software like PowerPoint, a virtual reality tour or a
sound and light show.

DATA DESIGN
a) Produce an entity relationship model for the proposed database system
for Synergy Exhibition Services.
Entity relationship
In entity relation diagram, entities are represented in graphical presentation with
relationship between each other. It’s also known as ER diagram. It is unique itself. It
can be done in many forms like UML, Crows Feet, CHEN. For this model, I have
chosen Crows feet. ER diagram makes organizing data whole lot easier. UML, Chen
feet are good on their own ways but Crows feet was easier for me demonstrate. So, it
was chosen.
The data shown in this assignment is not normalized so we have to normalize the
data.
Normalization is simply representing entities with relationship in normal form.
Sometimes in the database data gets repeated and every task becomes like virtually
impossible to do. This makes our efficiency and creatively very low. This problem is
fixed by the help of Normalization. In technical term Normalization is the way of
making data that are not in relation to a relation to reduce data complexity. There are
3 types of normalization 1NF, 2NF and 3NF.
First normalization Form (1NF) = Basic normalization, It can hold single value to
remove all the repeated group and each column have same kind of value. They
contain rows and column. Each row is unique with own value.
Second normalization form (2NF) = It is next level of normalization after first
normalization. In this second normalization form, dependency partiality is must to
avoided for any attributes on PK (primary key).
Third normalization form (3NF) = In the third normalization, It is best level of
normalization. Here, we have to remove all non key dependent attributes or remove
functional dependency.
Here is the entity relationship model of the database:

Screenshot ER diagram

Now, in the above ER diagram, all the entity is fully normalized to 3NF form. They are
on crows feet notation. So many attributes are mentioned by me in the diagram. Some are
null attributes, multi valued, etc.

b) Discuss how you have identified primary and foreign keys


for your entity relationship model. You could mention data
integrity, referential integrity and functional dependence in
your discussion.
A primary key is a unique field in the table which enables us to identify every
record in that table. It is the single value attributes.
A foreign key help us to join tables together and make a relation. It is one of the field
in table. It connects with primary key of another table.
As I normalized data to third normalization form I was able to obtain primary and
foreign key which are also mentioned in the above Entity Relationship Diagram.
Attributes like staff role ID, installation ID, software ID, staff ID, customer ID,
exhibition ID, etc. are primary key. It is unique for all exhibition and entire table.
For the foreign key, attributes like:
Robin_exhibitionexhibition_ID, robin_staffstaff id,
robin_CustomercustomerID,robin_staff_rolestaff_role id.
Data integrity is the way that data will always be accurate, regular and easy to
manage. It is necessary for keeping the record valid for longer times.
Referential integrity is a feature in database which helps to ensure correct
relationship between more than one table by the application of constraint. It makes
sure customer does not enter invalid data. It also creates a discipline while entering
data to not enter incorrect data.
Functional dependence is also a constraint. It helps to define the relationship
between more attributes that are in a relation. It can be very useful in relational
model, database normalization, etc.
These all helps to make database more easier to read,maintain and write

c) Produce a data dictionary for the entity relationship model


showing all attributes, with data types and identifying
primary and foreign keys.
Here, I am asked to create a data dictionary for the above entity relationship model
with all the attributes, datatypes and primary key with foreign key shown in detailed
and creative manner. Let’s understand what Data dictionary is first.
Data dictionary helps us to get the final result of the data base. It helps us while
stroring record for the future references. The data dictionary below is made by me for
the company that appointed me to do this job.
Robin_Customer
Name type Length Null key key
Customer varchar 15 - Primary Key
Number
Customer varchar 60 yes -
Name

Robin_Installation_types
Name type Length Null key Key
Installation_ID varchar 10 - Primary Key
Installation_Types varchar Yes -
40
Installation Description varchar 300 Yes -
Robin_ExhibitionExhibition varchar 10 - -
ID

Robin_Exhibition
Name types length Null key Key
Exhibition ID Varchar 10 - Primary key
Exhibition Name Varchar 60 Yes -
Exhibition Address Varchar 100 Yes -
Exhibition start date Date 8 Yes -
Exhibition end date Date 8 Yes -
Robin_CustomerCustomer Varchar 15 - Foreign key
Number
Robin_Exhibition_Type ID Varchar 50 - Foreign key

Robin_Exhibition_robin_Staff
Name types Length Null key Key
Robin_ExhibitionExhibition Varchar 10 - Foreign key
ID
Robin_StaffStaff ID varchar 10 - Foreign key

Robin_Staff_Role
Name type Length Null key Key
Staff role ID Varchar 10 - Primary key
Staff Role varchar 30 - -
Name

Robin_Staff
Name type Length Null key Key
Staff ID varchar 10 - Primary key
Staff Name varchar 50 - -
Robin_Staff_RoleStaff Varchar 10 - -
role ID

Robin_Exhibition_Types
Name type Length Null key Key
Exhibition type Varchar 10 Yes -
Name
Exhibition type varchar 50 - Primary key
ID

Robin_software
Name Type length Null key Key
Software ID Varchar 10 - Primary key
Software Types Varchar 40 Yes -
Software Description Varchar 300 Yes -
Robin_ExhibitionExhibition varchar 10 - Foreign key
ID
Data Entry and Data Manipulation

a) Create all the tables using SQL. Show your create table scripts and the finished
tables
All the tables are created and the query for that with table script are shown below:
Robin_Customers

Robin_exhibition_types
Robin_exhibition

Robin_softwares
Robin_staff_roles

Robin_installation_types

Robin_Staff
Robin_staff_Exhibition
b) Enter data on all the exhibitions shown in the assignment.

c) Enter data for all the customers and associate them with exhibitions. Note that a
customer might have more than one exhibition associated with them.
d) Enter data on staff and exhibitions they are working at taken from the assignment.
Give a listing of this information.

e) Write a query that selects all the exhibitions for the Travel Association of Great
Britain.

f) Write a query that selects the staff that work in software support.
g) Write a query that selects all the exhibition details for exhibitions at Olympia.

h) Write a query that counts all the trade exhibitions.

i) Write a query that shows the staff working at stamp exhibitions.

j) Update the item table so that Sharon Smith has changed jobs to Software Project
Manager.
k) Update the staff table so that Pauline West is nowknown as Pauline Yardley.

l) Update the lesson title of the exhibition ‘Stampex’ to ‘Stampex 2017’

m) Update any exhibitions that involve Sandy Niles so that now they have Diana West
assigned to them.

n) Delete the staff record for Sandy Niles.


Assessment
The project’s assessment is about the database of German company name “Synergy
exhibition services”. This company has plan to expand its branches all over the Europe
which is the reason why this database is appointed to me. For the database, I just created
table for all the customers, staffs and software while in the exhibition. Data of all the
customer, staffs including their role and software used in the exhibition with all the exhibition
types are inserted in the database. After the insertion of all the data, I was asked to delete
the old data and update to new data. Those data were normalized. For ease of use while in
the exhibition, normalization to 3NF was made. So, for single customer looking to organize
exhibition won’t have any kind of trouble. In other words, the customer doesn’t have to deal
with large complex data for just simple task. Above, I have explained all about Normalisation
with detail description about 1NF and 2NF and 3NF. So that any customer or staffs within
the company can understand the database without wasting any time or for ease of use.
Explanation of first, second and third normalization is important for future reference.
While those data were normalized into 3nf form those primary and foreign keys were
obtained which is also inserted into the database. Entity relationship diagram was produced
and explained in detail. After that I created data dictionary for the ER model. I explained
what data dictionary is so that every staffs can understand. Data dictionary also has the data
that about the data that is helpful for knowing what kind of data is used in the particular
records. There were many errors while performing these tasks but it was all fixed and done
successfully. At last, I was asked to make query. And I made it successfully with no error.
The software I used for creating database were:
ORACLE SQL DEVELOPER: Oracle SQL Developer is a software from oracle that help us
to create our database and write query on it. It’s a free of cost software. I downloaded Oracle
SQL Developer and did all the project with the help of this software.
I created table, inserted value and wrote query here. I was lucky I didn’t get any error.

Oracle Visual Paradigm: I used this software to create Entity relationship model.
Oracle visual paradigm helps us to create case diagram, ER diagram, etc. I design the ER
model from this software. This is a easy to use software for the IT beginners.
Ultimately, I kept the integration of data and it’s redundancy.
Conclusion:
I was successfully able to make database for the Synergy Exhibition services without any
error in the most efficient manner. I did it with help from two software SQL Developer and
Visual Paradigm both from the Oracle. While doing this project I got little help from my lab
teacher and Theory teacher. I thank them. I was able to make database that is easy to
understand, easy to maintain, future proof, fast execution and low cost.

You might also like