CHAPTER
9
Starting with LibreOffice Base
IntroductIon
In the previous chapter we have learned about
databases and database management system (DBMS).
LibreOffice Base is a free and open source DBMS. It can
be downloaded from www.libreoffice.org and is available
for both Linux and Windows operating systems. Data
has to be stored in an organised manner using a DBMS.
Also, the data being stored can be a text, number, date
or in any other form. So, we need to understand different
types of data that can be stored in a table. The data
types of the fields have to be specified while creating
tables in a database. Thereafter valid data is entered
and stored in a table.
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.
2023-24
The table below lists various data types that can store
textual data.
Table 9.1: 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
Text (fix) CHAR fixed 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
Text VARCHAR then 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.
Table 9.2: Numeric data types
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.
158 Domestic Data entry operator – class X
2023-24
Table 9.3: 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.
Starting with LibreOffice Base
Annual Sports Day is being held in Ruhi’s school in
which various sports competitions will be conducted.
Ruhi has been asked to create a database consisting of
various sports activities and its players. She decides to
create a database named, ‘Sports Day’ consisting of a
table ‘Events’ that contains the following fields:
Event_Id - to store Event identification
no like E001, E002, etc.
Event Name - to store name of the event
Date - to store date on which the
event will be conducted
Winner 1 Name - name of the winner
Winner 1 Points - points earned y the winner
Let’s Practice
What should be the data type of the fields of the table Events
that has to be created by Ruhi?
Which field should be made the primary key?
Once the table with its fields has been decided, Ruhi
decides to start creating the database using LibreOffice
Base. Follow the following steps to create the database.
Step 1. Start the LibreOffice Base as per the standard
process of starting the application in Windows
or Linux. In Windows, click Start > LibreOffice
or double click on the LibreOffice icon on the
desktop or Select Base Database option from
the bottom left panel.
Database ManageMent systeM Using LibreOffice Writer 159
2023-24
In Ubuntu Linux, click on the Base icon
located on the left panel as shown in Fig.
9.1(a) or click on the Show Applications as
shown in Fig. 9.1(b) to search for its icon. Type
Base in the search box. The LibreOffice Base
application icon will be displayed as shown in
Fig. 9.1(c). Click on the Base icon to open the
Base application.
Step 2. A Database Wizard opens as shown in Fig. 9.2.
It allows you to create a new database or open
an existing database.
Fig. 9.1(a): Clicking on
the Base icon on the left
panel to open Base
Fig. 9.1(b): Clicking on Show
Applications to search for Fig. 9.2: LibreOffice Database Wizard
installed packages
Tip: To open LibreOffice Base, you may search
the application Base on your computer and
click on the LibreOffice Base icon.
Step 3. Since we want to create a new database, so
click Create a new database radio button. If
any database that has already been created is
to be opened, then select Open an Existing
Fig. 9.1(c): Clicking on the
searched Base icon Database option to select the database to be
to open Base opened. Thereafter click Next button.
Step 4. The Next step gives the option to register our
database with LibreOffice.org. If we register the
database, then our database is made public
and hence can be accessed by other people.
As of now, we would not like to register, so we
click and select the radio button with option,
‘No, do not register the database’.
160 Domestic Data entry operator – class X
2023-24
Fig. 9.3: Decide How to Proceed After Saving the Database
Step 5. This step also asks whether
you want to open the
database for editing or
want to create a table using
the wizard. The option Open
the database for editing is
already selected.
Step 6. Click Finish button to
complete the database
creation process. The Save
As dialog box appears. Fig. 9.4: Save As dialog box
Step 7. Browse for the drive and folder where you want
to store your database.
Step 8. Type the name (Sports Day) in the File name
text box.
Step 9. Click Save button. The database in Base is
saved with an extension .odb. Also note that
if no name is given to the database, then it is
saved with a default name as NewDatabse.odb.
User Interface of Libre
Office Base
Once a database is created,
the screen as shown in
Fig. 9.5 appears. This is the
User Interface of Open Office
Base.
The various components
of the Base User Interface are
discussed below: Fig. 9.5: User Interface of LibreOffice Base
Database ManageMent systeM Using LibreOffice Writer 161
2023-24
• 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.
Opening a Database
To open an already created database, click
File > Open. The Open dialogue box appears
as shown in Fig. 9.6. Browse for the folder
where the database to be opened is stored.
Select the desired database and click on
Open button.
Tip: Use the keyboard shortcut key Ctrl+O
to open an already existing database.
Fig. 9.6: Opening database from menu option
Creating a Table
Once the database is created, we can start working
with objects of the database. First and foremost is the
creation of the table and then entering data in the table.
A table in LibreOffice Base can be created using a wizard
or using the Design view.
Creating a Table using a Wizard
A table can be created at the time of creating a
database or after creating database. To create a table
162 Domestic Data entry operator – class X
2023-24
at the time of creating a database in
database wizard, select the radio button
with option “Create tables using
the table wizard”, then click on the
Finish button.
Since our database is already open,
so we will select and click If the database
is opened we can select Use Wizard to
create a table option from the Tasks Pane.
The Table Wizard dialog box will open as Fig. 9.7: Table Wizard
shown in Fig. 9.7. Follow the instructions
in the wizard to create the table with
desired fields.
The Table Wizard of Base consists of
ready-made tables. Click the Sample
tables list box and select select any
one table, say Customer from the drop
down list.
After selecting the Customer table,
various fields appears under Available Fig. 9.8: Fields shifted from Available fields to
Selected fields
Fields. The required fields from Available
fields box can be shifted one by one to
Selected fields box using > button as
shown in Fig. 9.8. You can select all the
fields from Available fields to Selected
fields in one stroke by clicking on
>> button.
Click on Next button. It will move you
to step 2. Set types and formats as shown
in Fig. 9.9.
Fig. 9.9: Setting types and formats
Then click on Next button. It will move
you to step 3. Set primary key. Let us set
the CustomerID field to primary key as
shown in Fig. 9.10.
Click on Next button, that will take
you to the complete the process of
creating table using wizard and display
the screen as shown in Fig. 9.11. This
screen will give you three choices. By
default the “Insert data immediately”
option selected. Fig. 9.10: Setting primary key
Database ManageMent systeM Using LibreOffice Writer 163
2023-24
Click on the Finish button to complete
the process of creating the table and
using wizard. The next screen will
allow to enter the data as per the
selected fields. The data sheet view
interface as as shown in Fig. 9.12 will
open that allow to enter the data in the
Customer table.
Creating Table in Design View
Creating the table using wizard
Fig. 9.11: Creating table using wizard restricts us to use the same fields in the
per-designed tables. It may not solve
the purpose in real scenario, as we
may require to create a table with the
different fields for our purpose. Creating
tables using Design View gives us more
flexibility to do our work.
To create table using Design View, in
Fig. 9.12: Datasheet view of Customer table
main Database window, click on the
option Create Table in Design View
in the Tasks Pane and Table Design
Window will be opened as shown in
Fig. 9.13.
The screen is broadly divided into
two sections or horizontal panes.
The upper half consists of a grid
structure with three columns Field
Name, Field Type and Description.
• Field Name – It is the name of the
Fig .9.13: Creating Table in Design view
field assigned at the time of creation of
table.
• Field Type – It allows to assign a data type to the
field.
• Description – It allows to describe the purpose
of the field. It is not the part of database table,
but it is meant for the user to understand the
purpose of the field. We may or may not enter
field description.
The Field Properties pane is located at the bottom half
of the window. It displays the field properties assigned
by the database designer. These properties can also be
164 Domestic Data entry operator – class X
2023-24
changed as per the requirement and are
used to control and validate the data that
is to be entered.
Let us help Ruhi to create a table
named Events using in the option Create
Table in Design view in the Sports Day
database. Follow the follow the following
steps to do so.
Step 1. Type the first field name (EventId)
in the Field Name column. Press
Tab key. The cursor moves to the
second column i.e. Field Type.
Step 2. The Field Type column contains
a list box. As you click on the
down arrow, it appears and we Fig. 9.14: Selecting data type for field
can select the desired data type
from the list box. Select the
datatype (Varchar).
Step 3. Observe that certain properties
appear in the Field Properties
Pane as the data type is selected.
Some of the properties are Entry
required, Length, Default value,
Format example. Set the desired
properties for the entered field.
Step 4. Press Tab key to move to the next
column. Add any description if
you want in the third column.
Step 5. Once the properties for the field
are set, press Tab key to move to Fig. 9.15: Fields entered using Creating Table
next row. in Design View
Step 6. Enter the next field by repeating steps 1,2 and
3. Repeat the process for adding all fields in the
table. Fig. 9.15 shows the Design View with all
the fields.
Setting the Primary Key
As you have learned that every table must have a primary
key that uniquely identifies a record in the 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.
Database ManageMent systeM Using LibreOffice Writer 165
2023-24
Select the Primary Key option from pop
up menu as shown in Fig. 9.16. A key icon
appears before the field name indicating
that it is a primary key.
Saving a Table
After creating the table you need to save it
on the disk. To save the table click on the
save button or follow menu option File >
Save As. A Save As dialog box is displayed
as shown in Fig. 9.17. Enter the name of
table and click on OK button.
Fig. 9.16: Assigning primary key
More to know
To set a composite Fig. 9.17: Saving a table
key, i.e. a primary
key consisting of two Tip: Press Ctrl + S to save the table or click Save icon
fields, keep the Ctrl from the toolbar. If the table is being saved after making
key pressed and then some changes, simply select File-> Save option.
click on multiple
Once the table design is complete, click on Close
fields to select them.
Thereafter right click button on the toolbar to return to the Database screen.
on selected fields and The name of the table will appear in the Tables Object
choose Primary Key Area as shown in the Fig. 9.18.
option from the pop
up menu.
Fig. 9.18: Event table added to the database
Entering Data in a Table
To enter data in the table, double click on the created
table Events icon in the Tables Object Area on the
database screen. Alternatively, we can open the table
by right clicking on the desired table and then selecting
166 Domestic Data entry operator – class X
2023-24
the Open option from the drop
down menu. The datasheet view
of the table will appear as shown
in Fig. 9.19. It displays the field
names in the top row. These fields
are displayed in the same order
as they were added while creating
the table. Fig. 9.19: Datasheet view of Events table
If the number of fields are more
and cannot fit in the single row, you
can use the horizontal scroll bar to
view all the fields. The cursor will
be blinking in the second row. Start
typing the data value for each field.
Use Tab to move to next field. Once
all the data values are entered for
a single record, the cursor moves
to the next record. This process is Fig. 9.20: Data entry in Event table
called as data entry. Enter 4-5 records in the Events
table as shown in Fig. 9.20.
Navigating through the Table
The black pointing arrow ( )just before the field name
is the record pointer. To navigate through various
records of the table, we use the navigation box present
at the bottom of the datasheet window as shown in
Fig. 9.21. It indicates a current record of the table at
any given time.
Fig. 9.21: Navigation box
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.
Database ManageMent systeM Using LibreOffice Writer 167
2023-24
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
Fig. 9.20 shows the datasheet view after entering
four records in the table. Note that the record pointer is
on fourth record, the Navigation Bar shows the “Record
4 of 4”.
Editing Data
To edit or modify the previously entered data simply
place the cursor on the field value that has to be edited
to edit and enter the new value.
The Edit icon ( ) appears before the record that is
being edited. This icon is displayed till the table is saved
after making the required changes. Press Esc key to
cancel the corrections made and restore the original
contents.
Deleting Records from Table
To delete any record from the table, open the table
and select the record to be deleted. The record can
be deleted by pressing the Del key from the keyboard
or selecting the Delete Record option from the Edit
menu. Alternatively a record can also be deleted by right
clicking on the record and clicking on the Delete Rows
option from the pop up menu.
Attempting to delete the record will display the
Confirmation box as shown in Fig. 9.22. Clicking on
Yes button will finally delete the record, while clicking
Fig. 9.22: Delete record alert
on the No button will not delete the record.
Sorting Data in the Table
Data in a table can be arranged in ascending or
descending order. This process of arranging the records
in particular order on any filed is called as sorting.
Follow the following steps to sort the table.
Step 1. Open the Event table in datasheet view and
select the field on which you want to sort.
Fig. 9.23: Sorting the Event table Fig. 9.23 shows that the field “Points” is selected
on Points field to sort the records in ascending order.
168 Domestic Data entry operator – class X
2023-24
Step 2. From the tool bar click Sort Ascending
icon if the table has to be sorted in ascending
order of selected field. Alternatively select Sort
Descending icon if the table has to be sorted
in descending order of selected field. Fig. 9.24: Event table after
Step 3. The table will be sorted in the ascending order sorting on Points field
of points as shown in Fig. 9.24.
Sometimes we may need to sort the table based on
more than one fields. In such case, click Sort icon
on the toolbar. The Sort Order dialog will be displayed
as shown in the Fig. 9.25.
Select the appropriate field name and field value
according to which the records are to be sorted. Choose
the order of sorting ascending or descending as required
from the Order drop down box. Multiple fields may be Fig. 9.25: Sort Order dialog box
selected in this dialog box. Click OK button once done.
Closing LibreOffice Base
To close the application window of LibreOffice Base,
click on the File > Close or click on the cross (x) button
of the LibreOffice Base window.
Let’s Practice
There are 5 houses in Ruhi’s school – Ganga, Yamuna, Satluj,
Beas and Narmada. Once student can participate from each
house in a particular event. Create a table Participants with
following fields.
1. Event_Id
2. Event Name
3. Ganga
4. Yamuna
5. Satluj
6. Beas
7. Narmada
Also add minimum five records in the table.
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.
Database ManageMent systeM Using LibreOffice Writer 169
2023-24
notes • 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.
Practical Exercise
Ananthu wants to create a directory containing data – Serial
No, Name, Mobile Number, Email id, Date of birth of his friends.
Create a table using LibreOffice Base. Make Serial No as primary
key. Enter minimum 5 records in the table. Sort the table in
alphabetical order of name.
Check Your Progress
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.
170 Domestic Data entry operator – class X
2023-24
5. Which of the following methods can be used to create a notes
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.
2. Memo data type can be used to store descriptive data.
3. A Boolean data type can have two or more than two values.
4. We cannot store audio data in LibreOffice Base.
5. The properties of a field change according to the data
type selected.
6. Field description may or may not be entered while
designing a table.
7. is pressed to move to the last record.
8. appears when the record is being edited.
Database ManageMent systeM Using LibreOffice Writer 171
2023-24
notes 9. A table once created in a database cannot be edited.
10. Sort dialog box can only help to sort data in
ascending order.
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 _____________ data is a combination of letters, numbers
or special characters.
3. ________ data type can be used to store Aadhar number.
4. The __________ data type used to store digitized images.
5. The shortcut key to save a table is _______________.
6. ______________ on the Base Interface Window displays
information about the type of view of the object in the
database.
7. A __________ icon appears before the field name indicating
that it is a primary key.
8. The data can be entered in a table only in __________ view.
9. The black pointing arrow just before the field name in a
table is called ____________.
10. The process of arranging the records in particular order
on any filed is called _______________.
D. Answer the given questions
1. Differentiate between:
(a) Memo and Varchar data type
(b) Number and Decimal data type
(c) Design View and Datasheet view of a table
2. Name the menu items present on the Base User Interface,
3. Label the components – Title Bar, Database Pane, Tasks
Pane, Status Bar of the LibreOffice Base User Interface.
4. How can we define a primary key in a table?
5. Write steps to sort the table in descending order of
primary key.
6. What is the use of navigation box with respect to tables in
a database?
172 Domestic Data entry operator – class X
2023-24