0% found this document useful (0 votes)
32 views

Notes-Data-Base-Management-System

Class 10 IT data base notes I hope u will enjoy

Uploaded by

Ag Gamer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Notes-Data-Base-Management-System

Class 10 IT data base notes I hope u will enjoy

Uploaded by

Ag Gamer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Data Base Management System

Class 10
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.

Database
A database is a collection of logically related data items stored in an organised manner.

DBMS
The information being stored in a database can be added, modified, deleted or displayed
according to the requirements of the user. The software that is used to create, update and retrieve
data is known as database management system (DBMS).
It facilitates planning and maintenance of the database for the user.

Examples DBMS are MS-Access, Open Office or LibreOffice Base, Oracle, Ingress, MySQL,Sql
etc.

Advantages of DBMS:
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.
Reduce 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 reducing 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.
Security – it provides different level of security feature by providing passwordto the users and by
defining their role.
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.
Increases Efficiency – Since database tables are properly organised, saving, reading and
searching data can be carried out efficiently.
Increases Accuracy – Since data redundancy and inconsistency can be minimised in a database,
the data is retrieved accurately from the database.
Increases Validity – Properties of different data fields can be assigned when a database is
planned. So whether or not valid data is being entered can be checked at the data entry stage.
This increases the validity of the database.

Data Models
database can be designed in different ways depending on the data being stored. This structure of
database is known as data model

A data model consists of components for describing the data, relationships among them and the
constraints that hold data.

There are different data models such as hierarchical data model, network data model and
relational data model.

Hierarchical Data Model

In this model the data is organized into a tree like structure. The data is stored in the form of
records. All these records are linked to each other at various levels, thereby forming a hierarchy.

Network Data Model


In this 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.

Relational Data Model


This data model is based on the principle of setting relationships between two or more tables of
the same database. It is the most commonly used database model.

Relational Database Terminology


Entity – It is a real world object about which information is to be stored in a database. For
example, if we want to store information about an entity Student in a school, then we need to
have his admission number, roll number, name, father’s name, date of birth, etc. These details
associated with the entity are called attributes. Each entity is a collection of these attributes
associated with it. These attributes are represented in the
form of columns.

Table – A table is a collection of logically related records. It is organised as a set of columns,


and can have any number of rows.

Field or Columns or attributes – A field is the smallest entity in the database. A collection of
fields make a record, a collection of records make a table and a collection of tables make a
database.
Fields are individual record characteristics and are presented as columns within a table. Data
values are stored in a database as fields. A field holds the data values of one type of data for
several persons.

Data Values – Data values are the raw data represented in numeric, character or
alphanumeric form. Examples of data values are ‘Abhinav Bindra’, ‘26’ ‘shooting’,
“Chandigarh”, “10-12-2018”, etc.
Record or Row or Tuples – 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 record holds the data values of all the
fields for a single person or object in a table. For example, in the Employee table with the field
names as Name, Designation, Department, the data values of all the fields for an employee may
be (‘Abhinav’, ‘Manager’, ‘Finance’) and this forms one record. It is also knows as tuples.

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. The column or combinations of columns that form the primary
key have unique values. At any time, no two rows in the table can neither have same values for
the primary key nor can data value for such field be
left blank. In a table we can have only 1 primary key.
For example, in a student table, each student has a unique admission no., which forms the
primary key.
If, in a table we use more than one fields to identify a record, it is known as a composite
key.
For example, we may form a composite key consisting of fields roll no. and name.

Relational Database – A relational database is a collection of related tables.

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.

Candidate Key – All the field values that are eligible to be the primary key are the candidate
keys for that table. Such fields can neither be left blank nor can have duplicate values.

Alternate Key – Out of the candidate keys, one or two are made as primary keys. The others are
the alternate keys.

RDBMS – Relational Database Management System


The Relational Database Model was proposed in 1970 by E. F. Codd. Relational database model
is the most common type of database model.

