Lab 9 Access PreLab Copy the prelab folder, Lab09 PreLab9_Access_intro



Similar documents
Introduction to Microsoft Access 2013

Introduction to Microsoft Access 2010

Introduction to Microsoft Access 2007

Creating a Database in Access

MS Access Lab 2. Topic: Tables

Check out our website!

Access Queries (Office 2003)

Microsoft Access 2000

Chapter 5. Microsoft Access

How to set up a database in Microsoft Access

Introduction to Microsoft Access 2003

MICROSOFT ACCESS 2003 TUTORIAL

Microsoft Access 3: Understanding and Creating Queries

Microsoft Access 2007 Module 1

Database File. Table. Field. Datatype. Value. Department of Computer and Mathematical Sciences

Unit 10: Microsoft Access Queries

Sample- for evaluation only. Introductory Access. TeachUcomp, Inc. A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc.

Microsoft Access 2010 Part 1: Introduction to Access

Simple Invoicing Desktop Database with MS Access c 2015 by David W. Gerbing School of Business Administration Portland State University

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Click to create a query in Design View. and click the Query Design button in the Queries group to create a new table in Design View.

MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt

Microsoft Access XP Session 1 Week 8

Computer Science 125. Microsoft Access Project

How to Concatenate Cells in Microsoft Access

Lab 2: MS ACCESS Tables

How To Understand The Basic Concepts Of A Database And Data Science

Creating tables in Microsoft Access 2007

Microsoft Access 2007 Introduction

Access 2010 Intermediate Skills

Using Microsoft Access Databases

IN THIS PROJECT, YOU LEARN HOW TO

ECDL. European Computer Driving Licence. Database Software BCS ITQ Level 1. Syllabus Version 1.0

INTRODUCTION TO DATABASES USING MICROSOFT ACCESS

Introduction to Microsoft Office Access 2010

Microsoft Access Creating Filters and Tables

Creating and Using Databases with Microsoft Access

Microsoft Access Introduction

Introduction to Microsoft Access

Filter by Selection button. Displays records by degree to which they match the selected record. Click to view advanced filtering options

Microsoft Using an Existing Database Amarillo College Revision Date: July 30, 2008

Steps to Create a Database

Microsoft Access 2010

Access 2010: Creating Queries Table of Contents INTRODUCTION TO QUERIES... 2 QUERY JOINS... 2 INNER JOINS... 3 OUTER JOINS...

MICROSOFT ACCESS STEP BY STEP GUIDE

Excel Templates. & Quote/Invoice Maker for ACT! Another efficient and affordable ACT! Add-On by V

Creating a Database using Access 2007

Microsoft Access Basics

COURSE DESCRIPTION. Queries in Microsoft Access. This course is designed for users with a to create queries in Microsoft Access.

The column containing phone numbers is a field

General User/Technical Guide for Microsoft Access

Microsoft Access 2010 Overview of Basics

MICROSOFT ACCESS A. CREATING A DATABASE B. CREATING TABLES IN A DATABASE


A database is a collection of data organised in a manner that allows access, retrieval, and use of that data.

Use Find & Replace Commands under Home tab to search and replace data.

Microsoft Access Part I (Database Design Basics) ShortCourse Handout

IST 195 Lab 11: MS Access

INTRODUCTION TO MICROSOFT ACCESS Tables, Queries, Forms & Reports

Using Microsoft Access

Access Creating Databases - Fundamentals

What is a database? The parts of an Access database

Create a New Database in Access 2010

Microsoft Access 2010 handout

Aeries Student Information System Attendance Notes October 3, 2008

Pharmacy Affairs Branch. Website Database Downloads PUBLIC ACCESS GUIDE

Excel Database Management Microsoft Excel 2003

Access II 2007 Workshop

Lab Manual. Databases. Microsoft Access. Peeking into Computer Science Access Lab manual

European Computer Driving Licence

Databases in Microsoft Access David M. Marcovitz, Ph.D.

Microsoft Access 2010: Basics & Database Fundamentals

Creating Database Tables in Microsoft SQL Server

Creating QBE Queries in Microsoft SQL Server

Crystal Reports Payroll Exercise

