CS1100: Microsoft Access Managing Data in Relational Databases Created By Martin Schedlbauer CS11001Microsoft Access - Introduction.

Slides:



Advertisements
Similar presentations
Introduction to SQL, OleDB interface to Access from VB.NET.
Advertisements

Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Querying a Database Using the Select Query Window
1 Creating a Non-Conditional List A- What are you going to do? You will “list” “all of the records” in a database. (it means you will not use any condition!)
Querying a Database Microsoft Office Access 2003.
Mary K. Olson PS Reporting Instance – Query Tool 101.
Concepts of Database Management Sixth Edition
Microsoft Access 2010 Chapter 7 Using SQL.
MS Access 2007 IT User Services - University of Delaware.
DATA, DATABASES, AND QUERIES Managing Data in Relational Databases CS1100Microsoft Access - Introduction1.
Chapter 2 Querying a Database
DATA, DATABASES, AND QUERIES Managing Data in Relational Databases CS1100Microsoft Access - Introduction1 Created By Martin Schedlbauer
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
Food Recall System Pre Code System Design Layout Version 1.0.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
Copyright © 2003 by Prentice Hall Module 4 Database Management Systems 1.What is a database? Data hierarchy and data organization Field, record, file,
Access 2007 Database Application Managing Business Information Effectively BCIS 1 and 2.
ASP.NET Programming with C# and SQL Server First Edition
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
CS1100: Access Reports A (Very) Short Tutorial on Microsoft Access Report Construction Created By Martin Schedlbauer With contributions from Matthew Ekstrand-Abueg.
Concepts of Database Management Seventh Edition
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
Introduction to SQL Steve Perry
Data-mining & Data As we used Excel that has capability to analyze data to find important information, the data-mining helps us to extract information.
Microsoft Access 2010 Building and Using Queries.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
Lesson 1: Exploring Access Learning Objectives After studying this lesson, you will be able to: Start Access and identify elements of the application.
A Skills Approach Access 2010 Getting Started with Access 2010 © 2012 The McGraw-Hill Companies, Inc. All rights reserved Chapter 1.
CREATING COMPLEX QUERIES WITH NESTED QUERIES CS1100: Data, Databases, and Queries CS1100Microsoft Access1.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
CREATING COMPLEX QUERIES WITH NESTED QUERIES CS1100: Data, Databases, and Queries CS1100Microsoft Access1.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
1 Access Lesson 3 Creating Queries. 2 Creating a Query with the Simple Query Wizard Query-- database object that lets you ask the database about the data.
Course FAQ’s I do not have any knowledge on SQL concepts or Database Testing. Will this course helps me to get through all the concepts? What kind of.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
Access Chapter 3-Obtaining Answers to Your Data Questions.
Microsoft Access Lesson 5 Lexington Technology Center February 25, 2003 Bob Herring On the Web at
QUERY CONSTRUCTION CS1100: Data, Databases, and Queries CS1100Microsoft Access1.
Ch 3. Working with Tables and Views. Data type Specify type of data to be entered into a column (text, number, datetime, etc) Unicode (National) Datatypes.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Reports. Reports display information retrieved from a database in an attractive printed format. Reports can be created directly from tables, but More.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
SQL Query Getting to the data ……..
Microsoft Office Access 2010 Lab 3
Database Management  .
Structured Query Language (SQL) William Klingelsmith
Microsoft Office Access 2003
Microsoft Office Access 2003
Introduction to Database Programs
Chapter 1 Databases and Database Objects: An Introduction
Introduction to Access
Topic 12 Lesson 1 – Data and databases
Creating complex queries using nesting
Building Queries using the Principle of Simplest Query (POSQ)
Introduction to Database Programs
Joins and other advanced Queries
Topic 12 Lesson 2 – Retrieving Data with Queries
Shelly Cashman: Microsoft Access 2016
Microsoft Access Date.
New Perspectives on Microsoft
Presentation transcript:

CS1100: Microsoft Access Managing Data in Relational Databases Created By Martin Schedlbauer CS11001Microsoft Access - Introduction

DATABASE CONCEPTS Microsoft Access Tutorial: Data, Databases, and Queries CS1100Microsoft Access - Introduction2

What is this About Storing, accessing, searching, and viewing data are important in any business. While spreadsheets work well for small amounts of data, databases are used for larger data collections. Learning how to access data is an important skill when working with databases. We will learn how to formulate queries in the Microsoft Access database system. CS1100Microsoft Access - Introduction3

Value of Knowledge What we learn here is applicable to many other database that are used by businesses: – Oracle – Sybase – Microsoft SQL Server – JavaDB – … We will also learn how to decompose problems and think logically. CS1100Microsoft Access - Introduction4

LAYOUT OF THE ORDERS DATABASE Microsoft Access Tutorial: Data, Databases, and Queries CS1100Microsoft Access - Introduction5

The Orders Database We will be using a database that contains data for orders placed by customers for our examples. This database stores the following information: – For each order know what was ordered, how much of that item was ordered, and at what price. – For each order know who placed that order. – For each customer (called a contact) store where they live. – For each product track its description and price. CS11006Microsoft Access - Introduction

