Solved Back Exercise Unit 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Unit 3 Data base Management System using LiberOffice Base

Chapter 8: Introduction to Database Management System


• The raw facts constitutes data.
• Information is the processed or organised form of data.
• A database is a collection of logically related data items stored in an organised manner.
• The software that is used to create, update and retrieve data is known as database
management system (DBMS).
• Some of the common examples of DBMS are MS Access, Open Office or LibreOffice
Base, Oracle, Ingress, MySQL.
• Data Model is the structure of database and it describes the manner in which data will be
stored and retrieved.
• There are different data models, such as hierarchical data model, network data model
and relational data model.
• In Hierarchical Data Model, the data is organised into a tree like structure. The data is
stored in the form of linked records.
• In Network Data model, multiple records are
linked to same master file.
• The Relational data model is based on the principle of setting relationships between two
or more tables of the same database.
• Entity is a real world object about which information is to be stored in a database.
• The details associated with the entity are called attributes.
• A table is a collection of logically related records. It is organised as a set of columns, and
can have any number of rows.
• A field is the smallest entity in the database. These are individual record
characteristics and are presented as columns within a table.
• Data values are the raw data represented in numeric, character or alphanumeric form.
• The data values for all the fields related to a person or object is called a record. It is
presented as rows within a table.
• A primary key is a field that uniquely identifies a row in a table.
• This foreign key helps to build a relation between two or more tables in a database.
• All the field values that are eligible to be the primary key are the candidate keys
for that table.
• Out of the candidate keys, one or two are made as primary keys. The others are the
alternate keys.
• An object in a database is a structure or a feature that is used to store, represent or
retrieve data. The various objects in a database are tables, forms, reports and queries.
• A form is a feature of a database using which we can enter data in a table in an easy
and user friendly manner.
• A query is used to retrieve the desired information from the database.
• The output of a query may be displayed in the form of reports.
A. Multiple choice questions
1. Which of the following can be considered as an example of a database?
(a) Dictionary
(b) Telephone directory
(c) Marks Register
(d) Newspaper
2. Which of the following is NOT a DBMS?
(a) MS Access
(b) Open Office Base
(c) MS Excel
(d) MySQL
3. DBMS stands for .
(a) Data and Books Management System
(b) Database Management System
(c) Duplicate Books Management System
(d) Data Management Multi System
4. Which of the following data models sets a relation between the two or more tables?
(a) Relational Data Model
(b) Network Data Model
(c) Hierarchical Data Model
(d) Connection Data Model
5. The details associated with an entity are called .
(a) Table
(b) Attributes
(c) Records
(d) Primary key
6. A is represented as rows in a table.
(a) field
(b) attribute
(c) record
(d) candidate key
7. In which of the following forms can a data value be represented?
(a) Numeric
(b) Character
(c) Alphanumeric
(d) All of the above
8. Which of the following uniquely identifies a row in a table?
(a) Primary key
(b) Alternate key
(c) Foreign key
(d) Candidate key
9. A is a feature of a database using which we can enter data in a table in an
easy and user friendly manner.
(a) query
(b) report
(c) form
(d) field
10. A is a question asked from a database.
(a) query
(b) report
(c) form
(d) field

B. State whether the following statements are True or False


1. A database cannot be organised.- False
2. Data is the collection of raw facts.- True
3. A table can be created without a primary key.- False
4. Two tables can be related in a network data model.- False
5. MS Access is an example of a database.- False

C. Fill in the blanks