ProperSync 1.3 User Manual. Rev 1.2

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

Learn how to create web enabled (browser) forms in InfoPath 2013 and publish them in SharePoint InfoPath 2013 Web Enabled (Browser) forms

BID2WIN Workshop. Advanced Report Writing

Microsoft Access 2003 Module 1

Note: With v3.2, the DocuSign Fetch application was renamed DocuSign Retrieve.

Database Applications Microsoft Access

Using an Access Database

Google Apps for Sharing Folders and Collecting Assignments

Ken Goldberg Database Lab Notes. There are three types of relationships: One-to-One (1:1) One-to-Many (1:N) Many-to-Many (M:N).

Document Cycle Tracking Service User Guide

Word 2007: Mail Merge Learning Guide

Microsoft Office. Mail Merge in Microsoft Word

Access Part 2 - Design

User Services. Intermediate Microsoft Access. Use the new Microsoft Access. Getting Help. Instructors OBJECTIVES. July 2009

Access Tutorial 1 Creating a Database. Microsoft Office 2013 Enhanced

TheEducationEdge. Export Guide

ACCESS 2007 BASICS. Best Practices in MS Access. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Advanced BIAR Participant Guide

Querying a Database Using the Select Query Window

To launch the Microsoft Excel program, locate the Microsoft Excel icon, and double click.

Transcription:

Lab 9 Access PreLab Copy the prelab folder, Lab09 PreLab9_Access_intro, to your M: drive. To do the second part of the prelab, you will need to have available a database from that folder. Creating a new Database with a Table: 1. Launch Microsoft Access: Windows Start Button > All Programs > Microsoft Office 2013> Access 2013. You should get a screen like below: select Blank desktop database (if not already selected) In the current window, under File Name, rename your database to MyPhoneBook and press on the folder button next to the name to save your database somewhere under your CS130 folder, (preferably in this PreLab folder.) Finally, press on the Create button 2. The first screen capture below shows what Access should display after creating the database. This screen allows you to create a new table in the database by inserting data directly which is not very convenient. This is called the Datasheet View. On the left-side, press on the View button and select the Design View instead. Access will ask you to rename your table; name your table Phonebook and press OK.

3. Once you do that, you ll end up with the screen above. Under column Field Name, you should include the name of each of your table columns with the corresponding data type specified under column Data Type. The properties for each of your columns can be modified by selecting the desired column under Field Name and changing the properties at the bottom of the page under Field Properties. 4. Every table needs to have a key field which has a unique value for each record. Access inserts a default field named ID as that key field when you create a table. For your database, change the name of the key field to ContactID and leave the data type set to AutoNumber, which will give each record a unique identifying number. 5. Now add the fields (or columns) listed below, along with the desired properties for each, to your Phonebook Access table. ContactName of type Short Text. In the properties window, change the Required property to Yes. PhoneNumber of type Short Text. In the properties window, change the Required property to Yes. Now put your mouse cursor inside the Input Mask property, press on the button at the end of Input Mask property (access will ask you to save the table so select Yes) and select the Phone Number mask. Change the Placeholder character to the pound symbol, #, and then the mask should look like (###) ###-####, where the # is a placeholder for integer numbers. Check the option box to store the data with the symbols in the mask and then click Finish. Address of type Short Text. City of type Short Text. In the properties window, change the Default Value property to Saint Cloud. State of type Short Text. In the properties window, change the Default Value property to MN. Zip of type Short Text. Follow the steps used in the PhoneNumber field but now use the Zip Code mask instead. Email of type Short Text. AnnualIncome of type Number. In the properties window, change the Field Size property to Double and the Format property to currency. BirthDate of type Date/Time. For this field, we want to limit phone numbers to people older than 16 years old; in the properties window, change the Validation Rule property to <#1/1/1998# and the Validation Text to Too young to have a phone number!

