A query in Microsoft Access is used to retrieve, filter, sort, calculate, and analyze data from one or more tables. Queries help you find specific information without manually searching through every record.
A query is a database object that allows you to ask questions about your data and display the results that match your requirements.
| StudentID | StudentName | Course | Fees |
|---|---|---|---|
| 101 | Amit | ADCA | 10000 |
| 102 | Priya | Tally Prime | 4000 |
| 103 | Rahul | ADCA | 10000 |
| 104 | Neha | Web Development | 12000 |
You can use a query to answer questions such as:
Queries are useful in schools, libraries, offices, businesses, and student management systems.
Retrieves and displays records that match specified conditions. It is one of the most commonly used query types.
Example: Display all students enrolled in ADCA.
Prompts the user to enter a value when the query runs.
Example: Enter a course name to display students in that course.
Changes existing values in multiple records that match specified conditions.
Example: Increase the fees for students in a particular course.
Deletes records that match specified conditions.
Example: Delete test records that are no longer required.
Adds records from one data source to an existing table.
Creates a new table from the results of a query.
Summarizes data into row and column headings, making it useful for comparing totals across categories.
Query Design View gives you more control over the fields, sorting, and criteria used in a query.
| Field | StudentName | Course | Fees |
|---|---|---|---|
| Table | Students | Students | Students |
| Sort | Ascending | ||
| Show | ✓ | ✓ | ✓ |
| Criteria | "ADCA" | >5000 |
This grid selects the StudentName, Course, and Fees fields. It sorts names alphabetically and applies criteria to the Course and Fees fields.
Because both criteria are on the same Criteria row, the query returns records where Course is ADCA and Fees is greater than 5000.
Criteria are conditions that determine which records appear in a query's results.
| Requirement | Criteria |
|---|---|
| Fees equal to 10000 | =10000 |
| Fees greater than 5000 | >5000 |
| Fees less than 10000 | <10000 |
| Course equals ADCA | "ADCA" |
| Course is not ADCA | <>"ADCA" |
| Student name begins with A | Like "A*" |
| Fees between 5000 and 10000 | Between 5000 And 10000 |
In Access's default ANSI-89 query pattern syntax, an asterisk (*) matches zero or more characters. Database settings and ANSI-92 mode can affect wildcard syntax.
#10/13/2026#.
SQL stands for Structured Query Language. It is used to communicate with databases and retrieve or modify data.
In Microsoft Access, you can view or write SQL by opening a query and switching to SQL View.
SELECT *
FROM Students;
The asterisk (*) selects all fields from the Students table.
SELECT StudentName, Course
FROM Students;
This query displays only the StudentName and Course fields.
SELECT *
FROM Students
WHERE Course = "ADCA";
This query returns records whose Course value is ADCA.
SELECT StudentName, Fees
FROM Students
ORDER BY Fees DESC;
This query sorts student records by Fees from highest to lowest.
Saved queries can be opened again and run whenever you need their results. A saved Select query stores the query definition, not a separate permanent copy of its displayed results.
Create a Students table containing these fields:
Goal: Learn to create, run, save, and understand basic queries in Microsoft Access.
1. What is the main purpose of a Select query?
2. Which SQL clause is commonly used to filter records?
3. What does SELECT * retrieve?