Objects of an RDBMS
Table –A table is the basic unit of any DBMS. The data is first stored in tables
in row and column format. A column represents a field or an attribute while a row represents a
record.
Forms – 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 form consists of text boxes, labels, radio buttons, list boxes, check boxes
etc. that give a user friendly interface for entering data. The data entered through the forms is
stored in tables.
Queries – 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.
Reports – The output of a query may be displayed in the form of reports. The usual result of the
query is in the form of rows and columns. But if we want the report to be formal and in proper
layout, then we can use the Reports feature of RDBMS.

LibreOffice Base
LibreOffice Base is a free and open source DBMS.

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

Text Data Types


LONGVARCHAR 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.
Text (fix) - CHAR 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 number of
characters.
Text 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.

Numeric Data Type

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.
Date Data Type – This data type is used to indicate dates. For example 12/25/2019. It stores
data in mm/dd/yy format.
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.

Steps to create Database in LibreOffice


Step 1. 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.
Step 2. A Database Wizard opens. It allows you to create a new database or open
an existing database or to connect external database.
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
Database option to select the database to be 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’.
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.
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


The various components of 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.
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
Or
shortcut key Ctrl+O
Creating a Table using a Wizard
To create a table 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.
The Table Wizard dialog box will open. 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 Fields. The required fields from Available fields
box can be shifted one by one to Selected fields box using > button. 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. Then click on Next
button. It will move you to step 3. Set primary key. Let us set the CustomerID field to primary
key. Click on Next button, that will take you to the complete the process of creating table using
wizard and display the screen. This screen will give you three choices. By default the “Insert data
immediately” option selected.
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
will open that allow to enter the data in the Customer table.

Creating Table in Design View


In main Database window, click on the option Create Table in Design View in the Tasks Pane
and Table Design Window will be opened 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 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.
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 changed as per the
requirement and are used to control and validate the data that is to be entered.
Step 1. Type the first field name (EventId) in the Field Name column.
Step 2. The Field Type column contains a list box. As you click on the down arrow, it appears
and we 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 nextcolumn. 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
next row.
Step 6. Enter the next field by repeating steps 1,2 and 3. Repeat the process for adding all fields
in the table.

Setting the Primary Key


As we know 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. Select the Primary Key option from pop
up menu. 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 or press Ctrl + S.
A Save As dialog box is displayed. Enter the name of table and click on OK button.

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 the Open option from the drop down menu. The datasheet view of the table
will appear. 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.
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. 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 called as data entry. Enter 4-5 records in the Events table.

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. It indicates a current record of the table at any given time.
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.
• 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

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.
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. Clicking on
Yes button will finally delete the record, while clicking on the No button will not delete the
record.

Sorting Data in the Table


The 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.
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.
Step 3. The table will be sorted in the ascending order of points.

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.
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 selected in this dialog box. Click OK button once done.

Editing and Deleting Tables


To edit a table, open the Database User Interface window.
Selecting the Table object in Database Pane, the list of tables will be displayed in the Table
Area. Right click on the table name and select Edit option from the pop menu.
The design view window of the table will be displayed. Do the required modifications and save
the table.
To delete a table, right click on the table to be deleted, say Customer table and select the Delete
option from the pop up menu. A confirmation box to confirm for deletion of the table will be
displayed. Click on Yes button to finally delete the table.
To rename a table, right click on the table name in the Table Area and select Rename.. option
from the pop up menu. A cursor will appear. Type the new name and press the Enter key.

Relationships between Tables


Primarily three types of relationships can be set up between two tables in a relational database
These are:
(i) One-to-One
(ii) One-to-many
(iii) Many-to-Many

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.
Example one person can have only one ticket to get entry into a stadium to view the match.
One-to-Many relationship
This is one of the most common types of relationship between the tables in a database. As the
name says, in this type of relationship, one specific record of the master table has more than one
corresponding records in the related transaction table.
Example one person can sell multiple products.
Many-to-Many relationship
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.
Example relationship exists between a product and a customer.

