You are on page 1of 3

Q) Queries and dynasets:

Queries are simply requests you make when searching your data. Access responds to queries by corralling and
displaying all of the records that much your query. These results are called dynasets. When you execute your query the
corresponding dynasets will appear on the screen.
Q) Explain how to create query using Wizard view
Ans) Creating and using select queries:
Suppose you want to show all the records in a data base table, we can create query for combining and display the
records in different tables. To accomplish this process we need to follow the below steps.
1.

Open your data base, if it is not opened.

2.

Click on the queries option on the data base dialogue box.

3.

We have two options for creating a query those are create a query by design view and
create query using wizard.

4.

Double click on the appropriate command according to your requirement.

5.

If you choose query wizard then the query wizard dialogue box will appear on the screen.

6.

In this dialogue box we have table/query list box select which one you want to include into query.

7.

Fields of the selected table or query will appear on the fields list box.

8.

Select your fields which are involved into your query then click on appropriate button > or >>.

9.

The selected field is adding to select field list box. If you want to remove any field from the selected field list box
click on appropriate button < or <<.

10. Then click on the next button, it will forward to further step in query wizard.
11. In this step we can specify name for the query at the top of a dialogue box and it can display
two options. Those are:
i)

Open the designed query.

ii) Modify the design of a query; these are available in the form of radio buttons.
2.

Select your option and click on finish button. Access gives a response. According to the selected option to the finish
step.

Q) Explain how to create query using design view?


Ans) Creating a query using designed query option:
1.

Open a data base if it is not open.

2.

Choose queries object button on the data base dialogue box.

3.

Double click on the query using design view option.

4.

The design window of the query will appear on the screen and also add table dialogue box will appear.

5.

In add table dialogue box, we have list of table name in the opened data base.

6.

Select your tables, click on add button, which tables are want to use in query.

7.

After adding the tables click on ok button. Selected tables in the add table dialogue box will be add to the design
window of a query.

8.

In this window we have a query design in button edge.

9.

We have tables list at the top of the design window. Which fields are used in the query, double click on the specified
field name. That will be added to the query.

10. Otherwise select a field name in the query directly in query design.
11. In the query design we have a table row, each column in the table row having a combo box. It can maintain a list of
selected table names.

12. By using show row we can display or hide a particular field in query. Each and every column in the show row has a
check box.
13. After creating a query you must save it. If you try to close before saving a query access gives an alert message to save
designed query.
14. The created query name will appear on the data base dialogue box.
15. If you want to execute it simply double click on the query name.
Q) Explain about Types of Queries
Ans) Queries are very useful tools when it comes to databases and they are often called by the user through a form. They can
be used to search for and grab data from one or more of your tables, perform certain actions on the database and even carryout
a variety of calculations depending on your needs.
Luckily for us, Microsoft Access allows for many types of queries, some of the main ones being select, action, parameter and
Crosstab queries. When it comes time to build a query for your database, you have two ways to go about creating it.
1.

Either use the Query Wizard, or

2.

Create your own queries from scratch.

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-determines criteria that tells the database what the selection is to be based on.
2. Action Query:
When the action query is called, the database undergoes a specific action depending on what was specified in the query itself.
This can include such things as creating new tables, deleting rows from existing ones and updating records or creating
entirely new ones.
Action queries are very popular in data management because they allow for many records to be changed at one time
instead of only single records like in a select query.
Four kinds of action queries are:
1.

Append Query takes the set results of a query and "appends" (or adds) them to an existing table.

2.

Delete Query deletes all records in an underlying table from the set results of a query.

3.

Make Table Query as the name suggests, it creates a table based on the set results of a query.

4.

Update Query allows for one or more field in your table to be updated.

3. Parameter Query:
In Microsoft Access, a parameter query works with other types of queries to get whatever results you are after. This is
because, when using this type of query, you are able to pass a parameter to a different query, such as an action or a select query.
It can either be a value or a condition and will essentially tell the other query specifically what you want it to do. It is often
chosen because it allows for a dialog box where the end user can enter whatever parameter value they wish each time the query
is run. The parameter query is just a modified select query.
4. Crosstab Query:
Crosstab queries calculate a sum, average, count, or other type of total for data that is grouped by two types of
information one down the left side of the datasheet and another across the top.
Q) Explain about CrossTab query
Ans) A crosstab query is used when we want to represent a summary query with two grouping columns like a double input
table, in which each one of the group columns is an entry, one down the left side of the datasheet and the other across the top.

E.g we want to obtain the monthly sales of our employees from their sold orders. We need to design a summary query that
calculates the sum of the amount of orders grouped by employee and month of sale.

To start the crosstab query Wizard we need to be in the Database window in the Queries object.

click on the

Select the Crosstab Query Wizard option in the dialogue box that appears.

The first window of the wizard will appear:

In this window we are asked to introduce the source of the query, the table or query where the data is coming from.

In the View section we can select whether we want to see the list of all the Tables, all the

button in the Database window.

Queries, or Both.

If the query that we are creating needs to extract the data from all the records in just one
table we use this table as the source, if this is not the case we need to define a normal
query that combines the various tables, and this query will be the source of the crosstab
query.

We click on the chosen origin name and click on the Next button to go to the next
window.

In this window the wizard will ask us to introduce the row heading. As we said before one
of the group columns serves as the row heading and the other as the column header. If one of these columns could
contain many different values and another very few, we will select the first as row header and the second as column
header

To select a row header, click on the field and then on the

button. On the transfer of the field to the Selected

fields: list, an example of the result will appear in the bottom zone of the window; we have selected the Course hours
field and we see that in the query a row appears for every different value in the Course hours field.

If we made a mistake with the field click on the

button and the field will be removed from the list. We can select

up to three fields. If we select various fields there will appear in the result of the query as many rows as what there are
different value combinations of these three source fields. The buttons with double arrows are to send all the fields
over in one go.

You might also like