Access Presentation 3 By: Rasagnya Waghray Ali Murtuza.

Slides:



Advertisements
Similar presentations
Concepts of Database Management Seventh Edition
Advertisements

Concepts of Database Management Sixth Edition
Access Lesson 2 Creating a Database
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
Access Tutorial 3 Maintaining and Querying a Database
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Querying a Database Microsoft Office Access 2003.
Chapter 2 Querying a Database
Microsoft Access 2010 Chapter 7 Using SQL.
Chapter 2 Querying a Database
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
Maintaining and Querying a Database Microsoft Access 2010.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
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.
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.
Microsoft Access 2010 Chapter 7 Using SQL. Change the font or font size for SQL queries Create SQL queries Include fields in SQL queries Include simple.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 4 BACKNEXTEND 4-1 LINKS TO OBJECTIVES Query Design Query Criteria Modify a Query Using OR.
Microsoft Access 2010 Building and Using Queries.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
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.
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Concepts of Database Management Seventh Edition
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Access Manual 2 By Dhawala Kovuri Elham S.Khorasani Ismail Guneydas.
Microsoft Office Illustrated Introductory, Premium Edition Using Tables and Queries.
® Microsoft Office 2013 Access Creating a Database.
COMPREHENSIVE Access Tutorial 3 Maintaining and Querying a Database.
Microsoft Office XP Illustrated Introductory, Enhanced Tables and Queries Using.
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.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
Microsoft Office 2013: In Practice Chapter 3 Creating and Using Queries Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
1 Lesson 18 Managing and Reporting Database Information Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
CREATING DATABASE Presenter: Jolanta Soltis. When to use Excel Use Excel when you: –Require a flat or non-relational view of your data (you do not need.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
1 Access Lesson 2 Creating Queries, Forms, and Reports Microsoft Office 2007 Fundamentals Story / Walls.
Microsoft Access 2000 Presentation 5 Creating Databases Part IV (Creating Queries)
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
Filters, Queries and Reports. Filters Limit the data, creating a dataset, or partial view of the whole database Single use – filters do not save with.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
Creating Advanced Queries and Enhancing Table Design.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Lesson 23 Managing and Reporting Database Information
Microsoft Office Illustrated Introductory, Windows Vista Edition
Access Tutorial 3 Maintaining and Querying a Database
Access Chapter 2 Querying a Database.
Objectives Query for top values Create a parameter query
Querying a Database Using the Select Query Window
Access Maintaining and Querying a Database
Building and Using Queries
Microsoft Office Access 2003
Tutorial 3 – Querying a Database
CIS16 Application Programming with Visual Basic
Microsoft Office Access 2003
Microsoft Office Access 2003
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Microsoft Office Illustrated Introductory, Windows XP Edition
Shelly Cashman: Microsoft Access 2016
Tutorial 5 Advanced Queries and Enhanced Table Design
Presentation transcript:

Access Presentation 3 By: Rasagnya Waghray Ali Murtuza

Overview Create Queries  Using Query Wizard  Using Design view  Example Criteria  Wild cards  Using relational operators in criteria  Using compound criteria

Overview (cont) Omit duplication from query result Main query types  Select Query  Update Query  Delete Query

Creating query from wizard Queries are simply questions, the answer to which are in database. For creating a query you must have already defined your tables and entered data in your tables. The example database used in this manual is the student database we created in “Access presentation 2”. For creating query from wizard, click on the “Create” tab then click on “query wizard”. Then in the window that pops up, choose “simple query wizard” option. Click “ok”.

Select the table you want to have query from and add the fields that you want to show in your query, click on next and “finish”. If you need to make any changes to the query, right click on the query in navigation bar and click on “design view”

Query wizard Step1: Choose simple query wizard Select the table and the fields you want to add for the query

Creating query in Design View Another way to create a query is to click on the “create “ tab and click on “query design” button. Most of the time you will use design view to create queries. A “show table” dialog box appears which shows all the table in the database. Select the tables that you want to query from and hit “add” button. After adding all the tables you want, click on the “close” button to close the show table dialog box.

Add the tables you want to use for your query Hit close after you selected your tables Design Grid

Creating Query in Design view (cont) When creating queries, you can request for specific records and accompanying fields to be shown based on certain criteria. In Microsoft Access, there are six areas that can be utilized in creating a query.  Fields: Used to specify which fields should be a part of the query : for adding a field, you need to double clicking on the field name in each table.  Table: Used to specify the table that houses the fields that will be a part of the query.

Cont..  Sort: Used to specify how the records will be sorted when the query is run. It has two options: Ascending and Descending, you can sort the query result based on the related field.  Shows: Used to indicate whether a field involved in the query should be shown in the results or not, it is useful when you want to have a criteria /condition on a field but you do not want to show the field in the query result  Criteria: Is very important row and indicates the condition on the related field  Or: Indicated compound criteria

Example As an example suppose we want to design a query that gives us the first name, last name, and GPA of the students whose majors are “Education”, and we want the results to be sorted by student’s first name. For doing that we need to do the following steps:  Double click on the “FN”, “LN”, “GPA” and “MAJ” fields on the student table to add these fields to the design grid.  In the “sort” row, under the FN field, choose ascending.  Uncheck the “show” checkbox under the MAJ field  In the “criteria “row under MAJ field, type “education”  Save the query and give it a name, e.g. “query1”.  Click on the “run query” button to see the query result.

The “Run query” button

Query result You should switch to the design view of the query if you want to make changes to the query.

Criteria As mentioned before, the criteria is a row where you specify your conditions on different fields. Use comparison criteria: Unless you specify, access assumes that the criteria you enter involve equality(exact match). In the last query for example the criteria was actually “=Education”. If you want something other than exact match you must enter appropriate comparison. For example if you want to change the criteria of the previous example to see the students whose GPA is greater than 3.00, you write “>3.00” in the criteria row, under the GPA field.

Criteria GPA > 3

Using Wildcards for criteria Wildcards are symbols that represent any characters or combination of characters. It’s a pattern that specifies what will be matched. Wildcards use special characters to specify the types of information to match. The common wildcards are :  Asterisk (*), which represents any collection of characters. For example “El*” represents the letters EI followed by any collection of characters. Examples of * are:

Cont.. Of examples Like “s*” : Matches all the values that start with “s”.(eg- “Smith”,but not “Davies”) Like “*s” : Matches all the values that end with “s”.(eg- “Davies”, but not “Smith”) Like “c*n” : Matches all the values that start with “c” and end with “n”.(eg- “Cohen”) Like “c*a*n” : Matches all the values that start with “c”, have an “a” somewhere in the middle and end with an “n”.(eg- “Cohan”) Like “c*an” : Matches all the values that start with “c” and end with “an”.(eg- “Cohan” but not “Cohain”)

Example As an example query that uses wildcard, suppose that we want to see the students whose last name ends in “n”. As soon as you write wild cards in criteria row, access adds “like” keyword automatically.

Last name ends in “n”

Query result

Cont.. Of Wildcards  Question mark(?): which represents any individual character, for example T?M, represents the letter T, followed by any single character followed by letter M. ( such as TOM or TIM).Examples: Like “a??” : Matches “ape”, “aaa” but not “apple” Like “*a?” : Matches “bread” and “lean” but not “apple” and not “fella”.

Cont.. Of Wildcards  Number Sign(#): which matches a single numerical digit. Examples are: Like “###abc” : (there are three number signs) matches “123abc” And “456abc” But not “a123abc” And not “abc123”.

Compound Criteria We can have more than one criteria for a query. There are two types of compound criteria 1.And Criterion: Each individual criterion has to be true in order for the compound criterion to be true. To combine criteria with And, we should place them in the same row ( in criteria row). 2.OR Criterion: At least one of the individual criterion has to be true in order for the compound criterion to be true. To combine criteria with OR, we should place them in separate lines.

Compound criterion Example As an example of And criterion suppose the query is to show the First Name, Last Name, major and GPA of the students whose Last Name begins with “S” and/or their GPA is greater than 3.00.

And criteria should be in the same row

Or criteria should be in the separate rows

And query result Or query result

Query Types Until now we just mentioned the queries that filter the table, this type of query is called “select” query. Select query does not modify the content of table There are two other types of query that modify the content of tables in database. These queries are:  Update queries  Delete queries

Delete Query Deletes some records from a table that satisfy certain criteria. For creating a delete query, click on the “delete button” in query type group. Then select the field that you want to have criteria on, and specify your criteria. As an example, delete all students whose Major is “education”. When you run this query a window pops up and asks you to confirm deleting 2 records.

Click on Delete button Specify the criteria

Update Query Updates the records that satisfy certain criteria. For creating a delete query, click on the “update button” in query type group. Then select the fields that you want to update, specify the new values that these field should be updated to and specify the criteria. As an example, update the records of all students whose major are “Education” and their GPA is greater than 3.0, change their major to “edu”

Update query type button