Advantages of Relating Tables 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.
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.
Creating Relationships between Tables
To set up relationship between two tables follow the following steps.
Step 1. From main menu of LibreOffice Base, click on Tools >Relationships…
Step 2. The Relationship Design screen will appear. In the middle of the screen there is Add
Tables dialog box. Both the tables are listed in the dialog box.
Step 3. In the Add Tables dialog box, click table and then click Add button. Similarly add second
table to the Relationship Area.
Step 4. Click Close button to close the Add Tables dialog box. Observe that the tables added to
the Relationship Area along with all its field list.
Step 5. Select the common field in the two tables. It will be used to set a relationship between the
two tables. To create a relation between the two tables, we just have to drag the common field
from first table and drop it in second table. A line connectingboth the tables with the common
field appears on the screen. The line is labeled as ‘l’ on the primary key side and as ‘n’ on the
foreign key side. This type of relationship where one value of a table is associated with multiple
values in another table is a One-to-many relationship.
Referential Integrity
According to the principle of referential integrity, no unmatched foreign key values should exist
in the database.
LibreOffice Base gives us following four options to choose from to maintain referential integrity
in such cases.
• No action – This is the default option. This option states that a user should not be allowed to
update or delete any record in the master table if any related record exists in the transaction table.
• Update cascade – This option allows the user to delete or update the referenced field but along
with it all the related records in any of the transaction tables will also be deleted or updated.
• Set NULL – This option assigns NULL value to all the related fields if the master record is
deleted or updated.
• Set default – This option assigns any fixed default value to all the related fields if the master
record is deleted or updated.
To set the relationship properties double click on the relation line joining the two tables, A
Relations dialog box will open. By default the radio button with No action option will be
selected. Choose any of the desired option and click OK to set the referential integrity between
the two tables.

Queries in Base
Using a query, we can retrieve and display data from one or more tables in a database. This is
done by giving specific search criteria to the DBMS so that we are able to view the exact
information that we want.
LibreOffice Base allows us to create a query and even save it as an object in a database. This
helps us to run the query multiple times as and when required.

Creating a Query
A query can be created in three ways. In this chapter you will learn the first two methods to
create a query.
(i) Using a Wizard
(ii) In Design View
(iii) In SQL view
Creating a Query Using a Wizard
To create a query using a wizard, follow the following steps.
Step 1. Open the database. In the Database Design window, click on Queries button present in
the Database Pane on the left.
Step 2. In the Tasks Area, click on Use Wizard to Create Query… option. The Query Wizard
will start. It contains the Steps Pane on the left and the Query Details Area on the right.
Step 3. The first step of the wizard is to select fields from the respective tables.
Step 4. Select field from the list box and click the right arrow (>) button. The field name will
appear in the Fields in the Query list box. Repeat the process for other fields.
Note that once the fields are added they can be moved up and down in order by clicking ∧ and ∨
buttons present on the extreme right of the wizard. Clicking on » button moves all fields to
Fields in the Query area and « button moves all the fields back to Available fields area.
Step 5. Clicking on the Next button will display the screen to select the sorting order. It will set
the sorting order. The result of the query can be displayed in ascending or descending order of
any particular field of the table. Click on Next button.
Step 6. The next step is to set the search conditions or the criteria on the basis of which records
will be filtered from the table.
Three search conditions can be given at the most in the wizard. Click and
select the radio button with option ‘Match any of the following’ if any one of the given
condition are to be matched for filtering the records.
Step 7. Steps 4, 5 and 6 given in the Steps Pane deal with tasks like summarizing and
performing numerical calculations. Such steps are not required if there is no numeric field
involved in the query. So you can skip these steps and move directly to “Step 7. Aliases” of the
wizard.
Step 8. The next step to give alias name i.e. the column header name will be displayed when we
run the query. By default the field names will be displayed as column headers. Many times field
names are not user friendly, so an alias name which is more readable, is chosen to be displayed
in the query output.
Step 9. The last step of the Query wizard displays the entire overview of the
query. All the steps performed till now are shown in a summarised manner.

Creating a Query in Design View


