Operation Manual

What is Base?
A data source, or database, is a collection of pieces of information that can be accessed or
managed by LibreOffice. For example, a list of names and addresses is a data source that could
be used for producing a mail merge letter. A shop stock list could be a data source managed
through LibreOffice.
Note
LibreOffice uses the terms “Data Source” and “Database” to refer to the same thing,
which could be a database such as MySQL or dBase or a spreadsheet or text
document holding data.
This chapter covers creating a database, showing what is contained in a database and how the
different parts are used by LibreOffice. It also covers using the Base component of LibreOffice to
register other data sources. A data source can be a database, spreadsheet, or text document.
Note
LibreOffice Base uses the HSQL database engine. All of the files created by this
engine, including the database forms, are kept in one zipped file.
A database consists of a number of fields that contain the individual pieces of data. Each table of
the database is a group of fields. When creating a table, you also determine the characteristics of
each field within it. Forms are for data entry into the fields of one or more tables which have been
associated with the form. They can also be used for viewing fields from one or more tables
associated with the form. A query creates a new table from the existing tables based upon how you
create the query. A report organizes the information from the fields of a query into a document
according to your requirements.
Caution
The database in LibreOffice requires Java Runtime Environment (JRE). If you do not
have it on your computer, you can download it from www.java.com and install it
following the instructions on the site. It should be Java 6.0 or higher and 7.0 is
preferred. In LibreOffice, use Tools > Options > LibreOffice > Java to register
Java.
Windows' version of JRE can not be used, while there are other versions that can.
Base creates relational databases. This makes it fairly easy to create a database in which the
fields of the database have relationships with each other.
For example: Consider a database for a library. It will contain a field for the names of the authors
and another field for the names of the books. There is an obvious relationship between the authors
and the books they have written. The library may contain more than one book by the same author.
This is what is known as a one-to-many relationship: one author and more than one book. Most if
not all the relationships in such a database are one-to-many relationships.
Consider an employment database for the same library. One of the fields contains the names of
the employees while others contain the social security numbers, and other personal data. The
relationship between the names and social security numbers is one-to-one: only one social security
number for each name.
If you are acquainted with mathematical sets, a relational database can easily be explained in
terms of sets: elements, subsets, unions, and intersections. The fields of a database are the
elements. The tables are subsets. Relationships are defined in terms of unions and intersections of
the subsets (tables).
To explain how a database works and how to to use it, we will create one for automobile expenses.
216 | Getting Started with LibreOffice 4.0