INTRODUCTION TO QUERIES William Klingelsmith. Reminders MyITLab Lesson C due 10/22 Homework #4 (Nielson TV Problem) due 10/26 Last day to drop is also.

Slides:



Advertisements
Similar presentations
BASIC SKILLS AND TOOLS USING ACCESS
Advertisements

Document Properties: adding information to your Microsoft Office documents Step 1: Add information to Document Properties What are Document Properties.
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
Access Tables William Klingelsmith. Exam Review/Reminders Grades were okay for the most part Common errors Incorrect references in formula Incorrect difference.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
Creating And Maintaining A Database. 2 Learn the guidelines for designing databases When designing a database, first try to think of all the fields of.
ACCESS TABLES & QUERIES. OBJECTIVES Create tables Establish table relationships Create queries Specify criteria for different data types Compact & Repair.
Create Forms Lesson 5. Software Orientation Creating Forms A form is a database object –enter, edit, or display data from a table or query Providing.
Chapter 2 Querying a Database
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall1 Exploring Microsoft Office Access 2007 Committed to Shaping the Next Generation of.
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Database Applications – Microsoft Access Lesson 9 Designing Special Queries Updated 4/11.
Copyright © 2008 Pearson Prentice Hall. All rights reserved.1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational.
Database Applications – Microsoft Access Lesson 9 Designing Special Queries.
You can use a query to view a subset of your data or to answer questions about your data. For example, if you want to view a list of student names and.
Working with a Database
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T6: Basic Skills and Tools Using.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
® Microsoft Access 2010 Tutorial 2 Building a Database and Defining Table Relationships.
Analyzing Data Using Access. Creating a new database To create a new database 1.Start Access. In the Task Pane, click Blank Database. 2.The File New Database.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
® Microsoft Office 2013 Access Creating a Database.
Microsoft Office XP Illustrated Introductory, Enhanced Tables and Queries Using.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
Maintaining a Database Access Project 3. 2 What is Database Maintenance ?  Maintaining a database means modifying the data to keep it up-to-date. This.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
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.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
ACCESS (CHAPTER 2-3 continued) Naman Kohli October 16,
INTRODUCTION TO QUERIES William Klingelsmith. Reminders MyITLab Lesson C due 10/22 Homework #4 (Nielson TV Problem) due 10/26 Last day to drop is also.
What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of.
Computer Apps 1 Queries-part b. Queries Query – a database object that requests information from a database and creates a dataset (list of selected.
CHAPTER 1 – INTRODUCTION TO ACCESS Aliya Farheen March 5, 2014.
DAY 16: MICROSOFT ACCESS – CHAPTER 2 Madhuri Siddula October 8, 2015.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
1 11 Exploring Microsoft Office Access 2007 Chapter 6 Data Protection.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
DAY 18: MICROSOFT ACCESS – CHAPTER 3 CONTD. Akhila Kondai October 21, 2013.
Modify Tables and FieldsModify Tables and Fields Lesson 4 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft.
Key Applications Module Lesson 22 — Managing and Reporting Database Information Computer Literacy BASICS.
DAY 17: ACCESS CHAPTER 1-2 Rahul Kavi October 15,
Access Module Implementing a Database with Microsoft Access A Great Module on Your CD.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
Microsoft Access 2013 Bobby Wan.
Objectives Query for top values Create a parameter query
Plug-In T7: Problem Solving Using Access 2007
Larry Reaves October 9, 2013 Day 16: Access Chapter 2 Larry Reaves October 9, 2013.
Access Creating a Database
Microsoft Office Illustrated Fundamentals
Access Creating a Database
Access Maintaining and Querying a Database
Creating and Modifying Queries
Chapter 9 Lesson 2 Notes.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Analyzing Data Using Access
Forms & Reports William Klingelsmith.
Presentation transcript:

INTRODUCTION TO QUERIES William Klingelsmith

Reminders MyITLab Lesson C due 10/22 Homework #4 (Nielson TV Problem) due 10/26 Last day to drop is also 10/26 Midterm grades will be computed on HWK1-3 and Excel Exam

Database Updated The Music database we worked on last class has been augmented with several records Two new tables (Genres and Sales) need to be added to this database These tables and their records are stored in external files

Importing Data To import data from external sources, you will utilize the External Data tab in Access. There are many different import/export options, but today we will focus on XML file imports. “XML File” in the Import & Link subgroup on the External Data Tab

Importing Data After you choose your file, you will get this dialog. Most of the time for this class, the default ‘Structure and Data’ is appropriate.

Establish Relationships Now that we have all of our tables, we must link them together using relationships Albums -> Songs Albums -> Sales Use Referential Integrity What about the link between Genre and Albums?

Lookup Fields Lookup fields are special Data Types in tables. Possible choices for a field in one table are determined by existing entries in another table. They let you make a dropdown type box for a field which can aide in data entry efficiency. They will build a relationship between two tables automatically.

Lookup Fields Move to the design view of the Albums table Change the data type for the Genre field to Lookup Wizard Follow the wizard’s instructions to create the lookup field. When finished, the wizard should create a relationship between the Genre and Albums tables.

Queries Queries are used to view a subset of the data contained in your database These subsets are most commonly broken down by a limiting criteria “Return only the songs that are on albums by a particular artist” “List all albums of a certain genre” Think of QUEries as QUEstions!

Constructing a Query Let’s start our query lesson with a simple example We wish to list every Artist and Song name Where is this information stored?

Constructing a Query Move to the Create tab and choose Query Design The Show Table dialog lets you add relevant tables to your query Choose only Songs for this query

Constructing a Query Field: Name of the field Table: Table the field belongs to Sort: Sorting the results in Ascending/Descending order Show: Hide/Display the result in the query Criteria and Or: Allows you to narrow filter results of the query on some criteria

Running a Query Queries can be executed in two ways The Run button in the design view of a query Switching to the Datasheet view of a query

Adding Criteria Save the last query as Query A Duplicate it in the object pane Call the copy Query B Open the design view of Query B For this query, we wish to only return the songs performed by the artist ‘Venetian Snares’ In the criteria row under the Artist field type “Venetian Snares” Run the query

Criteria Notes Criteria across multiple fields on the same line are all used at once (AND) Multiple criteria under the same field are all acceptable choices (OR) Conditional operators (, =, etc) can be used in criteria Access has two wildcard operators (? And *)

Criteria Examples (OR) Duplicate Query B and call it Query C On the row below where “Venetian Snares” currently resides, type “Fleet Foxes” Notice that songs from both artists are now returned in the result Criteria is OR’d It is saying that results can be either from Venetian Snares OR Fleet Foxes

Criteria Examples (AND) Duplicate the last query and call it Query D Add the Favorite field from the Songs table to your query design Criteria should be as follows: Artist: Venetian Snares Favorite: Yes We have fewer results than before Criteria across multiple fields on the same row are AND’d “Songs must both be by Venetian Snares and a favorite to be included in the query”

Criteria Examples (Conditional Operators) Let’s try to get a list of all albums released before the year 2000 Create a new query and add the Songs and Albums tables Populate the query with the fields: Artist, SongName, AlbumName, Genre, ReleaseDate In the criteria under the release date enter: “<1/1/2000”

Criteria Examples (Wildcards) Wildcards are operators that can be substituted for a set of characters * Operator allows any set of characters of any length Let’s say we had a field that held first names. By using S* in the criteria, we could get these results from our query Sara Stephen Sue ? Operator allows any set of characters of length 1 By using ?ill we could get results such as: Will Bill Jill

Criteria Examples (Wildcards) Return only Albums that begin with the letter T

New Query 1 We must construct a query to display the name of the artist, the song title, the album name, and the genre of the album. Only display results for the Hip-Hop and House genres. Hint: You will need three tables. Hint: You should have a total of 4 results

New Query 2 Create a query to display the album name, album price, and genre. Only display albums where the genre is House and the album price is above $9. Hint: You should get only one result

New Query 3 Duplicate Query 2. Modify the query so that albums from the EBM genre are included regardless of album price. Hint: You should get 3 results

New Query 4 Construct a query that displays the album name, total sales in dollars, and release date. Only display albums that were either released before the year 2000 or had total sales greater than 10 million dollars. Hint: You should get 8 results

New Query 5 Construct a query to display the artist name, song name, album name, and genre. Display only genres that begin with the letter B or H. Hint: Use Wildcards Hint: You should get 7 results