Follow the following steps to create a query in Design View:
Step 1. Click Queries icon on the Objects Pane in the Database Window.
Step 2. Click Create Query in Design View… icon in the Tasks Pane. The Query Design
Window appears. In the middle of the window the Add Table
or Query dialog box is displayed.
Step 3. Click on the table to be used in the query and then click on Add button. Alternatively
double click on the Events table. The table will be added to the Tables Pane present at the top of
the Query Design window.
Step 4. Similarly add another table to Tables Pane of the Query Design window.
Step 5 . Click Close button in the Add Table or Query dialog box to close it.
Step 6. Next step is to select the fields. So in the list box of table, double click on field. Similarly
add the other fields form table. The field name along with the table name is displayed in the
Design grid present in the lower half of the Query Design window.Observe that the Visible
Check Box is by default selected. This means that all these three fields will be visible when you
run the query. If you do not want the data values for the particular field to be displayed, click to
deselect the respective check box.
Step 7. In the grid, there is a row titled Alias.It can be used to display
meaningful names in the output.
Step 8. By default, the data that is displayed as a result of the query is not sorted. To sort the
records in either ascending or descending order of a particular field, the Sort row is given in the
grid.
Step 9. Once the query is designed, click Run Query button on the toolbar or press F5 key. The
query result will be displayed in the Tables Pane area.
Step 10. Click on Save button to save the query. The Save As dialog box will be displayed.
Step 11. By default, the Query Name as Query1 will be displayed. Type a different name if
required. Click on OK button to save the query.
Editing a Query
To edit any query, click on the Query icon of the query that has to be edited. The list of queries
that have been created will be displayed in the Objects Area. Right click on the Query Name in
the Objects Area of the Database window. Select Edit option from the drop down menu.
The Query Design window will be displayed. Change the querys and save it.

Working with Numerical Data


We can even use certain mathematical functions to find the count, sum, minimum, maximum or
average of data values by using Function row,

Forms and Reports


LibreOffice Base provides the Form feature for data entry purposes.
The Report feature of OpenOffice Base helps to present the retrieved data in a user friendly,
understandable and formatted manner.
Both reports and forms are considered as objects of the database and are present in the Database
Pane of the LibreOffice Base User Interface.

Forms
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. For any database, it is the front end for data
entry and data modification. It displays the data in a layout design by us and not just in a simple
row and column format.
Primarily, 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. 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. In addition to field controls,
it may contain some additional text like titles, headings and names, graphics like logos, list boxes
and radio buttons.
There are two ways to create a form:
• Using a wizard
• Using the Design View
Creating a Form Using a Wizard
This is the simplest way to create a form. Follow the following steps.
Step 1. Open the database created in LibreOffice, and click the Form icon on the Database
Pane. Click the option Use Wizard to Create Form… on the Tasks Pane. The Form wizard
will open along with a blank database form in design view in the background.
Step 2. Select the tables or queries for which the form has to be created.
Step 3. After selecting the table, all the fields of the table will be listed in the Available Fields
list box
Step 4. As we require all the fields to appear in the Form, shift all the fields of table from
Available Fields list box to Fields in the Form list box using >> button. Click on Next button
to move forward.
Step 5. The next step consists of setting up a subform, i.e. a form within a form. You need to
check the checkbox “Add Subform” to add the subform. click Next button to proceed further.
Step 6. The wizard skips the next two steps that relate to the subform and moves on to step 5.
This step arrange controls i.e. to set up the design of the form. Four layouts are given in this step
of the wizard to choose from:
Columnar display with Labels on the left of the field value
Columnar display with Labels on top of the field value
Display as datasheet
Block display with labels on top
Select Layout type as you required.
Step 7. Click Next button.
Step 8. The step 6 of the wizard asks whether the form will be used for displaying data, entering
data or both. As we go with the default settings, so
we click Next button.
Step 9. The next step is to apply styles to the form being created. We can select the desired
background colour and border type of the field value text
boxes.
Step 10. Click Next button.
Step 11. The next step is to set the name of the form. By default the name of the form is same as
thename of the table.
Step 12. Click Finish button. The form with the first record will be displayed on the screen in a
separate window.
Modifying a Form
It is possible to modify the form in any manner once it is created. The modification can be to
change the background color, font size and color of the text or even positioning of various
controls in the form.
Follow the following steps to change the form.
Step 1. Open OpenOffice Base User Interface for database and click on Forms icon in the
Database Pane. The name of the saved form will be displayed in the Objects Area.
Step 2. Right click on the form name and select Edit… option. A separate Form Design View
will open.
Step 3. Make changes as your required in the form.
Save the form.

