Ms Access (Queries) What Is Query?
Ms Access (Queries) What Is Query?
What is Query?
Query is data request
Using a query, you can extract information from database table according to particular
condition or criteria
You can use query to perform any action on data
Type of Query
You can create query using query wizard or query design
Query Wizard
Simple query
Crosstab query
Find Duplicate query
Find unmatched record
Query design
Update query
Crosstab query
Summary query
Delete query
Append query
Parameter query
Query Wizard
Simple query
The easiest way to create a query may be to use the Simple Query Wizard (although
you may find the Query Design view easy to use also)
Here we can see Rental id 1120 repeats 2 times and 1124 repeats 3 times
The result set will display the unmatched employees. These are the employees who exist in
the employees table but not having corresponding records in rental table based on employee’s
table
Query design
Update query
Update queries allow you to modify existing records in a table based on specified criteria.
You can change field values, add or remove data, and more.
STEP:1 Create a new query in the query design view
STEP:2 Add payment table to the query design
STEP:3 Add field “Payment Id”, “Customer Id”, “Payment type” and “Payment status” to
the query grid
STEP:4 In the criteria row the payment status enter “Pending”
STEP:5 Set update value in “updated to” row of the “payment status” field enter successful
STEP:6 Run the query
Delete Query
STEP:1 Create a new query design view
STEP:2 Add the “Rental” table to the query design
STEP:3 Choose delete query in design tab. Select delete field enter “Returned_late” this will
specify the condition for which record should be deleted
STEP:4 Run the query
Append Query
Append queries add records from one table to another. They're useful for consolidating data
from multiple sources into a single table.
STEP:1 Create a new query in design view
STEP:2 In the “Table name” field enter the name of new table you want to create
“Distributor Archieve”
STEP:3 Add “Distributor archieve” to query design
STEP:4 In the Append to “Row” of the design grid, map the field of from distributor table
corresponding to the field in Distributor archieve
STEP:5 Run the append query
Parameter Query
Parameter queries prompt the user for input when the query is run. They allow for dynamic
filtering of data based on user-defined criteria.
STEP:1 Create a new query in the query design view
STEP:2 Select Distributor table
STEP:3 Give Criteria
STEP:4 Run the query
Summary Query
Summary query, as opposed to a simple query, is used to extract aggregate of data items for a
group of records rather than a detailed set of records. This query type is of particular
importance in accounting because the accounting reports are based on summarisation of
transaction data.
STEP:1 Create a new query wizard in the create tab.
STEP:2 Select the Movie table.
STEP:3 Select the director and rating fields and click on next.
STEP:4 Select the summary option and check the count records checkbox in the prompt that
appears.
STEP:5 Click on next and save the query.
STEP:6 Run the query.
MS ACCESS (FORMS)
What is a form?
A form in Access is a database object that you can use to create a user interface for a database
application. A "bound" form is one that is directly connected to a data source such as a table
or query, and can be used to enter, edit, or display data from that data source.