MASSACHUSETTS INSTITUTE OF TECHNOLOGY Sloan School of Management

Similar documents
Microsoft Access Illustrated. Unit B: Building and Using Queries

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access

Microsoft Office Illustrated Introductory, Building and Using Queries

Database Tables Lookup Wizard Relationships Forms Subforms Queries Reports

Introduction to Microsoft Access 2016

STIDistrict Query (Basic)

Microsoft Access 2010

Getting started with Ms Access Getting Started. Primary Key Composite Key Foreign Key

Microsoft Access 2013

Microsoft Access 2013

VS2010 C# Programming - DB intro 1

My Query Builder Function

MS Access Let s begin by looking at the toolbar and menu of Access.

Englische Access 2016-Trainingsskripte für IT Seminare und EDV Schulungen als Word-Dokument zum Ausdrucken und fürs Intranet

Database. Ed Milne. Theme An introduction to databases Using the Base component of LibreOffice

Objective 1: Familiarize yourself with basic database terms and definitions. Objective 2: Familiarize yourself with the Access environment.

Simple Invoicing Desktop Database with MS Access 2013/2016. David W. Gerbing School of Business Administration Portland State University

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

Access Objects. Tables Queries Forms Reports Relationships

SEE GRADING CRITERIA AT THE BOTTOM. Database Tables Lookup Wizard Relationships Forms Queries Reports

SOFTWARE SKILLS BUILDERS

What is a database? Lesson - 1

MIS Cases: Decision Making With Application Software, Second Edition. Database Glossary

Links to Activities ACTIVITY 4.1. Links to Activities Links to Activities

DATABASE MANAGERS. Basic database queries. Open the file Pfizer vs FDA.mdb, then double click to open the table Pfizer payments.

Microsoft Certified Application Specialist Exam Objectives Map

Table of Contents COURSE OVERVIEW... 5

MICROSOFT OFFICE ACCESS 2003 PRESENTING & MANAGING DATA

Databases II: Microsoft Access

What is a database? A database is any collection of data that is organized for quick retrieval. Databases can be computer based or paper based

Microsoft Access 5: Reports & Other Useful Functions

Full file at

Excel Tables & PivotTables

