class 7 chapter 8
1. What is a Query and Types of Query in MS Access?
Definition:
A Query is used to retrieve specific data from one or more tables in a database. It helps to filter, sort, and analyze data easily.
Types of Queries in MS Access:
-
Select Query – Used to display data based on certain conditions.
-
Action Query – Used to change data (Update, Delete, Append, or Make-Table).
-
Parameter Query – Asks the user for input (like a search term) before showing results.
-
Crosstab Query – Used to summarize and analyze data in table format.
-
SQL Query – Used to write queries directly using SQL commands.
2. Steps to Create the First Query in MS Access
-
Open MS Access and open your database.
-
Click on the Create tab.
-
Select Query Design.
-
Choose the table(s) you want to use and click Add, then Close.
-
In the design grid, add the fields you want to display.
-
In the Criteria row, type the condition (e.g.,
>50or"India"). -
Click on the Run button (red exclamation mark) to view the result.
-
Save the query with a suitable name.
3. Query Operations with SQL Examples
| Operation | Description | SQL Example |
|---|---|---|
| Select | Display specific records | SELECT * FROM Students; |
| Where | Set a condition | SELECT * FROM Students WHERE Age > 12; |
| Order By | Sort the records | SELECT * FROM Students ORDER BY Name; |
| Insert | Add new record | INSERT INTO Students VALUES (101, 'Rita', 13); |
| Update | Change existing record | UPDATE Students SET Age = 14 WHERE Name='Rita'; |
| Delete | Remove record | DELETE FROM Students WHERE RollNo=101; |
4. Steps to Create a Form in MS Access
-
Open your database in MS Access.
-
Go to the Create tab.
-
Click on Form Wizard or Form Design.
-
Choose the table or query for which you want to create a form.
-
Select the fields you want to include.
-
Click Next, then choose the layout and style.
-
Click Finish to see your form.
5. Steps to Create a Form (Simple Method)
-
Open MS Access.
-
Click the Create tab.
-
Select a Table from the left pane.
-
Click Form under the Create tab.
-
The form will automatically be created showing all fields.
-
Save the form with a name (e.g., “Student Form”).
Comments
Post a Comment