0% found this document useful (0 votes)
43 views9 pages

MS Access - Queries+1

Uploaded by

Gibril sonko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views9 pages

MS Access - Queries+1

Uploaded by

Gibril sonko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

CENTER FOR LANGUAGE AND

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.

2. Fields (Columns): Specific data points to retrieve or modify.


3. Criteria: Conditions that determine which records are affected or returned.
4. Operators: Define the type of operation (e.g., =, <, >, AND, OR).
In Microsoft Access, queries can be created using:
1. Query Design View: A graphical interface where you select tables
and define criteria.
2. SQL View: Where you write SQL code directly.
Creating queries in MS Access 2021
1. Select Create > Query Wizard .

2. Select Simple Query, and then OK.

3. Select the table that contains the field, add


the Available Fields you want to Selected
Fields, and select Next.

4. Choose whether you want to open the query


in Datasheet view or modify the query in
Design view, and then select Finish.
Lab session

Import a database from an excel file and perform some


queries like ;
1. Simple queries
2. Complex queries
3. SQL query Language

You might also like