1. The raw facts constitutes Data.
2. An Entity is a real world object about which information is to be stored in a
database
3. The output of a query may be displayed in the form of Report
4. The data values for all the fields related to a person or object is called a Record
5. All the field values that are eligible to be the primary key are the Candidate keys for
that table
D. Answer the following questions
1. Define the terms
(a) Database
A database is a collection of logically related data items stored in an organised
manner. The information being stored in a database can be added, modified,
deleted or displayed according to the requirements of the user.
(b) Data redundancy
The event of requiring the same data field in several tables the data field might get
repeated in number of tables. This is called as data redundancy.
(c) Report
A report is used to present the retrieved data in an attractive and customized manner.
2. Give one point of difference between
(a) Data and Information
Data:- The raw facts constitutes data. The facts may be related to any person,
place, activity or things. It may be stored in the form of text, graphics, audio or
video
Information: Information is the processed or organized form of data. If data is not
correct or accurate, the information obtained by processing such data may not be
correct. The data must be processed by any computing machine in a proper way to
generate the useful and meaningful information
(b) Form and Query
Form :- A form is a feature of a database using which we can enter data in a table
in an easy and user friendly manner. The data entered through the forms is stored in
tables.
Query:- A query is used to retrieve the desired information from the database. In
simple terms, it is a question asked from the database. For example, if we want to view
the names of only those students who have scored more than 50 marks, then we post
a query. The data set matching the given criterion is retrieved from the table and
displayed on the screen
(c) Network and hierarchical data model
In Hierarchical Data Model, the data is organised into a tree like structure. The data
is stored in the form of linked records. All these records are linked to each other at
various levels, thereby forming a hierarchy
In Network Data model, multiple records are linked to same master file. It is also
considered as an inverted tree where master is present in the bottom of the tree and
the branches contain information linked to the master.

3. Give any four advantages of a DBMS.


 Organised Storage – The data in the database is stored in an organised manner,
so that retrieval of the required data is fast and accurate.
 Data Analysis – A database helps in analysis of data based on certain criteria. It
is easy to find out maximum or minimum value, average or mean using a
database.
 Data Sharing – If the same data set is required for different applications then
the database can be shared with other applications. Hence using a database means
making once and using it repeatedly for multiple applications.
 Minimal Data Redundancy – In the event of requiring the same data field in
several tables the data field might get repeated in number of tables. This is called
as data redundancy. This can be reduced by using DBMS tools.
 Data Consistency – By minimising data redundancy, chances of inconsistent
data being stored is reduced. For example, it should not happen that the name of
the student is changed in one table and not in another. Such inconsistency is
reduced by using a DBMS.

4. Consider the table given below and answer the questions that follow.
Table: Library
Book_Id Book Name Author Name Price Publisher
F001 Pride and Prejudice Jane Austen 550 ABC
S004 Amazing Astronomy E. Shane 1050 ABC
C005 IT and Mankind MHA Diwaan 2500 HYM
(a) Name the fields in the given table.
Book_Id, Book Name, Author Name, Price, Publisher
(b) Which field should be made the primary key?
Book_ID
(c) Is there any alternate key in the table?
NO
(d) How is primary key different from foreign key? Explain with example.
Primary Key – A primary key or simply a key is a field that uniquely identifies
a row in a table. The key identifier can be the value of a single column or of
multiple columns. The primary key is a unique identifier for the table.
Foreign Key – If a field or a combination of fields of one table can be used to
uniquely identify records of another table, then that particular field is known as the
foreign key. This foreign key helps to build a relation between two tables.

Chapter 9: Starting with Libra Office base


Data Types
The nature of data to be entered for various fields are of different types. For example,
names are stored in the form of text, age in numbers, fees in decimal numbers, date of birth
in date format and so on. A data type refers to the type of data that will be stored in that
particular field. The memory size of a field varies according to its data type.
Some commonly used data types are described below. Text Data Type – The text data
is a combination of letters, numbers or special characters. No arithmetic calculations can
be performed on text data. Examples of text data type is PAN Card Number, Name,
Marks, etc.
Text Data Types
Name Data type Description
Stores up to the maximum length indicated by user. It is
used to store some descriptive data having more than 255
characters. Memo data type allows to store text data up to
Memo LONGVARCHAR 64,000 characters.
Stores exactly the length specified by user. Character data
type is used to enter fixed number of characters. It can be
used for license number, passport number as they have fixed
Text (fix) CHAR number of characters.
Stores upto the specified length. The number of bytes
allocated depends on the number of characters entered by
the user. For example, the address is defined as varchar (50),
and if the address entered by the user is of 20 characters then
Text VARCHAR only 20 bytes will be occupied in the database.

