Lab 6: Querying a Database

Total Page:16

File Type:pdf, Size:1020Kb

Lab 6: Querying a Database

Lab 6: Querying a Database 45 points

In this lab you will be learning how to construct queries that retrieve information from a database. In particular, you will be using a query language based on Query By Example, a popular example-based query language developed by IBM.

1. Execute the tutorial on pages AC3.4 – AC3.35 of your lab manual for Access. Be sure to collect the printouts of your query datasheets produced during the tutorial. When printing, go to Page Setup and change the left and right margins to .5 inches. Then use Print preview to make sure the file will print on just 2 pages, not 4.

2. Copy the database GymPersonnelRecords from the server to your diskette. The database contains two tables. You are going to formulate your own queries that retrieve data from the tables Employees and Location/Position. In each case, SAVE the query as the boldfaced file name preceding the colon with your last name (for example, as Q1smith or Q2smith) and AFTER saving the query with the appropriate name, print the table of data retrieved by the query (i.e., the data subset or dynaset). [HINT – Drag or double click fieldnames in QBE grid.]

A. Q0: Show all information for anyone named Jeff.

B. Q1: Display all first and last name, location and salary of all employees who made less than $12,000 sorted from highest to lowest salary.

C. Q2: Show first and last name, job title and location for anyone named Lisa or Jill.

D. Q3: Display last name, birth date and job title of anyone younger than 18.

E. Q4: Display the first and last name, hire date, and job title for those in child care positions.

F. Q5: Display just the last name and job title of everyone who works in Forest Island sorted alphabetically by job title.

G. Q6: Display the last name, job title and location of those who live in Iona and work in Fort Myers or Forest Island, sorted by location.

H. Q7: Display the last name and salary of all Cypress Lake employees who made between $15000 and $25000 in descending order by salary.

I. Q8: Display the co-owners’ names and anyone who makes more than they do. What to turn in

Printouts and disk of the query data subsets produced during the tutorial and printouts of the query data subsets produced on the GymPersonnelRecords database.

Recommended publications