A Sample Order Order O0001 Customer Contact Contact ID:C0004 Name:Colon, Nicholas Address:9020 N.W. 75 Street Coral Springs, FL Order Date:4/15/1999 Product IDProduct NameQuantityUnitPriceExtendedPrice P0013DVD Disks1 $ P0014HD Floppy Disks4 $ 9.99 $ P0027Norton Anti-Virus1 $ Order Total: $ CS11007Microsoft Access - Introduction

Tables, Rows, and Identifiers Microsoft Access is a relational database which means that it stores data in tables Each table contains rows; one row for each record, i.e., a contact, order, product, etc. Each row in a table has a unique identifier, e.g., OrderID, ProductID, ContactID, etc. CS11008Microsoft Access - Introduction

The Database Layout These are all of the tables in the database: CS1100Microsoft Access - Introduction9

Where Does The Data Come From? Order O0001 Customer Contact Contact ID:C0004 Name:Colon, Nicholas Address:9020 N.W. 75 Street Coral Springs, FL Order Date:4/15/1999 Product IDProduct NameQuantityUnitPriceExtendedPrice P0013DVD Disks1 $ P0014HD Floppy Disks4 $ 9.99 $ P0027Norton Anti-Virus1 $ Order Total: $ CS110010Microsoft Access - Introduction Orders.OrderID Contacts ZipCodes Orders.OrderDate LineItems ExtendedPrice = Quantity * UnitPrice Total Order Amount

RETRIEVING DATA WITH QUERIES Microsoft Access Tutorial: Data, Databases, and Queries CS1100Microsoft Access - Introduction11

Queries Data is retrieved through queries. Queries are formulated in a specialized language called SQL (pronounced SEQUEL). Microsoft Access makes it easy to create SQL queries through a simple drag-and-drop interface called the Query Builder. Queries are eventually integrated into reports, forms, programs, or executed by themselves. CS1100Microsoft Access - Introduction12

Queries on Tables Queries retrieve data from one or more tables. You can specify which – rows to include in the result through filters (WHERE clause in SQL terminology) – columns to include in the results The result of a query is a table that can be used in other queries (as subqueries). CS1100Microsoft Access - Introduction13

Creating Queries in Access To create a query: – Select the Create tab – Pick Query Design – Select the tables to include in the query or simply close the dialog and drag the needed tables into the query designer CS1100Microsoft Access - Introduction14

Running a Query To run a query, click on: To return to the query design, click on: CS1100Microsoft Access - Introduction15

Example: Simple Query Find the contact id, first name, and last name for each contact. CS1100Microsoft Access - Introduction16 Click to Watch Demo

Removing Duplicates Queries often result in duplicate rows. These are removed by “grouping rows” with the same value as a single row. To do a Group By, follow these steps: – Select the function button in the ribbon – Select “Group By” for each field CS1100Microsoft Access - Introduction17

Example: Group By Find the dates on which orders were placed. Here’s the result without a Group By: CS1100Microsoft Access - Introduction18 Note the duplicate rows

Example: Group By Here’s the same query with a Group By: CS1100Microsoft Access - Introduction19 Note that the duplicate rows have been “collapsed” into groups and only the group is displayed

Duplicates with Group By Group By collapses all rows that contain the same data across all columns. There are duplicates in this example as the rows are not the same. CS1100Microsoft Access - Introduction20

Eliminating Duplicates Duplicates can be eliminated by specifying that the query should only return unique records. CS1100Microsoft Access - Introduction21 Watch Demo

Joining Tables A “join” is a query operation in which rows are selected that have a common value for some row. To find contacts that actually placed an order 1, the ContactID column value must be the same in the Contacts and the Orders table. This essentially finds all contacts who placed at least one order. CS1100Microsoft Access - Introduction22 1 There may be contacts in the Contacts table that are not linked to any order, i.e., they never placed an order.

Example: Group By and Join Find the first name, last name, and zip code of all contacts that placed an order. Here’s the result without a Group By: CS1100Microsoft Access - Introduction23 Note the duplicate rows

Example: Group By and Join Find the first name, last name, and zip code of all contacts that placed an order. Here’s the result with a Group By: CS1100Microsoft Access - Introduction24 All rows with the same first name, last name, and zip code have been collapsed into a single “group”

Counting Items in a Group To count the rows that were collapsed into a group, use the COUNT(*) function. CS1100Microsoft Access25 The Group By collects identical rows into a group. Only the group is displayed, but COUNT counts the number of rows that are in each group. So the above query tells us how many orders each contact placed.

Expressions Note the use of the “Expression” in the Total row for COUNT(*). Expression is required when a so called aggregation function is used. Aggregation functions work on the items within a group of the Group By clause: – COUNT – counts items in a group – SUM – adds the items in a group (numbers only) CS1100Microsoft Access26

Filtering Selecting rows that meet certain criteria is done through a WHERE clause. CS1100Microsoft Access27 Lists all of the line items (ID only) that have a Quantity > 2.

Selection Criteria Selection criteria are specified as an algebraic relationship, but queries are generally stated as a narrative, so we need to “translate”. CS1100Microsoft Access28 NarrativeAlgebraic Term At least X>= X No more than X< X More than X> X No less than X>= X Less than X< X Up to X< X At most X<= X