• Numeric Data Type – Numeric data types consists of numbers. The numbers can be
integer or real numbers on which any type of arithmetic calculations can be
performed. For example, 10,
-34.8, 90.6789 , -86 are of numeric data type. Table 9.2 lists different numeric data
types along with the number of bits/bytes it uses and its range.

Name Data type Signed Range


Tiny Integer TYNYINT No 0-255
Small Integer SMALLINT Yes -32768 to 32768
Integer INTEGER Yes -2.14×109 to 2.14×109
BigInt BIGINT Yes -2.3×1018 to 2.3×1018
Number NUMERIC Yes Unlimited
Decimal DECIMAL Yes Unlimited
Float FLOAT Yes
Real REAL Yes 5×10(-324) to 1.79×10(308)
Double DOUBLE Yes
• Currency Data Type – The currency data type indicates the monetary values and
can be stored using currencies of various countries. For example
$100, £ 500 or Rs. 25.50.
• Date Data Type – This data type is used to indicate dates and time. For example
12/25/2019, 08:45 AM. The data and time can be stored in various formats. Table 9.3 list
various forms of date data type.
Name Description
Date Stores the year, month and day as it is stored in the system.
Time Stores the time of the day as hour, minute and second.
Timestamp Stores date and time information at once.

• Boolean – In boolean data type there can be only two values- True or False. This also
can be given in multiple formats like Yes/No, True/False, On/Off.
• Binary – The Binary data type used to store digitized images and sounds that comes as
long string of zeros and ones. It is possible to store photos of the products or employees,
or sound snippets or voice messages in Base database.

Summary
• Base is a free and open source database component of LibreOffice suit.
• It can be downloaded from www.libreoffice.org
• A data type refers to the type of data that will be stored in that particular field.
• Various in Base can be categorized into Text , Numeric, Currency and Date.
• LibreOffice Base is the collection of related data objects known as Tables, Forms,
Queries, Reports and application modules.
• Depending on the object that is selected, the respective Task Pane and Object Area
displaying the created object appears on the User Interface Window.
• A table in LibreOffice Base can be created using a wizard or using the Design view.
A. Multiple choice questions
1. Which of the following is NOT a type of text data type?
(a) Memo
(b) Varchar
(c) Float
(d) Char
2. A currency data type can only store monetary data that is in dollars.
(a) True
(b) False
(c) Neither a nor b
(d) Both a and b
3. Which of the following data can a date data type store?
(a) Date
(b) Time
(c) Both date and time
(d) Neither date nor time
4. Which of the following is true about LibreOffice Base?
(a) It is a spreadsheet software
(b) It is free and open source software
(c) It can store only character data
(d) It is a licensed software.
5. Which of the following methods can be used to create a table in Base?
(a) Using a table wizard
(b) Design View
(c) Both a and b
(d) Neither a nor b
6. The related objects of a database can be seen in ____________pane of the Base
Database window.
(a) Database
(b) Task
(c) Title Bar
(d) Menu Bar
7. Which is the shortcut key to open an existing database?
(a) Ctrl+ D
(b) Ctrl+O
(c) Ctrl+E
(d) Ctrl+F
8. The Design view of Table Creation window in LibreOffice Base is divided into
sections or panes.
(a) 2
(b) 3
(c) 4
(d) 5
9. While entering records in a table, we can move to the next field by pressing
the________ key.
(a) Tab
(b) Ctrl
(c) Enter
(d) Shift
10. Which of the following is true about primary key of a table?
(a) Every table must have a primary key
(b) The data values in primary key field cannot be duplicated.
c) A primary key field cannot be left blank
d) All of the above

B. State whether the following statements are True or False


