Scanning the Internet for External Cloud Exposures via SSL Certs
Database
1. Rupesh Chaulagain 160409 DB
1
Table of Contents
Task 1 – Design..........................................................................................................................................3
a) Produce an entity relationship model for the proposed database system for ..........................3
Synergy Exhibition Services. This should be a fully normalized model to 3rd .............................3
normal form.............................................................................................................................................3
b) Discuss how you have identified primary and foreign keys for your entity...............................3
relationship model. You could mention data integrity, referential integrity and ............................3
functional dependence in your discussion. ........................................................................................3
c) Produce a data dictionary for the entity relationship model showing all attributes, with data
types and identifying primary and foreign keys. ................................................................................4
Task 2 – Data Entry and Data Manipulation ..........................................................................................7
a) Create all the tables using SQL. Show your create table scripts and the finished..................7
tables........................................................................................................................................................7
b) Enter data on all the exhibitions shown in the assignment. ......................................................11
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..........................................................12
d) Enter data on staff and exhibitions they are working at taken from the..................................13
assignment. Give a listing of this information. .................................................................................13
e) Write a query that selects all the exhibitions for the Travel Association of Great..................15
Britain.....................................................................................................................................................15
f) Write a query that selects the staff that work in software support. ...........................................15
g) Write a query that selects all the exhibition details for exhibitions at Olympia.......................15
h) Write a query that counts all the trade exhibitions. ....................................................................16
i) Write a query that shows the staff working at stamp exhibitions...............................................16
j) Update the item table so that Sharon Smith has changed jobs to Software ...........................16
Project Manager...................................................................................................................................16
k) Update the staff table so that Pauline West is now known as Pauline Yardley.....................17
l) Update the lesson title of the exhibition ‘Stampex’ to ‘Stampex 2017’.....................................18
m) Update any exhibitions that involve Sandy Niles so that now they have Diana ...................18
West assigned to them........................................................................................................................18
n) Delete the staff record for Sandy Niles. .......................................................................................19
Task 3 – Assessment ..........................................................................................................................19
3. Rupesh Chaulagain 160409 DB
3
Task 1 – Design
a) Produce an entity relationship model for the proposed database system
for
Synergy Exhibition Services. This should be a fully normalized model to 3rd
normal form. (NCC uploads)
Normalization is removing repeating groups and making relation between the data. We must
normalize any given data to make a reliable database. There are certain steps performed during
normalization. Most used normal form are: 1NF, 2NF, 3NF.
ER model is the pictorial representation of data which contains table and entities inside each
and table are related to each other. The main components of ER model are entity set and
relation set. I have used CROWS FEET to make ER diagram in Visual paradigm.
The required ER model which is in 3rd
normal form is:
Screenshot: Fully normalized ER diagram
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. (NCC uploads)
Primary key:
It is a column in a table which uniquely defines every entity of a table. It must not be null. It must
be index and unique. From using primary key we can retrieve all the other data from the table.
There is always one primary key in every table but cannot be more than one. To choose a
primary key we look for all the column which can uniquely define other column and from those
columns we select the suitable one, For example, in table Rupesh31_Exhibition there are two
4. Rupesh Chaulagain 160409 DB
4
possible primary key there Exhibition_id, Exhibition_name are the possible primary key
because from these columns we can retrieve all the other data. But, Exhibition_name can
occur twice in the table thus Exhibition_id is suitable for primary key.
Foreign key:
Foreign key is a column which relates a table to another. Usually primary key of one table
becomes foreign key in another table. When we relate the table the table with many relation
holds foreign key. Foreign key can be identified by looking relationship between two tables. The
foreign key is formed in the table with many relation. For example, in three tables
Rupesh31_Exhibition, Rupesh31_Customer, Rupesh31_Exhibition type, the relation
between Rupesh31_Exhibition and Rupesh31_Customer the relation is many to one
respectively. So, the foreign key is Rupesh31_Exhibition. In table Rupesh31_Exhibition and
Rupesh31_Exhibition_type the relation is many to one respectively. So, foreign key lies in
Rupesh31_Exhibition. To create foreign key, it must be primary key is previously created
table. There can be one or more foreign keys in a single table.
Data integrity:
It means the precision and reliability of data. We should maintain the data integrity to guarantee
recoverability and to relate data between each other.
Relational integrity:
This integrity is used to make relation between two tables. When we make foreign key in a table
then it must be primary key in another table which must be created first. It also defines that the
primary key and foreign of two related tables must be same. For example, in tables
Rupesh31_Exhibition_type and Rupesh31_Exhibition Exhibition_type_id is primary key
and foreign key in respected table. Here, we must create the table Rupesh31_Exhibition_type
first then only we can create Rupesh31_Exhibition. Due to relational integrity, we cannot
delete or update Exhibition_type_id in Rupesh31_Exhibition table. Hence, we maintained
relational integrity while making primary key and foreign key.
Functional dependency:
The elements of a table are functionally dependent if one column of a table can define another
column of table. In other words, it is constraints which describes relation between attributes. It is
important to maintain functional dependency during normalization. Here, for Exhibition Summary
Sheet Exhibition_id can define Exhibition_name, Exhibition_address and Exhibition_dates
so one table is formed having Exhibition_id as primary key. Similarly, Customer_no defines
customer_name and forms table with Customer_no as primary key and Exhibition_type_id
defines Exhibition_type and forms another table with Exhibition_type_id as primary key.
Hence, the functional dependency is maintaining and also helps to find out primary key.
c) Produce a data dictionary for the entity relationship model showing all
attributes, with data types and identifying primary and foreign keys. (NCC
uploads)
A place where metadata (data of data) is stored is data dictionary. This is mostly behind
the scenes data. It defines the data type of any data. It also contains length, range,
formatting and any other data about this data.
5. Rupesh Chaulagain 160409 DB
5
For table Rupesh31_Staff_roll
DD for Rupesh31_Staff_roll
For table Rupesh31_Customer
DD for Rupesh31_Customer
For table Rupesh31_Exhibition_type
DD for Rupesh31_Exhibition_type
For table Rupesh31_Exhibition
DD for Rupesh31_Exhibition
For table Rupesh31_Staff
6. Rupesh Chaulagain 160409 DB
6
DD for Rupesh31_Staff
For table Rupesh31_Exhibition_Staff
DD for Rupesh31_Exhibition_Staff
For table Rupesh31_Software_type
DD for Rupesh31_Software_type
For table Rupesh31_Installation_type
DD for Rupesh31_Installation_type
7. Rupesh Chaulagain 160409 DB
7
Task 2 – Data Entry and Data Manipulation
a) Create all the tables using SQL. Show your create table scripts and the
finished
tables. (NCC uploads)
• Creating all table
To create Rupesh31_Staff_roll
Create Rupesh31_Staff_roll
To create Rupesh31_Customer
Create Rupesh31_Customer
To create Rupesh31_Exhibition_type
Create Rupesh31_Exhibition_type
To create Rupesh31_Exhibition
8. Rupesh Chaulagain 160409 DB
8
Create Rupesh31_Exhibition
To create Rupesh31_Staff
Create Rupesh31_Staff
To create Rupesh31_Exhibition_Staff
Create Rupesh31_Exhibition_Staff
To create Rupesh31_Software_type
Create Rupesh31_Software_type
To create Rupesh31_Installation_type
9. Rupesh Chaulagain 160409 DB
9
Create Rupesh31_Installation_type
• All created table
Desc Rupesh31_Staff_roll
Showing Rupesh31_Staff_roll created table
Desc Rupesh31_Customer
Showing Rupesh31_Customer created table
Desc Rupesh31_Exhibition_type
Showing Rupesh31_Exhibition_type created table
Desc Rupesh31_Exhibition
10. Rupesh Chaulagain 160409 DB
10
Showing Rupesh31_Exhibition created table
Desc Rupesh31_Staff
Showing Rupesh31_Staff created table
Desc Rupesh31_Exhibition_Staff
Showing Rupesh31_Exhibition_Staff created table
Desc Rupesh31_Software_type
11. Rupesh Chaulagain 160409 DB
11
Showing Rupesh31_Software_type created table
Desc Rupesh31_Installation_type
Showing Rupesh31_Installlation_type created table
b) Enter data on all the exhibitions shown in the assignment. (NCC
uploads)
Entering data to table Rupesh31_Exhibition
Entering data to table Rupesh31_Exhibition_type
Data entered in table Rupesh31_Exhibition
12. Rupesh Chaulagain 160409 DB
12
Data entered in Rupesh31_Exhibition_type
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. (NCC uploads)
Entering data to Rupesh31_Customer
Entering data to Rupesh31_Software_type
13. Rupesh Chaulagain 160409 DB
13
Entering data to Rupesh31_Installation_type
Data entered in Rupesh31_Customer
Data entered in Rupesh31_Software_type
Data entered in Rupesh31_Installation_type
d) Enter data on staff and exhibitions they are working at taken from the
assignment. Give a listing of this information. (NCC uploads)
Entering data to table Rupesh31_Staff
14. Rupesh Chaulagain 160409 DB
14
Entering data to Rupesh31_Exhibition_Staff
Entering data to Rupesh31_Staff_roll
Data entered in Rupesh31_Staff
Data entered in Rupesh31_Exhibition_Staff
Data entered in Rupesh31_Staff_roll
15. Rupesh Chaulagain 160409 DB
15
e) Write a query that selects all the exhibitions for the Travel Association of
Great
Britain. (NCC uploads)
Query needed is:
Screenshot: Query to select required data
Result:
Screenshot: data selected
f) Write a query that selects the staff that work in software support. (NCC
uploads)
Query needed is:
Screenshot: Query to select required data
Result:
Screenshot: data selected
g) Write a query that selects all the exhibition details for exhibitions at
Olympia. (NCC uploads)
Query needed is:
16. Rupesh Chaulagain 160409 DB
16
Screenshot: Query to select required data
Result:
Screenshot: data selected
h) Write a query that counts all the trade exhibitions. (NCC uploads)
Query needed is:
Screenshot: Query to count required data
Result:
Screenshot: data counted
i) Write a query that shows the staff working at stamp exhibitions. (NCC
uploads)
Query needed is:
Screenshot: Query to select required data
Screenshot: selected data
j) Update the item table so that Sharon Smith has changed jobs to
Software
Project Manager. (NCC uploads)
Query needed is:
17. Rupesh Chaulagain 160409 DB
17
Screenshot: Query to update required data
Updated table:
select SR.Staff_roll,S.Staff_name from Rupesh31_Staff_roll SR , Rupesh31_Staff S
where SR.Staff_roll_id=S.Staff_roll_id;
Screenshot: updated table
k) Update the staff table so that Pauline West is now known as Pauline
Yardley. (NCC uploads)
Query needed is:
Screenshot: Query to update required data
Updated table:
select Staff_id,Staff_name from Rupesh31_Staff;
18. Rupesh Chaulagain 160409 DB
18
Screenshot: updated table
l) Update the lesson title of the exhibition ‘Stampex’ to ‘Stampex 2017’.
(NCC uploads)
Query needed is:
Screenshot: Query to delete required data
Updated table:
select Exhibition_id,Exhibition_name from Rupesh31_Exhibition;
Screenshot: updated table
m) Update any exhibitions that involve Sandy Niles so that now they have
Diana
West assigned to them. (NCC uploads)
Query needed is:
Screenshot: Query to update required data
19. Rupesh Chaulagain 160409 DB
19
Updated table:
select o.Staff_id, o.Staff_name, b.Exhibition_name
from Rupesh31_staff o, Rupesh31_exhibition_type et, Rupesh31_exhibition b,
Rupesh31_exhibition_staff es
where o.staff_id = es.staff_id
and b.exhibition_type_id = et.exhibition_type_id
and b.exhibition_id = es.exhibition_id
and s.staff_name = 'Diana West';
Screenshot: updated table
n) Delete the staff record for Sandy Niles. (NCC uploads)
Query needed is:
Screenshot : Query to delete required data.
Table after deleting:
select* from Rupesh31_staff;
Screenshot: deleted table
Task 3 – Assessment (NCC uploads)
A company called Synergy Exhibition Services which provides facilities for putting on displays
and demonstrations at exhibitions for promotions purposes. Public hires them to conduct
exhibitions and a customer is provided with an exhibition only. This company has given me a job
20. Rupesh Chaulagain 160409 DB
20
to prepare a database which meets all the needs to its data. So, here I must design a database
which can be useful and effective to this company. To make the database we should have good
knowledge in Normalization, should know how make ER and then we should know to create
table and insert values in tables using SQL.
Understanding of requirements:
First of all, we must understand all the essential components to carry out this task. Here, I must
understand the scenario that I have been provided. Then, all the given tables given table should
to normalized to 3rd
normal form by removing functional dependency, partial dependency and
non-keys dependency. This is compulsory to remove data replication and to maintain data
integrity. The all the tables which are formed during normalization should be combine to form a
relation by looking the relationship between those data.
How the initial design attempted to meet the requirements:
Here, I have collected all the ideas and I am about to make a suitable database. The given data
is repeated and random. I must manage all the data properly and make different tables by the
concept of normalization. Normalization helps us to remove repeating data separates
functionally, partially dependent data. At last I have separated the non-keys values to make a
separate table. Here I have separated those types of data and formed many tables. Then, I
have related all the tables to each other by looking the data in the table. Also, I have made a ER
diagram in Visual paradigm using CROWS FEET. These diagram gives us the clear relation
between tables or data. Then, I have made data dictionary (table holding all the properties if
entity). From dictionary, we can know the nature of data. I have created the tables
Rupesh31_Staff_roll, Rupesh31_Customer, Rupesh31_Exhibition_type,
Rupesh31_Exhibition, Rupesh31_Staff, Rupesh31_Exhibition_Satff,
Rupesh31_Software_type, Rupesh31_Installation_type and inserted the all the data we are
provided with. Then I have selected and update some data. Here, my work is finished. Since,
this my first time to design a database I had tried my best for its completion. But there can be
some errors.
Conclusion:
By the process of normalization and making ER diagrams I could make an excellent data base
to the company. I could remove all the replication of data. From the database, I have made we
can easily retrieve, modify data. Here I have made relation between data. The work to make a
data base for Synergy Exhibition Services company is completed. Therefore, from this task we
can conclude that we can make data base for any one by using Normalization process, making
ER diagram and implementing it in SQL developer.
21. Rupesh Chaulagain 160409 DB
21
References
1. Anon, (2017). [online] Available at: https://connect.nccedu.com/NCCEdu/upload [Accessed 22
Apr. 2017].