Top Banner
INF1050- Databases In this module you will use Microsoft Access to create digital databases
29

INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Dec 26, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

INF1050- DatabasesIn this module you will use Microsoft

Access to create digital databases

Page 2: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

First Steps

1. Start Menu -> Programs -> Microsoft Office -> Access

2. Click on Blank database. Click OK3. Open the File button in the middle right. This

is where it will be saved. Call it lastname.firstname and save it in your Save Space. Click the Create button

Page 3: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

• You should have a screen that looks like this. Make sure that you select the Create tab, which is circled in red.

• Click the Table Design button that is right below the circled area.

Page 4: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

• Insert this data into the table as shown. You will also have to change the Field Size number (see arrow pointing to box)

• Change Field Sizes, in descending order, to: 5, 30, 30, 2, 30, 20, 2, 5, 2.

Page 5: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Next Steps

• When you have all of your information, go to File -> Save (not Save As).

• Save your table as ‘Employees’.• It will ask you if you want to create a Primary

Key. Say no.• Close the table

Page 6: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Create a Department Table

• Use the previous steps to create a new table

• Change the Field Size to 2 and 30, in descending order• Save this Table as ‘Departments’.

Page 7: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Open the Employees Table

Page 8: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Enter the Data As Shown

• Make sure all the data is visible (you may need to stretch the columns)

• Save your table• Close your Employees table

Page 9: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Open the Department table

• Include the following data in this table by switching back to the DataSheet view:

Page 10: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Adding a New Category

• Go to the Employee table and change to Design View• Right-click on the Hire Date row• Click on the Insert rows icon on the Table Design

toolbar and put in this new text:Field name = TelephoneData Type = TextField Size = 14Description= Employee Home Telephone Number• Save this change

Page 11: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

• Making sure your cursor is in the Telephone row, click below on Input Mask and click on The three black dots

Page 12: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Follow These Steps…

And then hit Finish

Page 13: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Go back to Datasheet view and enter:

Page 14: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Using the Lookup Wizard• Open the Employees table and change to Design View• Right-click and add in a new category at the top, Emp. Category. Click on

Data Type and select Lookup Wizard at the bottom

• Sorry, wrong table in picture

Page 15: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Follow These Steps

Then save

Page 16: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Go back to the Datasheet

• Notice that your 3 pay choices can be selected from drop-down boxes from a menu.• Recreate the boxes as shown• If necessary be sure to stretch out your column so that you can see all the words.

Page 17: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Moving Fields• We will move the Last Name field below the Middle Initial field• Click your mouse in the grey box to the left of the Last Name field• Click and drag it down until the line between Middle Initial and Street

Address is a solid black.

• Let go with the mouse, and it will move below into the order shown here:

Page 18: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Sorting Records

• Go back to the Employees table in Datasheet view• Click on the drop-down box under Last Name and select Sort

A to Z

Page 19: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Relationships Between Tables

• Create two new tables: a Clients table and a Claims table. Do not worry about the descriptions

Page 20: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Define the Primary Key1. Open the Clients table in Design view2. Select the “Client #” record and click your mouse in the grey box area to

the left. It should be highlighted in black3. Click on the Primary Key button. A key symbol should now be on your

Client# Row

Page 21: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Define the Primary Key3. Save this table4. Open the Claims table in Design View5. Select the “#Claims” record and add the primary key icon to it like you had done with the previous table. Save the table.

Page 22: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

The Relationship

• Click on the Relationship icon in the Database Tools tab

Page 23: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Add both Clients and Claims

Page 24: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Next StepsClick and drag the Client# into The bottom of the Claims box.

Check these 3 boxes

Then click “Create”. The two boxes will be linked together.

Page 25: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Seeing the Relationship (awwww)

• Hit the Plus + button to open the linked Claim table• Fill in the data you see here for the two tables:

Switch back to the Claims table and this info will now be in there

Page 26: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Congratulations!

You have now learned how to:

• Create tables and fill in data• Create fields• Create a Drop-Down menu using the Wizard• Use Design view and Data view• Show a relationship between two tables

• Please hand your activity into the INF1050 folder when you have completed it

Page 27: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Your Assignment

• You are the owner of a new auto repair shop, Super Mechanics

• You will need to develop a database that keeps track of customers, vehicles, services performed and parts. (It can also be any other sort of business you may be interested in)

• You could also do another business such as a clothing store or pet store

Page 28: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

You will need 4 Tables:

1. Customers- include last and first name, phone number, address, province and city

2. Service- repair description, service technician name, date of repair, total cost

3. Parts- parts used, cost of parts, serial number

4. Vehicle- make, model, colour, plate number

• If you are doing a different kind of store, use table 1 but make 3 other tables that fit with the kind of business it would be. Keep the customer table, though.

Page 29: INF1050- Databases In this module you will use Microsoft Access to create digital databases.

Next Steps

• You will have to create 2 or more relationships with the tables before you put in any information

• Create 15 entries (customers) for this assignment. You make have to do a bit of research if you are going to list certain products, brands and prices in your database