1. The text data can contain special characters. ----True
2. Memo data type can be used to store descriptive data. ---- True
3. A Boolean data type can have two or more than two values.---- False
4. We cannot store audio data in LibreOffice Base.---- False
5. The properties of a field change according to the data type selected.---- True
6. Field description may or may not be entered while designing a table.---True
7. is pressed to move to the last record.---- False
8. appears when the record is being edited.---- True
9. A table once created in a database cannot be edited.--- False
10. Sort dialog box can only help to sort data in ascending order.--- False

C. Fill in the blanks


1. A data type refers to the type of data that will be stored in that particular field.
2. The Text data is a combination of letters, numbers or special characters.
3. Text data type can be used to store Aadhar number.
4. The binary data type used to store digitized images.
5. The shortcut key to save a table is Ctrl+S
6. Tasks Pane on the Base Interface Window displays information about the type of
view of the object in the database.
7. A Key icon appears before the field name indicating that it is a primary key.
8. The data can be entered in a table only in Datasheet view.
9. The black pointing arrow just before the field name in a table is called Recorder
Pointer
10. The process of arranging the records in particular order on any filed is called
Sorting.

D. Answer the given questions


1. Differentiate between:
a) Memo and Varchar data type
Memo : Stores up to the maximum length indicated by user. It is used to store some
descriptive data having more than 255 characters. Memo data type allows to store text data up
to 64,000 characters.
Varchar: Stores upto the specified length. The number of bytes allocated depends on the
number of characters entered by the user. For example, the address is defined as varchar (50),
and if the address entered by the user is of 20 characters then only 20 bytes will be occupied in
the database.

b) Number and Decimal data type:


The Number and Decimal data types both store numerical data, but Decimal data type
includes decimal places, making it ideal for financial calculations or any calculation
requiring precision. Number data type, on the other hand, is used to store integers or whole
numbers.

c) Design View and Datasheet view of a table


Design View and Datasheet View of a table present different ways of looking at the same data.
The Datasheet view allows you to see the data in rows and columns, similar to a spreadsheet.
The Design view, allows you to see and modify the structure of your table and to set field
properties.

2. Name the menu items present on the Base User Interface


The various menu items present on the Base User Interface are:
• Title Bar – The title bar displays the name of a database and an application in
which it is made. The windows buttons to maximize, minimize or close the window
are located on the right corner of the title bar.
• Menu Bar – The menu bar appears below the title bar. It consists of seven menu
items – File, Edit, View, Insert, Tools, Window and Help. All these menu items
contain commands that help to perform various operations on the database.
• Standard Toolbar – It is located below the menu bar. It is used to access
frequently used tools.
• Status Bar – It is located at the bottom of the interface window. It displays information
about the type of view of the object in the database.
• Database Pane – The database pane is located on the left side of the window.
LibreOffice Base is the collection of related data objects known as Tables, Forms,
Queries, Reports and application modules. Depending on the object that is selected,
the respective Task Pane and Object Area displaying the created object appears.

3. Label the components – Title Bar, Database Pane, Tasks Pane, Status Bar
of the LibreOffice Base User Interface.

Title Bar

Tasks Pane

Database Pane

Status Bar

4. How can we define a primary key in a table?


To make a particular field as the primary key,
 place the mouse pointer before the field name, say Event Id in our above
example and right click.
 A pop up menu appears Select the Primary Key option from pop up menu
 A key icon appears before the field name indicating that it is a primary key.

5. Write steps to sort the table in descending order of primary key.


Step 1. Open the table in datasheet view and select the field on which you want to
sort.
Step 2. From the tool bar select Sort Descending icon to be sorted in descending
order of selected field.
Step 3. The table will be sorted in the descending order.

6. What is the use of navigation box with respect to tables in a database?


To navigate through various records of the table, we use the navigation box present at
the bottom of the datasheet window. The various components of Navigation Box
are as follows:
• Record Selector Box – T his is the text box where the currently active record
number is displayed. We may enter the record number that we want to see in
this text box.
• Navigation Buttons – These are used to scroll vertically in the table.
• Press to move to the first record.

• Press ► and ◄ to move to the next and previous records respectively.

• Press to move to the last record.

Chapter 10: Working with Multiple Tables