STOP DROWNING IN DATA. START MAKING SENSE! An Introduction To SQLite Databases. (Data for this tutorial at

Access Intermediate

Links to Activities ACTIVITY 3.1. Links to Activities ACTIVITY 3.

Using Microsoft Access

PowerScheduler Course Tally Worksheet instructions.

Access Intermediate

Relational Databases

Microsoft Access 2007 Module 2

Step 1: Create a totals query to show the total cost price and total sale price of the wine for each supplier.

Office Applications II Lesson Objectives

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Introduction to Computer Applications. CISY 1225 Chapter 10. Zahoor Khan, PhD

Let s create another simple report from one of our queries available: Author Age query.

Level 6 Relational Database Unit 3 Relational Database Development Environment National Council for Vocational Awards C30147 RELATIONAL DATABASE

Using Microsoft Access

COMM 391. Objectives. Introduction to Microsoft Access. What is in an Access database file? Introduction to Microsoft Access 2010

Group Administrator. ebills csv file formatting by class level. User Guide

Advanced Queries: Moving Beyond the Select Query Instructor: Edwin V. Bonilla

Index. B backing up 76 7

Create and Modify Queries 7

Unit 2: Managing Views

What s New in Access 2007

Microsoft Office Access 2013: Part 01. Lesson 01 - Getting Started with Access

MINI-EXERCISE. I. Develop your relational model below. College of Business Administration. Page 1. Figure 1: ER diagram for exercise. Title.

DATABASES 1.0 INTRODUCTION 1.1 OBJECTIVES

Access 2003 Introduction

Exporting your Address Book from Despatch Manager Online & importing it into Click & Drop

PowerPoint Presentation to Accompany GO! All In One. Chapter 13

เพ มภาพตามเน อหาของแต ละบท. MS-Access. by Asst. Prof. Wassanaa Naiyapo adapted into English by Dr. Prakarn Unachak IT AND MODERN LIFE

CUA Spreadsheets Laboratory

K Hinds Page 1. Information Communication Technology Microsoft Access

Bangladesh Open University

Data Information Database Database System Data 1. Known facts that can be recorded and have an implicit meaning.

Database Design Lab: MS Access Queries

TECHNOLOGY COMPETENCY ASSESSMENT MODULE Microsoft Access

MicroStrategy Analytics Desktop

Intermediate Excel Training Course Content

Database Use & Design

Management Reports Centre. User Guide. Emmanuel Amekuedi

Using Microsoft Access

Microsoft Access 2016 Intro to Select Queries

Links to Activities ACTIVITY 2.1. Links to Activities

Microsoft Access XP (2002) Reports

CHAPTER 6 SUMMARY. Objective 1: Identify Good Database Design

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information

Access - Introduction to Queries

GO! with Microsoft Access 2016 Comprehensive

Microsoft Office Specialist Access 2016

Computer Skills MS Access Work Sheet # 1

IT ACADEMY LESSON PLAN

Page 1 of 7. First tutorial: Second tutorial:

ICDL & OOo BASE. Module Five. Databases

Microsoft Access 2010 Select Queries

DATA, DATABASES, AND QUERIES

Introduction to Queries

Intermediate Microsoft Access 2010

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information

Chapter 5: Hierarchical Form Lab

MS-Access : Objective Questions (MCQs) Set 1

GO! with Microsoft Access 2010 Introductory Gaskin Mclellan Graviett First Edition

Exploring Microsoft Office Access 2007

IT2.weebly.com Applied ICT 9713

Schnieder_index.qxd 7/27/05 1:08 PM Page 481 INDEX. Symbols

When you pass Exam : Access 2010, you complete the requirements for the Microsoft Office Specialist (MOS) - Access 2010 certification.

Skills Exam Objective Objective Number. Creating crosstab queries Create a crosstab query

Introductory Exercises in Microsoft Access XP

Introduction to PeopleSoft Query. The University of British Columbia

Transcription:

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Sloan School of Management 15.561 IT Essentials Spring 2005 An Introduction to Microsoft Access * Lecture Script 1. Introduction Open Database: Northwind.mdb Select File then Open Database Note file extension.mdb Discuss Access UI An Access database consists of one or more tables Queries can be defined to retrieve information from the tables Forms can be specified to provide a nicer, graphical user interface for entering and viewing data stored in tables or generated by queries Reports can be defined in order to nicely format and print the contents of tables and the output of queries Macros and modules containing Visual Basic code can be written to provide additional functionality to a database application. View Relationships Select Tools then Relationships The Northwind Traders database keeps track of the day-to-day operations of a small food distribution company. The company stocks products provided by suppliers. Products are grouped into categories. Its employees service customers who place orders. Every order has an order header and one or more order detail records. Each order detail record contains information about one item ordered. Orders are shipped to customers using one out of a set of shippers that the company works with. * Adapted from Chris Dellarocas, Univ. of Md. 1

The lines in the relationships view represent relationships among tables. Typically, they join together a field in one table, which refers to a field in another table. Lines are created manually by clicking the first field and the dragging to the second field. 2. Tables Open Table (For example: Employees) Double-clicking a table shows content in table view Similar to Excel or other spreadsheet Add rows at end Add employee data about Prof. Malone, the TAs, etc. (notice that some field can be specified as required fields and the system does not complete record entry unless they have been filled in; example: First Name, Last Name) Rows = data records, database content Columns = fields, part of database design 2

Switch to design view Select View then Design View Every field has a Name, a Data Type and a Description The lower right part of the screen provides context- sensitive help on the element that the cursor is on. More help can be obtained by pressing F1. There are several different data types that a field can have Text, Number, Date/Time, Currency, Autonumber Properties of data types Formatting (e.g. birth date field) Validation rules (e.g. birth date field) Indexing: Users can optionally instruct Access to create an index on any field of any table Pros: faster to find and retrieve data Cons: slower to enter and save data Primary key: Every table must have a field whose value uniquely identifies each record in the table (e.g. the SSN for people, the ISBN for books, etc.) That field is called the primary key and is marked in the fields list with a key icon Create New Table (Example: A students table) Use wizard and select a table template that comes close (e.g. Employees table) Selectively add fields from the table template Id, first, last, e-mail Show in table view to add sample record e.g. Ben Lee, yoongl@mit.edu Show in design view to create from scratch (Note: You can also import and export tables to and from Excel.) 3

3. Queries Access uses SQL as its query language. In addition it supports a graphical front-end that allows easier specification of queries and automatically translates them into SQL Simple Queries Create query to list employee names (click Queries tab in the main Access window, click the New button, select Design view there is also an option to use a wizard for semi-automatically generating some simple queries) Explain sections of design view screen Upper half of screen lists all the database tables that participate in the query (all the tables you would list in the FROM clause of SQL) Lower half of screen lists all the fields of the above tables that are either being displayed or participate in some way in the selection, grouping or aggregation of the final query output Example: Employees table, first and last fields Run To run a query, select View then Datasheet View Save as query If you attempt to close the query design window then the system asks for a name to save the query under Query is saved under the Queries tab Query views Double-clicking a query runs it and opens it in Datasheet View Select View, Design View Select View, SQL View Modify query to sort by last name Click on the Sort row of the Design View Modify query to find USA employees Drag and Drop Country field into lower half of screen Click on Criteria row of Country field and enter USA Deselect the Show check mark Remove criteria Modify query to find employees hired after 1/1/93 Drap and Drop HireDate field into lower half of screen Click on Criteria row of HireDate field and enter > 1/1/93 4

Modify query to AND the USA criteria As before, insert the USA criterion By default criteria on different fields are ANDed together Modify query to OR the USA criteria Move the USA criterion to the row marked or Show SQL for AND vs. OR 5

Joins Create query to find all customers who placed an order in a given time frame (e.g. 1/1/95-12/31/95) Goto to Queries tab/click New/Select Design View/Add Customers table and Orders table Access does automatic join based on the relationships that have been encoded by the designer (shown as connecting lines on the screen) Select customer, order date, enter between 1/1/95 and 12/31/95 in criteria row for order date If a field contains more text than is visible, open a Zoom window (Shift F2) to read it Run, show SQL Save query to use in Totals section Create new query to find customers who placed at least one order for a given product Use Customers, Orders, Order Details, and Products tables. Set product name = "Tofu" as a selection criterion Look at complex SQL query generated by a query that looks simple in the Design view. OPTIONAL: Ask students to find all employees who handled an order for a specific customer (e.g. "North/South") Totals (name for queries using aggregate functions) Select View then Totals. This inserts a row in the lower half of the screen which allows us to define one aggregate function per field selected Construct a query which calculates average unit price over all products select unit price from products table, select Totals, select Avg in the Total row Generate unique list of customers who placed an order in a given time frame (group by customers, where on order date, and select count as aggregate function on order ID) Number of products supplied by each supplier (join products and suppliers, group by suppliers, count products) 6

Nested queries (queries that use other queries) Generate a list of employees in order of the total of value of all orders for which they are responsible. Use Employees and Orders tables and the query Order Subtotals that already exists in the database. (To add the pre-existing query, select it under the Queries tab in the Show Table dialog box.) Group by Employees LastName and FirstName. Use aggregate function Sum on the field Subtotal in Order Subtotals and Sort (descending) on this field. 7