You are on page 1of 9

Shailen Patel 4NJDH

Year 9 Database Exercise


The aim of this exercise is to create a database of cars. This database may be searched to provide answers to questions about cars in general or about cars that someone might want to buy. Make a new folder for your work on this project inside your ICT folder called cars.

1. Identify the type of cars that you will include in your database
Think about what cars you find interesting or those that you think it would be useful to have in a database.

Limos
F1 cars

2. Identify the questions you want to answer


Write down up to ten questions that someone might ask about cars. Examples: Find the most expensive car. Find all cars that are ??? Find the most expensive car Find the car with the biggest engine Find the largest car When the car was built Find all black cars List all cars that go over 150 mph

Shailen Patel 4NJDH

Extension
Add five questions that involve more than one condition linked by AND, OR or NOT. Examples: List all cars that are made by BMW AND cost more than 50 000 List all cars that do over 200 mph OR have an engine over 3.5l List all cars made by Bentley OR Mercedes AND are over 75 000 List all cars made by ???? that are NOT ???.

Shailen Patel 4NJDH

3. Identify items of information


What items of information about cars would you need to have in order to answer all of your questions? Work carefully through the list of questions and write down the information needed for each question. (Dont write an item more than once.) Give a reason for including this item of information in the list.

Field
Make Model Price Speed Engine size Safety Country produced in

Reason for inclusion


All uses want to know the make To distinguish cars between makes Essential for buyers wanting to buy a car Some cars are used for different purposes sport cars speed is essential Larger engines need more petrol - costly Important especially if you have small children Some countries make more reliable cars e.g. Germany

Note that in a database the single items of information are called fields.

Shailen Patel 4NJDH

4. Outputs from the Database


What media will be used to display the outputs? There are two main ones: a. screen b. Printer

Note that there are practical limits to the amount of information that you can show to someone. How many of the fields you defined above could you fit onto a sheet of A4 in portrait orientation? What form will outputs from your database take? There are four main ones: a. Table or list b. chart c. report d. picture Comment on the presentational requirements of output from a database (font face, font size, organisation of information). Easy to read large font, clear font In what ways can you sort the data in your outputs? Alphabetically or numerically

Why would you want output to be sorted? Easy to access How is output sorted when it is output? Name Price

Shailen Patel 4NJDH

5. Identify Possible Sources of Information


What possible sources of information could you use to answer questions about cars? List at least four different types of source. a. Internet b. Magazines c. Books d. TV/ Adverts

6. Choose a unique identifier for each car in the database


Each car in your database will be a single record in the database. A record is a group of data items that are related. In a database each record must have some way of making it unique. What features do cars have such that each one can be uniquely identified? a. Number plate (second hand cars only) b. Chasis number or engine number c. It will be difficult to obtain this information for your database so we will use a simple number: 1, 2, 3 In Access this is called an autonumber and it is added automatically.

Why is it important to have a unique identifier for every record in a database?


Records need to appear only once Note that the unique identifier is called a primary key.

Shailen Patel 4NJDH

7. Define the Database with a Data Dictionary


Use the data capture form to define a data dictionary for the database. This will be a table with columns for: field name, data type, field length, validation. Complete the data dictionary below: Field Name ID Make Model Price Top Speed SatNav Year of manufacture Engine size Colour/Design Where is made Safety Field Type Auto number Text Text Currency Number Yes/No Number Text Text Number Field Length N/A 15 10 7 3 N/A Validation rule Primary key

Shailen Patel 4NJDH

8. Set Up the Database in Access


Now you know the details of your database you can set it up in Access. Create a new database in Access and save it in the folder for this project. Make sure that you are in Design view in Access. Field type: this includes text, number, Yes/No, date/time, currency. Field length: Work out the maximum length required for text fields from the data on your data capture form (round up to the nearest 5 or 10). Keep the length to a minimum so the field will fit onto the screen or sheet of paper. Field type: Specify the type of number required, again based on the data capture form. Types include integer, real/fractions and currency. Specify the number of decimal places required. Zero decimal places for currency is most likely on big prices like cars. The Yes/No data type can be used for data which is either one thing or another. Some fields can be put into drop-down lists e.g. Transmission Some fields may appear to be numbers but are actually text: phone numbers, years. You are unlikely to include complete dates (often used for a date of birth) or times. Validation rules: these define the range of values that a field can take. They can also be used to force the user to enter data (required). They are easy to define for numeric variables e.g. price: between 1 and 100,000. Add your own message in the properties section: this is very important. You must have at least two validation rules in your database. Use the =, > and < symbols. If you think that a field must contain data then set it to Required = Yes. (You do not have to fill every row. The number of fields in your database depends on how you framed your questions earlier.) Save your table with a suitable name such as cars.

9. Collect Data
Use some of the data sources that you identified earlier. Enter your car data on the data capture form. Collect data on at least 20 cars. You may find it necessary to use more than one source to complete the data for each car. List the sources that you used here:

Shailen Patel 4NJDH

10. Check for Errors


Ask your neighbour to look over your data in Access, checking carefully for errors. Make sure that any errors in your data have been corrected.

11. Define queries to answer the questions specified in step 2


Use the QBE editor to set up the queries: Create/Query. Specify fields to be output, search criteria and sort order. Note that criteria on the same row perform AND operations while those on different rows perform OR operations. Save each query as you make it. Write a sub-heading for each query. Show a screen shot of each query in QBE. Crop the screen shot and enlarge it so that the QBE part is easy to read. Show a screen shot of the output from each query. Place screen shots here.

Shailen Patel 4NJDH

Extensions
12. Add complex queries using AND, OR and NOT
You may have added these in the extension section of step 2. Show details of your queries in screen shots here.

13. Add a picture field


Go into design view in Access and add a new field called picture. Set the field type to OLE Object.

14. Create a Form


In Access choose Create/Form to add a form based on the table you have created. Switch to Design view to make adjustments, for example to make the picture field bigger. Add a screen shot of your form in design view.

15. Add pictures to the records


Select images of your cars from web pages. Paste each image into Photoshop and use crop and resize to make each image a maximum size of 200 x 180 pixels. Adjust the size of the picture field in the form to contain your images without cropping. Copy and paste the images into the form. Add two screen shots of your form showing pictures.

16. Create a chart from the database


Se Create/Pivot chart. Put something like make or model on the bottom (X) axis and something like minimum mileage or maximum price on the top (Y) axis. Add a screen shot of the chart output here.

17. Create a Report from a query


Choose Create/Report and use the wizard to create output formatted as a report. Use design view to add a title and change the font. Add a screen shot of the output here.

18. Add buttons to the Form


Open the form and select Design View. Make space on the form by dragging the borders downwards. Use Design/Button to add buttons that do actions like: next record, previous record, new record, print record, run query.

You might also like