Sei sulla pagina 1di 23

DEPARTMENT OF TECHNICAL EDUCATION

GOVERNMENT OF ANDHRA PRADESH


Name of the Faculty : USHA RANI JASTY
DESIGNATION : Sr. Lecturer in CCP
Branch : D.C.C.P.
Institute : Government
Polytechnic for Women,
: Kakinada, E.G. District.
Semester : 3rd Semester
SUBJECT : Computer Packages
Subject Code : CCP – 305
Major Topic : Ms Access
Duration : 50 minutes
Sub Topic : Query
Teaching Aids : PPT and visuals

CCP305.31 1
Objectives

On completion of this period, you would be


able to:
 Define Query
 Know types of Queries
 Create Query

CCP305.31 2
Recap
 In the last period, you learned

 Creating tables and setting primary key


 Creating forms

CCP305.31 3
Introduction
 Tables are used to store data in rows columns
(fields or records)
 Forms are used as an interface to enter data
or to navigate through data
 How to view the desired data
 How to view the data in desired format
 What is querring
 Querring means questioning
 Questioning the table about the data

CCP305.31 4
Usage of queries

 Retrieves the data


 Can view and analyze the data
 Once query is created
 Use it as a basis for a form, report, graph
 Query can also be created to create another Query
(Sub-Query)

CCP305.31 5
QUERY
Definition
 A question to obtain specific information
from the selected table
 To View, Change and analyse data in
different ways from multiple tables
 Source of records for Forms, Reports and
Data access pages
 Mathematical calculations can also be
performed
 Written in Structured Query Language
(SQL) CCP305.31 6
Types of Queries
 Select Query :To specify desired
search criteria
 Parameter Query :Prompts for information
and basis for Forms and
Reports
 Cross Tab Query : To see data with row
and column headings

CCP305.31 7
Continued….

 Action Query : to make changes to many


records in just one operation
 Append Query : To add a group of
records from
table to another
 Update Query :To make changes to a
group of records
 Delete Query :To remove a set of
records
 Make- Table Query :To create a new table

CCP305.31 8
Queries can be created

 Using Query wizard


 Using SQL ( structured Query language )
statements
 SQL can be used only by programmers who
knows SQL

CCP305.31 9
Creating a Query
Step 1  Open the database

CCP305.31 10

Figure 1
Step 2  Select “Query Tab and “New” button

Figure 2 showing database window to create new query


CCP305.31 11
Step 3
 Select “Design View” and Click on “OK”

Figure 3 showing ‘New Query’ dialogue box


CCP305.31 12
Step 4  Select the table and click on “Add” and
“Close”

Figure 4 showing ‘show table’ dialogue box


CCP305.31 13
Step 5  Select the required field and drag into
the field box

Figure 5 showing selection of fields into query


CCP305.31 14
Step 5 contd….

Figure 6 showing creation of query after selection of


fields CCP305.31 15
Step 6
 Select “Save” and enter Query name and Click on OK

Figure 7 showing ‘saving of query’


CCP305.31 16
Query Designing and Output of select
Query

Figure 8 showing Table, Query, Output of query


CCP305.31 17
Summary

 Useful to extract data from a table


 Creating Query
 Select “Query” and “New” Option
 Select “Design View” and click on OK
 Select “Table” and Click on “Add” and “Close”
 Select the fields and drag
 Select “Save” option and enter Query name

CCP305.31 18
Quiz
1. Query in MS Access means questioning
 Other person
 Programmer
 A table
 None of the above

CCP305.31 19
Quiz contd…
1. Query can be taken as a source for
a) Report
b) Form
c) Another query
d) All of the above

CCP305.31 20
Frequently Asked Questions

1) What is a Query
2) List the types of Queries
3) Explain the procedure to create a Query with
Illustration

CCP305.31 21
Assignment
1. Create a query using Design view from an
existing table

CCP305.31 22
Thank you

CCP305.31 23

Potrebbero piacerti anche