6. Save the database and press on the View button (on the left-side) to switch back to the Datasheet View. Input at least 5 rows into your table and observe how Access enforces the properties you set for your fields. Make sure you try sample records that are not consistent with the properties in your table definition. 7. When done, save your work and close Access. Working with an Existing Database 1. Inside this PreLab folder, you ll find an Access database called CleanGargoyles.accdb. Double-click on it. This is a sample database that contains a number of tables (Tables are listed under All Access Objects on the left). In addition, it contains many sample queries (Queries are also listed under All Access Objects on the left). 2. To create a new Select query, press on the Create tab at the very top of your Access window and press on the Query Design button in the Queries area. Next, select the desired table(s) and press Add. When done adding table, press Close. The following screen capture shows you what Access displays if you only select the Employee table: 3. In order to retrieve the desired data from table Employee, we need to specify our criteria in the query window at the bottom of the screen. Here are some guidelines: Field: Press on the drop-down menu to select the table fields that you want to use in your query. Each included field must appear under a separate column. Table: Specify which tables the fields will come from. Access should complete this one for you. Sort: Specify whether output should be sorted on this field (if so, choices are Ascending and Descending) Show: Check all the fields that should be included in the output of the query. Criteria: Specify your selection conditions for each field separately. Or: Use this to specify an OR of conditions on different fields. Here is a first example: The following query displays the LastName, FirstName and Department for all employees who work in the Management or Sales departments. Output is sorted first by FirstName in ascending order and then on department in descending order.

And here is a second example: The following query displays the LastName, FirstName, Salary, Department and FullTime status for all employees who either work in the Management or are fulltime employees. Output is sorted by LastName in ascending order.

4. To run a query, press on the Run button next to the View button in the upper left corner of your screen. Access will then display the result of your query in table format. You can go back to the query Design View by selecting this option from the View button. 5. Some notes: Derived fields: In the field row, we are not limited to only fields from our tables. We can easily derive new ones using arithmetic expressions or String concatenations (VB syntax style). For example, to display the full name of an employee formatted as Last name, first name we can write the following expression into one of the field columns: Full Name: [LastName] & ", " & [FirstName] We need to specify the name of the derived field before the colon and then enclose any of the used table fields between square brackets. As in VB, & can be used to concatenate strings. Parameter queries: For queries that require input from the user we can specify a message inside square brackets in the criteria row of the desired field. For example, [Enter a department name] in the criteria for field Department will display an input box for the user with the prompt Enter a department name and will then use the value input by the user as a search criteria to find employees working in a matching department. Approximate string matching: Access has two special characters: the? (question mark) character which stands for any single characters and the * (asterisk) character which stands for any number of characters (i.e. 0 or more characters). Those special characters can be used to search for strings/text fields that approximately match your search criteria. They should appear inside double quotes preceded by the LIKE operator. For example: - To find employees whose first names start with the letter A, we can write the following criteria under field FirstName: LIKE A* - To find employees whose first name contain the letter A as a second letter, we can write the following instead: like?a* Date functions: - The Year(datefield) function extracts the year portion of a given date field - The Month(datefield) function extracts the month portion (a value between 1 and 12) of a given date field - The Day(datefield) function extracts the day portion (a value between 1 and 31) of a given date field - The Now() function can be used to get the current date and time. This is very useful in search criteria that are based on today s date such Find students who are older than 20 years as of today. In order to find rows matching this criteria, we need to utilize Access s current date and time via the Now() function (otherwise we will have to change the condition every day we run the query). To be older than 20 years as of today, the student s birth date field must satisfy the following criteria: < Now() 20*365 (where 20 is the number of years and 365 is number of days per year Access uses days when applying arithmetic operators to dates) 6. In the remainder of this pre-lab, you will create, test and save the following queries: Use table Employees to retrieve the last name and first name for employees who work for either the Management or Sales departments sorted by department. Save your query as Access_PreLab9_Q1. Use table Employees to retrieve the last names for employees who are either fulltime or who earn more than $20000. Save your query as Access_PreLab9_Q2. Use table Employees to retrieve the last and first names for employees who work for departments with last names ending with the letter g. Save your query as Access_PreLab9_Q3. PS: Use Like operator with an * Use table Employees to retrieve names of employees working for a department whose name is input by the user. Save your query as Access_PreLab9_Q4. PS: This is a parameter query

Use table Purchase Orders to retrieve the purchase order number, item number and order date for orders made more than 2 years ago. Save your query as Access_PreLab9_Q5. PS: Use Now() function