Sunteți pe pagina 1din 10

Assessment D

In this unit I am going to create a database to store a given set of data and extract
useful information. The dataset I have been given is called tickets and is in a CVS file
format.

As you can see this data is difficult to interpret. As a result of this imported it into
Microsoft Excel so it was easier to read and analyze.

The next step was to look at the row headings and decide how I can split them up
into different tables. A table stores information on an object.
These are the row headings from the dataset
Adam Bullock – 8035 Page |1
19319
 Order Number Temp
 Title
 First Name
 Last Name
 Address Line 1
 Town
 County
 Post code
 Card Type
 Card Number
 Expiry Date
 Start Date

I have created a data dictionary to help me sort out which attributes/field names go
with which table/entity. I have also defined the type of data, field length and
validation(s).

Entity Name Attribute Data Type Field Validation Description


Length

Performance Order Number Number 5 - Primary key


temp Required? No
Performance Text field 23 Lookup "Blood
Name wizard Brothers";"Chicago";"Chitty
Chitty Bang
Bang";"Evita";"Guys and
Dolls";"Jack and the
Beanstalk";"Les
Miserables";"Mamma
Mia";"Phantom of the
Opera";"Sound of
Music";"South Pacific";"We
will Rock You"
Required? Yes
Performance Date/Time 16 Required? Yes
Date
Performance Text 1 Lookup "E";"M"
Type wizard
Required? Yes
Number of Text 10 Validation <7
Tickets rule
Required? Yes
End Date Date/Time 16 Required? No
Cost of Seats Text 6 Required? No

Adam Bullock – 8035 Page |2


19319
Customer Order Number Number 5 - Foreign key
temp Required? No
Title Text Field 4 Lookup "Mrs";"Miss";"Mr";"Ms"
wizard
Required? Yes
First Name Text Field 25 Required? Yes
Last Name Text Field 25 Required? Yes
Address Line 1 Text Field 25 Required? Yes
Town Text Field 16 Required? No
County Text Field 16 Required? Yes
Post Code Text Field 7 Input mask LL09#0LL
Validation Incorrect Post Code
Text
Required? Yes
Card Type Text Field 16 Required? Yes
Card Number Text Field 12 Required? Yes
Expiry Date Date/Time 16 Required? Yes
Start Date Date/Time 16 Required? No

I have created this data dictionary so that if i was going to get someone else to
create my database for me they would be able to do the entity tables with only this
one sheet.

Below I have explained what some of the above terminology is.

o Data types - are there to help the database programme understand what
types of it is dealing with.
o Field length – is there to limit the number of characters that the user can
enter into the data field.
o Validation – is there to prevent the wrong data from being entered.
 Validation type; Required – this means that the field that the user in
must be filled out with the correct information.
 Validation type; Lookup wizard – is so that the user can choose from
a preset range of data, so by choosing one of the given options they
are not entering incorrect data. E.g. the ‘title’ of a person; mr, mrs,
etc.
 Validation type; Validation text – is what is displayed if the user
enters the wrong information.
 Validation type; Input mask – to prevent the wrong data from being
entered. E.g a post code.

Adam Bullock – 8035 Page |3


19319
The table below is showing the symbols and explanations for the input mask
that I have used for the post code.

Symbol Description
0 Digit 0-9 (required)
9 Digit 0-9 (optional)
# Digit or spaces
L Letter A-Z(required)
? Letter A-Z (optional)
> Make following characters uppercase
A Letter or digit (required)
A Letter or digit (optional)
& Any character or space (required)
C Any character or space (optional)
< Make following characters lowercase

For the post code I used the input mask of LL09#0LL

ERD – Entity Relationship Diagram


In order for these two to work together in a relational database a relationship
between the tables has to exist. This is done by identifying a primary key field (order
number temp from the performance table) and putting this field in the customer
table. In the customer table it is called a foreign key. This can be represented
graphically.

Order Customer

This is a one too many relationship. Below are the screenshot showing me setting up
the relationship.

Adam Bullock – 8035 Page |4


19319
The screenshot on the right
shows me setting up the
relational database. This is
stage one – viewing the
different table

The screenshot on the left


shows me connecting the two
tables together into a
relational database.

The screenshot on the right


shows me again setting up the
relational database; the step
shown on the right is the final
step.

Adam Bullock – 8035 Page |5


19319
Creating the Database
To get all of the information that i was supplied in the dataset into Microsoft access
to create my database I had to first split up the ‘tickets’ CSV into two different tables,
performance and order.

This screenshot shows the tickets information in Excel, I had to copy and paste the
information into two different tables, customer and order. This screen shot shows
the customer table, all the information relevant to the customer, name and address
etc.

This screenshot shows the order table for my tickets data. All of the information for
the performance is listed here, performance name, time etc.

Adam Bullock – 8035 Page |6


19319
After I had decided all of this, I had to import this data into Microsoft Access. The
screenshots below show the steps I took to import the data.

This screenshot shows me


selecting the excel file that
needed importing into access.

This screenshot shows me


selecting which sheet of the
excel document I want to
import into Microsoft access.
For this import I chose the
customer sheet.

Adam Bullock – 8035 Page |7


19319
This screenshot shows the next
step of the import. In most
excel documents the first word
in the top column are usually
the column headers. This is
access asking me if I would
like to keep the top row cells
as the column names.

This next screen shot is of the


import wizard asking if I
would like to import the excel
sheet into a new table or an
existing table. As I do not have
an existing table I have to put
the data into a new one.

Adam Bullock – 8035 Page |8


19319
This screenshot shows me
setting the table to have no
primary key for the time being.

Adam Bullock – 8035 Page |9


19319
This shot shows me naming
the table tblCustomer and
clicking to finish the import of
this excel sheet.

Adam Bullock – 8035 P a g e | 10


19319

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