SUMMARY
• Relations are set up between the tables to control data redundancy and inconsistency.
• The most important prerequisite for setting a relationship between the two tables is that
there must be a common field(s) between the two tables.
• Three types of relationships can be set up between two tables in a relational database.
These are One-to-One, One-to-Many and Many-to-Many.
• In One-to-One type of relationship, one specific record of a master table has one and only
one corresponding record in the transaction table.
• In One-to-Many type of relationship, one specific record of the master table has
more than one corresponding records in the related transaction table.
• In Many-to-Many type of relationship, there are multiple records in the master
table that correspond to multiple records in the transaction table.
• According to the principle of referential integrity, no unmatched foreign key values
should exist in the database
A. Multiple choice questions
1. Which of the following actions can be performed once the tables are created in a
database?
(a) Add a field in a table
(b) Rename a table
(c) Delete a table
(d) All of the above
2. Which of the following is checked by a DBMS?
(a) Redundancy
(b) Inconsistency
(c) Both (a) and (b)
(d) Neither (a) nor (b)
3. Which of the following is required to set a relationship between the two tables?
(a) Both the tables must be in different databases
(b) Both the tables must have a common field
(c) Both the tables must have the same name
(d) Both tables must be stored in documents folder only.
4. If a record is added in a master table, which of the following is NOT true for
transaction table
(a) The record in the master table is called the master record
(b) The corresponding record in transaction table can only be entered once.
(c) The record in the transaction table is called the transaction record.
(d) It is possible to add a record in the master table
5. Which type of relationship exists between a student and the subjects studied by
him/her?
(a) One-to-one
(b) One-to-many
(c) Many-to-many
(d) All of the above
6. Consider the following tables. Which type of relationship can be established
between the two tables?
(a) One-to-one
(b) One-to-many
(c) Many-to-many
(d) None of the above
Table 1: Item Table 2: Item_Category
Item_Code Category_Code
Item_Name Cat_Name
Price Item_Code
Qty Cat_Disc
Category_Code

7. Which of the following menus contains the Relationship option?


a) Edit
b) File
c) Tools
d) View
8. The list of tables to be added is displayed in the ____________ dialog box in the
Relationship Screen.
a) Add Tables
b) Add Databases
c) Both (a) and (b)
d) Neither (a) nor (b)
9. In the relationship design screen, the relationship between the two tables is done
using _____________operation.
a) Click
b) Double Click
c) Drag and Drop
d) Right click
10. Which of the following is NOT an option that can be used to maintain referential
integrity in a database?
a) No Action
b) Set NULL
c) Set Default
d) Set Value
B. State whether the following statements are True or False
1. Redundancy is preferred in a database.---False
2. In a table, a record for a particular entity should not be repeated.-- True
3. A single field should always have only one data value.--- False
4. If a table is edited, the records already entered in it are deleted.--- False
5. The record in master table should be entered before the corresponding record is
entered in the transaction table--- True
6. In one-to-many relationship, one specific record of the master table has more than
one corresponding records in the related transaction table.--- True
7. The Relationship option is present in the Widows menu.--- False
8. In a database, the referential integrity is maintained by the user.--- False
9. A relationship is always set between the tables based on a common field.--- True
10. If the master record is deleted, the transaction records will always be deleted.--- False
C. Fill in the blanks
1. A table to be edited is displayed in design view.
2. The most important prerequisite for setting a relationship between the two tables
is that there must be a Common field between them.
3. In one –to- one relationship, one specific record of a master table has one and only
one corresponding record in the transaction table.
4. One-to-Many is one of the most common types of relationship between the tables
in a database.
5. A record being entered in a transaction table must always exist in a master table.
6. The principle of referential integrity helps prevent missing data by keeping deleted data
from getting out of synch.
7. Creating relationship between tables restricts the user from entering invalid data in
the referenced fields.
8. Data integrity is maintained by DBMS .
9. A relationship between customers and products is an example of Many-to-Many
relationship.
D. Answer the following questions

1. Give any two advantages of relating a table in a database.


