MS Access - Queries+1
MS Access - Queries+1
PROFESSIONAL STUDIES
MICROSOFT ACCESS
QUERIES
Learning objectives
❑Define and understand database queries
❑Creating and designing database queries in Microsoft
Access
❑Saving queries
Introduction to database queries
❑A database query is a request for data or information from a
database. It allows users to retrieve, manipulate, or analyze data stored
in a database. Queries are typically written in a specialized language,
such as SQL (Structured Query Language), which communicates
with the database to perform specific tasks.
Functions of a Query
❑ Retrieve Data: Extract specific data from one or more database
tables. Example is "Show all customers from New York.“
❑ Update Data: Modify existing records in the database.. Example:
"Change the phone number for customer ID 123.
❑ " Insert Data: Add new records to the database. Example:
❑ "Add a new product to the inventory."
Delete Data: Remove records from the database. Example: "Delete
orders placed before 2020."
Types of Queries
1. Select Query: Retrieves data from one or more tables. SQL Example: SELECT
* FROM Customers WHERE City = 'New York';
2. Action Query: Modifies data in the database (e.g., INSERT, UPDATE,
DELETE).. Example: UPDATE Products SET Price = Price * 1.1 WHERE
Category = 'Electronics';
3. Parameter Query: Prompts the user for input to customize the results.
Example: "Enter a city name to view customers."
4. Cross-tab Query: Summarizes data in a table format (e.g., totals by month).
5. SQL Query: Directly written in SQL for advanced operations.
Components of a Query
1. Table: The source of the data.