AccessLab_Queries - Instructions for the Access Lab Session...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Instructions for the Access Lab Session: Queries and Expressions Download database lab 2 from the course material folder of WebCourses being sure to save it to the local machine.   On a separate sheet you are provided with the   relationship screen and data found in each table.  Create the following queries.   1. Query concepts: single table queries---selection and criteria and parameters single table queries---selection and criteria and parameters a. Qry1A: List customers ordering 5 or more of any item (include item description and quantity sold with the customer's name.  Sort in descending order according  to quantity sold. b. Qry1B: List each salesperson's name and the total number of item each has sold (hint: use view/totals to add a "Total" row and select Sum on Quantity) Sort in  ascending order by name and descending order on Total Quantity Sold. 2. Query concepts: outer joins/unmatched queries AND using the Is Null criteria function (watch demonstration) a. Qry2A: are their zip codes in the database that no customer lives in? Qry2A: are their zip codes in the database that no customer lives in? b. Qry2B: Find out if there is a customer in the database that has not bought anything. Qry2B: Find out if there is a customer in the database that has not bought anything. c. Qry2C: Find out if there is a product that has not been involved in a sale. Qry2C: Find out if there is a product that has not been involved in a sale. 3. Query concepts: expressions a. Qry3A: List all male customers with their names(concatenated) and ages. [Concatenation of two text fields involves stringing the data in these fields together  by creating a new column in the query.—see below)  To calculate the age of the person you need to use an expression.  The field in the customer table includes  only the year of birth—the easiest way to do this is to put in the “current year” and subtract the “year of birth.”  However, this approach is NOT as flexible  because the “current year” would not change as time goes by.  A better approach would be to use the  DatePart  function in Access to determine the year of the  current date.  The syntax of this using this function is as follows:   CurrentYear: DatePart(“yyyy”, Now())   “Now()” is a function that returns the  current machine date---and then DatePart only shows the portion of the date the designer requests---in this case the four digit year.  For other options look up  DatePart in the user help.   b.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern