Chapter 36

OpenOffice Base Queries

A. Multiple choice questions:

1. Name the Object in an OpenOffice Base package that is used to create a condition depending upon

which data will be filtered out of a Table:

a. Query

Ans.

a. Query

b. Queries only

c. Both a and b

d. None of these

b. Report

c. Forms

d. None of these

2. Queries can be designed from:

a. Tables only

Ans.

c. Both a and b

b. Save Button.

c. Reports

d. Forms

3. Which of the following can be used for creating a Query?

a. Tables

Ans.

a. Tables

4. Entries in ______row of the Query Design view allows you to set multiple conditions

where multiple conditions are present but all needs to be satisfied.

a. Visible

Ans.

a. >

Ans.

c. >

c. Criterion

b. Not equal

c. >

d. <

b. Function

c. Criterion

d. Or

5. The relational operator ______is used to check whether two quantity are unequal or not.

6. Entries in ______row of the Query Design view allows you to set multiple conditions

where multiple conditions are present but either of them needs to be satisfied.

a. Visible

Ans.

d. Or

b. Function

c. Criterion

d. Or

7. Entries in ______row of the Query Design view allows you to select the field for viewing in

the query

a. Visible

Ans.

a. Visible

b. Field

c. Criterion

d. Or

8. Entries in ______row of the Query Design view allows you to specify whether a field will

be visible in the query or not when executed.

a. Visible

Ans.

a. Visible

b. Tables

27

c. Reports

d. None of these

b. Field

c. Criterion

d. Or

9. A ______is used to design an interface for the user to enter or display data from a database.

a. Forms

Ans.

a. Forms

10. The ______object is used when it is required to print or view information online from the

database in a formatted and organized manner.

a. Forms

Ans. c. Reports

B. Fill in the blanks:

1. The Query object is used to filter out data from a table or a query.

2. The Visible option in the Query Design view allows you to see the field when the query is executed.

3. Double click on the query object to execute a query.

4. The Criterion row of the Query Design view allows you to insert a condition to filter out data.

5. The = relational operator is used to check for equality.

6. Fields which takes part in a Query for a condition, but whose content is not displayed is called

Virtual field.

7. The default name for a Query is Query1.

8. The Relational operator is used to set up a condition for the query.

9. The Orcriteria is used when either of the condition(s) needs to be satisfied.

10. If you have conditions in the Criterion row for more than one field, it is said to have AND criteria.

C. State whether the following statements are true or false:

1. Query is used to derive specific information from a database.

2. Click on the Queries button on the Database pane to create a query in OpenOffice Base.

3. You can click on the Insert button on the Add Table or Query dialog to add a query.

[True]

[True]

[False]

b. Tables

c. Reports

d. None of these

4. Keeping the Visible checkbox selected ensures that the field content is displayed when executing the

query.[True]

5. Query1 is the default name of the first query that you create.

[True]

6. The Condition row present in the Design mode of the query is used to provide a criteria o filter out

data from a table.[False]

7. The AND criteria is used when either of the condition needs to be satisfied.

8. Virtual fields are displayed in a query.

9. Forms allow you to print a table.

10. Reports allow you to print a table.

D. Answer the following questions:

[False]

[False]

[False]

[True]

1. What is a Query?

Ans. A Query is a database object that searches for records that match the exact criteria you

define.

2. State the advantage of creating a Query in Design View compared to creating a Query using a

Wizard.

Ans. Using Design View gives you the flexibility of defining the criteria(s) from scratch.

3. How many Tables can be added to a Query? Also state the process of adding a Table using the

Design View.

Ans. You may add any number of tables to participate in a Query. To add a Table the following

28

steps are used:

a. Open the database for which you want to create the query.

b. Click on Queries object on the Database Pane and from the Tasks Pane click on Create

Query in Design View.

c. A new Query window appears showing the Add Table or Query dialog box. It shows all

tables in your database when you click on the Tables option button.

d. Select a table and click on Add button, which gets added to the Query window. In case

you want to add more tables you can continue doing so. Once done with the adding of

tables in the query, click on the Close button.

4. What does the Field entry of the Design View of a Query indicate?

Ans. It is used to specify the fields which will participate in designing the Query.

5. What happens when you remove the Checkbox from the Visible entry of the Design View.

Ans. In case the Visible entry is unchecked it will create a Virtual field, which is eligible to

participate in the query but do not show its content.

6. State the function of Alias entry.

Ans. The Alias is used to give alternative name to a Field which will be visible as column heading

when the query is executed.

7. What is the default name of a Query when saved?

Ans. The default name of a Query when saved is Query1.

8. State any one method of executing a Query.

Ans. Open the database for which you want to create the query.

Click on Queries object on the Database Pane and double click on the query.

i.

State the process of editing a Query.

1. From the Database window click on the Queries object, which in turn displays the queries

in the Objects Pane.

2. From the Objects Pane right-click on it and select the Edit option, which in turn displays

the Query in Design View.

3. You can now make any changes to the Query design here.

ii.

State the difference between AND criteria and OR criteria.

Ans. The AND criteria is used when there are multiple conditions, but all need to be satisfied for

the resultant to be true. The OR criteria on the other hand is used with multiple conditions,

but only one condition needs to be satisfied for the resultant to be true.

E. Application-Based Questions:

MrsSudeshna is the class teacher of class XI Science at Daisy Public School, Newtown Kolkata.

She wants to keep track of the performance (with respect to marks obtained) in Science

(Physics, Chemistry and Biology) by her students.

a. Suggest a Table structure to accomplice the above process. Specify the field name along with

the Data Type of the fields.

b. Which way of creating the Table would be more preferable, Table Wizard or Design View?

29

Ans. The following steps are used for editing a Query:

c. Assuming the data is inserted by MrsSudeshna perform the following:

i. Display the total marks obtained by each student. The marks in individual subject need not be

shown. State the Field entries to be displayed.

ii. State the Criterion entry for the fields to display all information of students who got above 90 in

Physics.

iii. State the Criterion entry for the fields to display all information of students who got above 90

in all the subjects.

iv. Incase the marks of the students in the three subjects were the following:

Physics

78

97

63

91

Chemistry

86

82

52

73

Biology

55

78

88

54

And the Field entry in Design View was “Physics”+”Chemistry”+”Biology” and Alias entry would

be “Total”, Sort entry would be ascending and Visible entry is checked. What would be output

of the Query when executed?

Ans. a.

Table: Student

Field Name

Roll

Name

Physics

Chemistry

Biology

Data Type

INTi

VARCHAR

INT

INT

INT

Description

To store the roll number of the student.

To store the name of the student.

To store the marks obtained by a student in physics.

To store the marks obtained by a student in chemistry.

To store the marks obtained by a student in biology.

b. ‘Design View’ would be more preferable as it gives more flexibility in declaring the

conditions to filter out the data.

c. i. Field entries of the Query from the ‘Student’ Table

Roll

Name

“Physics”+ “Chemistry”+ “Biology” with

Alias entry as “Total”

ii. Physics > 90

iii. Physics > 90, Chemistry > 90, Biology > 90

iv.

Total

203

218

219

257

30