Documente Academic
Documente Profesional
Documente Cultură
INTRODUCTION TO QUERIES
OVERVIEW OF QUERIES
In Access, queries are used to manipulate
data in the database. Queries can be used as views that show the specific data or group of data rather than all the data in the database. Queries can be used in forms, reports and controls for requesting data from database. Queries can be based on a single table or multiple tables.
TYPES OF QUERIES
Select queries
Retrieve data based on specific conditions.
Action queries
Add, update and delete data.
Parameter queries
Prompt user for search/action criteria.
Crosstab queries
Summarize data into categories.
SQL queries
SQL commands (in SQL view only).
CREATING QUERIES
Access provides a tool called Query Design
window for user to create queries manually. The window comprises two parts:
Field list Design grid
CREATING QUERIES
User can use the SQL view window to create
queries manually. When executing a query, Access translates the query (design view version) into Jet SQL commands. Jet SQL is the version of SQL adopted by Access, which supports most of the standard SQL operations. To use the SQL view window, user needs to know how to write a SQL statements.
CREATING QUERIES
User can also use the Query Wizard to create
queries. Query Wizard is a program that helps user to create select queries in an automated, stepby-step manner. However, it doesnt provide the flexibility for user to customize or specify the output of a query.
OPTIMIZING QUERIES
Guidelines: Avoid using asterisk (*) for retrieval.
Specifying all field names instead of using *.
Limit fields.
Specifying the fields needed to be displayed.