Project On Query in Ms Access
Project On Query in Ms Access
ACKNOWLEDGEMENT
I express my gratitude and heartily thanks
to our respected faculty Mr. Jitender sir,
Mr. Alok sir and Mr. Vinay sir for their
guidance and constant support towards
the preparation of this project, moreover
without all the mentioned names this
project would not have seen the light for
the evening.
QUERY IN
MICROSOFT
OFFICE ACCESS
QUERY??
Introduction
As tables grow in size they can have hundreds of thousands of records, which makes it
impossible for the user to pick out specific records from that table. Queries were designed to
combat this problem. With a query you can apply a filter to the table's data, so that you only
get the information that you want.
The tricky part of queries is that you must understand how to construct one before you
can actually use them. This lesson will guide you through the basics of making a couple very
simple Access queries.
Definition
Queries are the primary mechanism for retrieving information from a database and
consist of questions presented to the database in a predefined format.
In Simple Words
A query is a set of instructions that you can use for working with data. You run a query
to perform these instructions. In addition to returning results which can be sorted, grouped,
or filtered a query can also create, copy, delete, or change data.
Queries Object
In MS Access we can use queries to extract
information (data) from one (or more) tables (or from
other queries). The information we retrieve can be
limited by the definition of our query.
In access queries are database objects that can be
used to retrieve a subset of data. Unlike filters queries
can be saved and used as a data source for other ms
access objects such as reports, forms or data access
pages.
TYPES OF QUERIES
1) Select Query.
2) Update Query.
3) Append Query.
4) Delete Query.
3)
Our Query window should now have the table added to it.
Now we in the setup process for making a query. Every time we make a query we have
to first choose which table(s) we want to select data from. Currently, our database only has 2 table,
so we don't have a lot of choices here.
The table(s) added will appear like the boxes encircled.
The insertion of fields can be done by using drop-down box appears in fields and by dragging and
dropping directly from the tables to query field.
1) SELECT QUERY
The select query is the simplest type of query and because of that, it is also
the most commonly used one in Microsoft Access databases. It can be used to
select and display data from either one table or a series of them depending on what
is needed.
In the end, it is the user-determined criteria that tells the database what the
selection is to be based on. After the select query is called, it creates a "virtual"
table where the data can be changed, but at no more than one record at a time.
Firstly we need to insert (populate) and select all the fields on which Select
Query needs to be run.
Run A Query
Click Run
Result Window
2)
UPDATE QUERY
Using update query you can make global changes to a group of records in one or more
tables. For example, you can raise grades by 10 percent for all Students (or a subset of students).
An Update query is a query that makes updates to many records at the same time.
After clicking Update Query From Query Tab We Need To Click Run & On The Confirmation
Dialogue Box Click Yes So That The Table Gets Updated Which Can Be Saved Then Accessed
From The Table Manu.
Result Window
3) APPEND QUERY
Append Query is used to add records/group of records from one or
more tables at the end of an existing table. Append Queries are especially
useful for adding old records to the end of a table.
For example, suppose that we drop Students form one Class1and
register them for Class2. We can append records into the Class2.
1) Since in Select Query we can only get the data we have Selective
Approach.
2) An Update query is used for calculation & replacing function.
3) But if there are more than one database exists and we want to merge both
of them then Append Query is used to join or merge the databases.
Now We want to merge both of the above shown table into one.
To execute this desire we will perform Append Query
Click Run
Result Window
Data Has Been Successfully Updated To The Table Chosen.
4) DELETE QUERY
A Microsoft Office Access Delete Query deletes records from a single
database table or database tables. Of all of the different action queries available in
Microsoft Access (Select Queries, Append Queries, Update Queries and Delete
Queries) the delete query is one of the most dangerous. Unlike the others
mentioned, the Microsoft Access delete query will remove records from your tables
permanently and forever.
As with the other types of action queries, the delete query will work with a
group of records that meet a specified criteria that you apply. You can use the delete
query to remove all records or only records that meet the defined criteria.
In Simple Words:
Delete Query allows us to delete a group of records that meet specific search
criteria in bulk. The procedures for setting up a Delete Query depends on whether
we are deleting records from a single table or from multiple tables that are involved
in a one-to-many relationship
1) Firstly, we must
choose Query
From The
Database.
2) Then, we need to
choose the option
Create Query In
Design View.
(Either WIZARD
or DESIGN
VIEW can be
used).
3) Add the table in
which any specific
desired data needs
to be deleted.
Result Window
Than
k You