Download Databases Work sheet

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Name
Databases
A database stores data. It is made up of a number of records. One record stores data about one thing such as one
person, one patient, one stock item. Each record is made up of a number of fields. A field stores one item of data
about the thing. The person's surname, the stock item price. All the records in a particular file will be made up of
the same fields.
Files Records and Fields
A database is used in each of the following situations.
(1)
(2)
(3)
A computer shop stores details of what it has in stock so that it can automatically re-order items that
are running low.
A used car sale rooms uses a database to keep track of what cars it has so that it can find a car to
match a customers needs
A large factory keeps details about its employees to pay them each week
Each application will store data in a file. Use the words in Word List 1 to complete the sentences that describe
each of the three files.
WORD LIST 1 Employee
Application 1
The computer shop stores its data
in the stock file. One record in
this file is about one item of stock
car
File
Employee
Application 2
The car sale room stores its data in the
cars file. One record in this file is about
one __________
Application 3
The factory personnel department
stores data in the ___________
_______. One record in this file is
about one ___________
Use the words in word list 2 to fill in the field names for the records in the three files. Each word is used once
only
WORD LIST 2
Name
Description
Make
Minimum Quantity
Total Tax this Year
Price
Year
Price
Colour
Pay Rate
Date of Birth
Re-order Quantity
Stock Number
Registration Number
Model
Total Pay this Year
Tax Code
Engine Capacity
Number of Previous Owners
Supplier
Hours worked
Payroll Number
Number in Stock
Stock Record
Field 1
Car Record
Field 1
Employee Record
Field 1
Field 2
Field 2
Field 2
Field3
Field3
Field3
Field 4
Field 4
Field 4
Field 5
Field 5
Field 5
Field 6
Field 6
Field 6
Field 7
Field 7
Field 7
Field 8
Field 8
Here are some values for the fields for one item of stock in application 1. Write out the stock item field names
along the top of the table and write an appropriate value underneath each field name.
Laser Printer
6
1
3
5309
£920.00
Hewlett Packard
Field Name
Value
©2007 S McWeeney
81936480
Key Fields
One special field is called the key field. This is the field that uniquely identifies a record. No other record will
have the same value key field. Often the only way to achieve a unique value is to make something up. Account
number, catalogue number and stock number are examples of made up key fields.
Which is the Key?
What is the key field for each of the three records you have worked on over the page?
Stock Record key field _________________
Employee Record key field _______________
Car Record key field ___________________
Data Types
Different fields can hold different types of data. The type of data that a particular field will store is decided
when the database is designed. Some of the different types of data that can be stored are:
Text, Memo, Number, Date, Time, Yes/No
Text would be used to store data like name or address, any data made up of from 1 to a few hundred characters.
Memo is used for longer pieces of text or text that would take up several lines. An example might be Report
Comment in a pupil file.
Date and time fields are used to store dates and times.
A Yes/No field can store any data where there are only two possible values.
Video Library Example
A video library keeps details of its videos in a database. The database is used to produce catalogues of videos
where titles are listed alphabetically by title for each category. In the shop the database is used to allow
customers to look up to see if a particular title is in the shop or hired out. If the video is already hired out, the
database will show the date when it is due back. The customer can also see a written review of the video giving
some details of the plot and the stars. Each video has a bar code number but this cannot be used as a key field
because the shop has two or more copies of some videos. The shop makes up a stock number by adding an
extra digit to the end of the bar code. They put a 1 for their first copy, a 2 for the second and so on. The database
holds the bar code number and the stock number.
Complete the table below to show some of the fields that would be needed and what data type should be used.
Try to give some typical values for each field. You can use the description below.
The video Forrest Gump has a bar code 5 014437 29225. It is category 12 and this is copy number 3 that the
shop has. This copy is on loan and is due back the day after tomorrow. Forest Gump stars Tom Hanks as the
simple person full of honest integrity who becomes part of the momentous events of the 20th century.
Field Name
©2007 S McWeeney
Data Type
Typical data
81936480