There are various advantages of relating tables in a database. Few of them are as
given below.
• A relationship can help prevent data redundancy.
• It helps prevent missing data by keeping deleted data from getting out of synch.
This is called referential integrity. We will study in detail about referential
integrity later in the chapter.
• Creating relationships between tables restricts the user from entering invalid data
in the referenced fields.
• Any updation in the master table is automatically reflected in the transaction
tables.

2. How is redundancy or inconsistency controlled in a database? Explain with


an example.
Relations are set up between the tables to control data redundancy and inconsistency.
This helps in proper maintenance of a database by checking that neither the records
are duplicated nor there is variable data value for a particular field in two or more
tables. If you set up relations between tables, then adding or updating a record in one
table reflect the changes in all the related tables.

3. Define referential integrity. Who maintains referential integrity in a database?


Referential integrity refers to the relationship between tables. Because each table in a database
must have a primary key, this primary key can appear in other tables because of its relationship to
data within those tables. When a primary key from one table appears in another table, it is called
a foreign key.

4. Differentiate between one to one relationship and one to many relationship. Give
suitable examples to explain your answer.

One-to-One relationship
In this type of relationship, one specific record of a master table has one and only one
corresponding record in the transaction table. For example, the record for Admission_No
in the master table of student will have only one corresponding record of same value of
Admission No in the transaction table of Student. This is because no two students will be
given same admission number. So relationship between Student and Admission number
will be one-to-one relationship.

One-to-Many relationship
In this type of relationship, one specific record of the master table has more than one
corresponding records in the related transaction table. For example, one teacher can teach
multiple students or multiple classes. So we can say that there is a one to may relationship
between a teacher and class or teacher and student.

5. Explain many to many relationship with an example.


In this type of relationship, there will be multiple records in the master table that
correspond to multiple records in the transaction table as well. Generally this type of
relationship is set when certain records have to be saved more than once in both the
related tables. For example, a teacher in a school may hold multiple responsibilities
such as class teacher, an activity in- charge or examination in-charge. For each
responsibility the teacher might be attached with multiple students. So this type of
relationship will be many to many relationship.

Chapter 11: Queries in Base


SUMMARY
• A query is used to retrieve and display data from one or more tables in a database.
• A specific search criteria is given to the DBMS to view the desired information.
• The result of the query is displayed in tabular form with field names in columns and the
records in rows.
• A query can be created in three ways.
■ Using a Wizard
■ In Design View
■ In SQL view
A. Multiple choice questions
1. Which of the following is refer to asking questions from the database?
(a) Report
(b) Table
(c) Query
(d) Database

2. Which of the following are the ways to design a query?


(a) Wizard
(b) Design View
(c) SQL
(d) All of the above

3. Which is a flexible way to create a query?


(a) Wizard
(b) Design View
(c) Both (a) and (b)
(d) Neither (a) nor (b)

4. Into how many parts is the query design window divided?


a) One
b) Two
c) Three
d) Four

5. Which of the following is NOT true about queries?


(a) It can be created using multiple tables
(b) Multiple queries can be created in a database
(c) A query can run multiple times
(d) A query once created cannot be edited
6. Which of the following is the shortcut key to run the query?
(a) F3
(b) F4
(c) F5
(d) F6

7. Which of the following functions can be performed on numerical data while


designing a query?
(a) Sum
(b) Minimum
(c) Maximum
(d) All of the above

8. In a Query Design wizard, which of the following buttons is clicked to move a field
from ‘Available fields’ list box to ‘Fields in the query‘ list box?
(a) >
(b) < 9
(c) 
(d) 

9. Which of the following relational operators can be applied to set the criterion while
designing a query in LibreOffice Base?
(a) >
(b) =
(c) !=
(d) Add Form

10. Which of the following dialog box is present when the Query Design window is
opened for the first time to design a query?
(a) Add Table
(b) Add Query
(c) Add Table or Query
(d) None of the above

11. Which of the following step is not performed if there is no numerical data to be
worked upon in a query?
(a) Selection of fields
(b) Giving Aliases
(c) Summarizing
(d) Selection of tables

