MS Access Lab Exercise
MS Access Lab Exercise
MGT 186
Relational Database System using MS Access
This exercise is for you to practice using MS Access in the lab, and to provide you
with help as to how to work with access. In many regards, it is similar to your for-
grade project. The goal withthis project is to learn how to create and use an MS
Access database, not to rush through the exercise.
There should be a table of customers who are Customers of the salespersons, the
CUSTOMER
table. It should be made up of the following fields:
PART II STEP BY STEP, CREATING THE SALESPERSON TABLE
1. First open up MS Access. Click in the Create a New Database boxs use a Blank
Database. Then click OK.
2. Youll be asked to save the new database. Down below, click in the File name
box, and call this Employee.mdb. Remember this database will have two tables.
Click Create.
3. The blank database will be presented. The Tables tab will already be selected
for you. Note that you cant select anything but New on the right. Click on it.
4. A new dialog box is opened. Click on Design View, and then OK. You will do this
for both tables.
5. Now youll start setting up your table. In the Field Name column, give the field its
identifying name. You may use the suggested field names above. Then use the Tab
key to tab over to the Data Type. When you do, a drop-down arrow will be
displayed, as well as the default of
Text.
6. Once you do this, the General tab under Field Properties below will be
selected. It is here that you give the field its properties, such as field width, the >
sign in Format for the Office and State fields, which makes them uppercase, and you
create the Validation Rule and
Validation Text, as described in the previous class session.
7. Go ahead and complete all the fields. When youre done with each table, before
you leave
Design View, you will need to set up the Primary Key before you go to Datasheet
View. (Actually, you need to do this before formatting the input mask for the SSN as
a Social
Security Number)
_ to do this, place your cursor anywhere on the row containing the field to be
designated as the Primary Key.
_ now click on the little key icon on the standard tool bar. The Primary Key will
be assigned.
8. Now click on the Datasheet view icon. Youll be prompted to save the table. Call it
Salesperson and click OK. After the save is complete, the Datasheet view will be
displayed.
9. Now enter in all of your data for the Salesperson Table. Enter about 6 records.
1. Now that you have created the Salesperson Table, and entered the data, youre
ready to create the Customer Table.
2. Following Steps 1 through 9 in PART II, create the Customer Table and enter the
data, using the same steps for corresponding fields.
3. MAKE SURE THAT THE CUSTOMER RECORDS CONTAIN SALESPERSON ID#s
WHICH EXIST IN THE SALESPERSON TABLE.
4. Enter about 5 records.
Follow each step in the wizard process to complete your report. At the end of the
process, youll be prompted to give the report a name. Do that, and click Finish.
The report will be previewed for you. After previewing it, you may exit the report. If
you were to print it, you would click on the Print icon.
Dont forget to Turn in your lab activity to our Google Classroom to avoid late
submission.
Activity No. 2
Overview
This another lab activity will introduce you to database concepts using Microsoft Access.
Run MS Access
name it "DEPARTMENT"
Double-click on "DEPARTMENT"
Fill in the following data, using tab to move from one cell to the next
Click and drag from "DEPT ID" in dept table to "DEPT" in faculty table.
Insert the following data into the faculty table -- notice that each faculty entry has a dept
that corresponds to an existing dept entry
FAC ID LAST NAME FIRST NAME DEPT BDATE RANK HIRE DATE
00303 SMITH JOE CSC 09/23/1965 ASST 01/23/1998
00322 JONES ALICE MTH 03/11/1972 ASST 12/23/2001
00223 FRIDAY JENNIFER ENG 12/12/1970 ASSOC 08/02/1994
00332 LANE LANCE CSC 06/02/1959 FULL 01/01/1995
00433 JUNIPER LUCY MTH 03/21/1965 ASSOC 03/03/1998
On the University:Database window, click on the Queries option (left side column)
Icons for both tables will appear in the top part of the query
In the fourth Field: box, choose DEPT.DEPT ID. In the Criteria: box, type
= "CSC". This will only choose those rows where the DEPT ID = "CSC".
Note that the two tables are automatically linked by DEPT ID because of
the relationship that was set up above. Double-click on the link between
the tables to see the properties of the Join. You will see that the default is
to "Only include rows where the joined fields from both tables are equal".
This means that the query will only show results where the DEPT ID is the
same in both tables.
Create a relationship from the student's department (MAJOR) to the department table
Create a relationship from the student's advisor (FAC ID) to the faculty table
Challenge Problem:
Add another table representing classes. The fields should include at least the class
code, the name of the class, the number of students taking the class, the semester the
class is offered, the department offering the class and the faculty teaching the class.
Link the classes to department (providing the class) and faculty (teaching the class).
1. List the names of all classes offered by the Computer Science department.
2. List the faculty members teaching classes with more than 50 students.
Dont forget to Turn in your lab activity to our Google Classroom to avoid late
submission.