Adding a new record using a form


After you have finished designing the form, you can display or insert records using this form. For
this purpose, you have to shift from Design View to Form View by clicking on Design Mode
button on the Forms Controls toolbar. The Form View window appears with the first record
displayed in the respective text boxes.
To add a new record into the table using this form,
click on New Record button on the Records toolbar.
A blank form with the cursor blinking in the first text box will be displayed.
Observe that the record pointer shows the record number,Once the record is entered, click on
Save Record button on the Records toolbar to save the record in the table.
To delete any record, navigate to the record by either typing the record number in the Record
text box or by using the navigation buttons. Thereafter click Delete button on the Records
toolbar. The next record will be displayed in the form.
To toggle between Design view and Form view press Design Mode button on the Forms
Controls toolbar. When we create a form in Design View, all the controls
are placed on the form using various tools given in the Forms Control toolbar.

Reports
Using a report we can present the retrieved data in an attractive and customized manner. We can
create a report based on a table or a query or both. Preferably, if a report has to be generated
from multiple tables, a query should be created first and then that query can be used to generate
the report.
Follow the following steps to create a report.
Step 1. In the LibreOffice Base User Interface, click on the Reports icon in the Database
Pane.
Step 2. From the Tasks Pane, click Use Wizard to Create Report… option.
Step 3. The Report wizard along with two other windows will be displayed. One of the window
is Report Builder window and the other is Add Field dialog box.
Step 4. The first step of wizard is to select the table and the corresponding fields that we want to
display in our report. From the Tables or Queries list box, select the table.
Step 5. All the fields of the table will be listed in the Available Fields list box. Click >> button
to shift all the fields to Fields in report list box.
Step 6. Click on the Next button. The next step is to label the fields. By default, the column
headers will be displayed as labels or column headers for the field values. As fields names are
generally shortened, to change to more self-explanatory names, type the new names in the
respective text boxes.
Step 7. Click on the Next button. The next step is to group the data based on any of the fields in
the report. click on the Next button.
Step 8. The fourth step is to set the Sort options. If the data to be displayed in the report has to be
sorted in either ascending or descending order of a particular field, specify the field and sorting
order in this step.
Step 9. Click on the Next button to move on to the next step in which the layout of the report will
be selected.
Step 10. A layout is the manner in which the labels, field values and titles will be displayed in
the report. Out of various Layout options given, choose the desired layout, say Tabular and also
the layout of headers and footers (Default). You may also choose the orientation option
Landscape or Portrait in this step. Keep the default orientation option Landscape selected by
default.
Step 11. Click on the Next button to move to last step. Here we name the report and to specify
the manner in which we want to proceed after the wizard finishes. Type the name of the report.
By default the type of report is Dynamic. That means as the field values in the base table or
query change,
the report will also change automatically. If you don’t want automatic updation of the report,
choose the Static option. In this step, specify whether you would like to modify the report or
create the report once the wizard finishes.
Step 12. Click on Finish button to display the report.

Inserting other controls in the report


We can make Reports more presentable by inserting some more controls like
titles, author name, date of generation of report etc.
Right click on the Report name on the LibreOffice User Interface and then select the Edit…
option. The Report Builder window will open. In this window, various controls can be inserted
using the Report Controls toolbar.
Inserting Titles and Headings
To insert the title of the report, follow the following steps.
Step 1. Click on the Label tool available on the Report Controls toolbar.
Step 2. Bring the mouse pointer on the report. Click and drag to insert the label textbox.
Step 3. Double click on it to open the Properties dialog box. Type the title text that you want to
display in the Label property textbox and also to set the font style and size using the Font
property.
Step 4. Close the Properties dialog box. The report will be displayed with with the formatted
effects.
Similarly we can insert data and time logo or any other picture in Reports.

You might also like