B. State whether the following statements are True or False


1. You can run a query only once---False
2. A query cannot be created from multiple tables---False
3. The shortcut key to run a query is F5.---True
4. LibreOffice Base provides us with two ways to create a query. ---False
5. A query with numerical data cannot be saved. ---False
6. By default the query result is not sorted.----True
7. A query can be used to display the average value of a numerical field.---True
8. While designing a query, the criterion can be set on only one field. ---False
9. Alias is an alternative name for a field in a query.---True
10. In query Design window, the visible check box is selected by default. ---True
11. A query once created using a wizard can only be edited in the Design view. ---True

C. Fill in the blanks


1. A Query is a sort of question asked from a database.
2. The result of the query is displayed in Report form with field names in columns
3. A query can be created in Three ways.
4. The Query Design window is divided into Two sections.
5. The shortcut key to run the query is F5.
6. The conditions to filter the records are set in the Criterion row.
7. When a table is selected in a Query wizard, the corresponding fields are displayed in the
Available fields list box.
8. The result of the query can be displayed in ascending or descending order of any
particular field of the table.
9. At the most three search conditions can be given in the query wizard.
10. The last step of the Query wizard displays the entire overview of the query.
11. The design view is a more flexible method to create a query.
12. To edit any query, right click on the Q u e r y icon of the query that has to be edited.
13. In the Alias row of the Query Design grid, we can type the column heading that will be
displayed instead of field name when we run the query

D. Answer the given questions


1. Define a query? What is the need of creating a query in a database?
A database is used to store data in an organized manner so as to retrieve it easily and
accurately from database. To search for the desired record and to retrieve the desired
data, we have to give its specifications to DBMS. Such specifications are given to
the database in the form of queries. A query can give you an answer to a simple question,
perform calculations, combine data from different tables, add, change, or delete data from a
database.

2. Rearrange the steps given below so as to create a query using a wizard.


1. Give table name
2. Select the fields
3. Set the sorting order
4. Set the criterion
5. Give Alias

3. What all information is seen in the overview (last step) of the Query wizard?
It includes the following:
• Name of the Query – By default, the name of the query is Query_Events. If
desired, type the new name in the text box.
• The action to be performed after the wizard finishes – By default Display
Query option will be selected. Click and select the Modify Query radio button if
the query has to be edited in the Design view.
• Complete detail of the query – This section contains a summary about the query
that has been created

4. What is the use of Alias row in the Design grid of the Query Design window?
It can be used to display meaningful names in the output. For example, instead of
Winner, we would just like to display Winner Name. For this, type Winner Name
in the Alias text box under Winner column.

5. Name any four mathematical functions that can be applied to numerical data
in a query.
Count, Sum, Average, Minimum and Maximum.

6. Name the three ways of creating a query in LibreOffice Base?


A query can be created in three ways.
• Using a Wizard
• In Design View
• In SQL view

Chapter 12: Forms and Reports


SUMMARY
• A form is an object of the database that has a user friendly interface where data can be
entered and seen in an attractive and easy-to-read format.
• A form contains field controls arranged in a presentable and user friendly manner.
• Each field control consists of a label and the field value text box.
• There are two ways to create a form – Using a wizard, Using the Design View
• The forms control toolbar contains various tools to add or edit controls on the form.
• A report is used to present the retrieved data in an attractive and customized manner.
• We can create a report based on a table or a query or both.

A. Multiple choice questions


1. Which of the following toolbars contains the Label tool?
(a) Standard Toolbar
(b) Forms Controls Toolbar
(c) Records toolbar
(d) Formatting toolbar
2. The Record toolbar has the buttons to move to the
(a) first record
(b) second record
(c) last record
(d) all records
3. Which of the following is NOT true about forms?
(a) It is the front end for data entry
(b) It can contain only text fields
(c) Graphics can be inserted on the form
(d) It can contain only fixed number of records
4. Which of the following keys is pressed to select only textbox on the form?
(a) Alt
(b) Shift
(c) Ctrl
(d) Tab
5. Which of the following properties in the Properties: Label Field text box is used
to insert a tool-tip on the form?
(a) Tool Text
(b) Help Text
(c) Tool Tip
(d) Help Tip
6. Which of the following objects of LibreOffice Base is used to display data retrieved
from one or more tables in a presentable manner?
(a) Query
(b) Form
(c) Report
(d) Panel
7. Which of the following values of Date Format property is selected to view a
calendar on the form?
(a) Standard (short)
(b) Standard (long)
(c) Default
(d) Standard (Medium)
8. Which of the following commands on the Forms Control toolbar is used to toggle
between Design View and Form view?
(a) Design Mode
(b) Toggle Mode
(c) View Mode
(d) Print mode
9. Using which of the following objects in a database, can a report be generated?
(a) Tables
(b) Queries
(c) Both a and b
(d) Neither a nor b
10. Which of the following components open along with the Report Wizard?
(a) Report Builder
(b) Add Fields dialog box
(c) Both (a) and (b)
(d) Neither (a) nor (b)
B. State whether the following statements are True or False
1. Report is an object of a database but form is not.---False
2. We can choose the layout of the form.---True

3. We have to add all fields of the table on the form. ---False


4. There are two ways n which a form can be created.---True
5. A report is generated in a separate window.---True
6. Once a control is added on to the form, it cannot be re- positioned. ---False
7. The Record toolbar has the button to add a new record.---True
8. We can create a report only using a table. ---False
9. By default, the records in a report are sorted in descending order. ---False
10. We can group data based on a particular field in a report.---True
11. A report can have data only in row and column format. ---False
12. We can insert both date and time of generation of report.---True
13. A report once created cannot be edited. ---False

C. Fill in the blanks


1. A form can be used for Enter and view data .
2. Each field control consists of a label and field value.
3. A label is a piece of text that specifies the data that should be entered in the field
value text box.
4. By default the border of the field text value is displayed in 3D.
5. A tool tip is a small piece of text that is displayed when the mouse pointer is
placed on a particular control on the form.
6. The default orientation option for a report is landscape.
7. A Layout is the manner in which the labels, field values, titles etc. will be
displayed in the report.
8. The option to insert date and time in the report is present in Insert menu.
9. A Report Wizard contains Six steps.
10. A dynamic type of report changes automatically as the field values in the base
table or query change.

D. Answer the following questions


1. Give one difference between a form and a report.
Form: A form is an object of the database that has a user friendly interface where data can
be entered and seen in an attractive and easy-to-read format. A form contains field
controls arranged in a presentable and user friendly manner. Each field control
consists of a label and the field value text box.
Report: A report is used to present the retrieved data in an attractive and customized
manner. We can create a report based on a table or a query or both.

2. What is a field control with respect to forms?


A field controls are arranged in a presentable and user friendly manner. Each field
control consists of a label and the field value text box. A label is a piece of text that
specifies the data that should be entered in the field value text box. A field value text
box is linked to the respective field in the table. We may add all or selected fields from
the table on the form.

3. Which tool on the Forms Record toolbar is used to insert text on the form?
Label tool on the Forms Record toolbar is used to insert text on the form

4. Name the two ways to create a form in LibreOffice Base.


There are two ways to create a form – Using a wizard, Using the Design View

5.What is the difference between a static and a dynamic report?


Static reports give a one-time look at data they do not change as the field values in the base
table or query changes and are great for planning ahead or looking back. If you don’t want
automatic updation of the report, we should use static report.
Dynamic reports, on the other hand, keep updating that means as the field values in the base
table or query change, the report will also change automatically. and are perfect for making
quick decisions

6. Write the function of Forms Controls toolbar and Records toolbar.


The Records toolbar contains the navigation control buttons in the extreme left.
With the help of these buttons, we can traverse and view the records in the
file. As we move from one record to another, the record number in the record text
boxes changes.

This toolbar contains various controls that can be added to the form. An element that can
be part of a form. For example: checkbox, option button, input field etc

You might also like