2. Database concepts using
LibreOffice Base:
⚫DBMS concepts.
⚫Various tableoperations.
⚫Queryand formcreation.
⚫Reportgeneration.
⚫Introduction torelational data model
3. DBMS concepts
⚫ Data means all kinds of facts, figures and details related to people, places,
things or events. Data may be in any form. It may be written, oral,
computerized or non-computerised. Data in it’s original form may not be of
much use. Data must be processed in a properway to generate the useful and
meaning information.
⚫ Information is the required result obtained from processing of the data.
Information is the output generated through processing of raw data.
Information is important because it forms the foundation fordecision making.
⚫ Database is a collection of related data items stored in an organized manner A
Databaseconsist of different objects like table, query, form and report. Table is a
collection of related data. Query is used to retrieve information from database.
Form is used to collect the information from user. Report is used to represent
thedata in printed form.
Database Management System Software (DBMS) :
⚫ A database management system is a software designed to define, manipulate,
retrieveand managedata in adatabase. It provides various functions that allow
entry, storageand retrieval of largequantities of information and provide ways
to manage that information. Italsodefines rules tovalidate and manipulate the
data.
4. How to start?
⚫Tostart base, Install Libreoffice from it's official
website and click on start "Start " All programs "
Libreoffice " Libreoffice Base. A database wizard will
be started. Tocreate new databaseuser have toselect
'Createa new Databaseand click on 'Next' button. In
'Save and Proceed' step click on 'Finish'. A 'Save As'
window will appear on the screen, select location to
save thedatabase
⚫"Type name fordatabase in 'File Name' box then click
on 'Save' button. By default extension of Base file is
'.odb'
6. Screen of Base consist of following
parts :
⚫ Title Bar : It is the topmost barpresenton thescreenof Base. Itdisplays
icon of theapplication, nameof the file and nameof theapplication. By
default it displays 'Filename.odb – Libre Office Base'. It consist of three
buttons on rightcorneras minimize, maximize/ restoreand close.
⚫ Menu Bar : It is present below Title bar. It displays names of different
menusas File, Edit, View, Insert,Tools, Windows, Helpetc. Each menu
consist of a drop-down list (Pop-up) of various options related to that
particular menu.
⚫ Standard Tool Bar : Standard tool bar consist of different icons which
are used for standard operations (regularly repeating operations) like
opening a newdocument, saving adocument, printing adocument, cut,
copy, paste, undo, redoand many more.
⚫ Working Area : Rest of the part below standard tool bar is called as
working area. It is divided into two panes- Left pane and right pane. Left
pane displays name of database objects like tables, queries, forms and
reports. Right panedisplays activities related to that particularobject.
7. Table
Table is a basic unit for storing data in database. Tables are organised in the
form of columns and rows. Before creating a table user should first decide the
entity. Entity is any real world object about which data is to be stored. Each
entity has collection of attributes associated with it. Forexample student is an
entity which has attributes like roll number, name, address, standard, date of
birth etc. Attributes of an entity are stored in the form of columns. The
information stored under each column forms a row which is called as
record/tuple.
RollNumber N
a
m
e Address Std Date of Birth
1701 VinayNaik Shubh-Labh
Appartment
XII 12-10-2003
1702 ShlokPawar ABStreet XII 4-8-2003
Fields
Records
8. Data types in Base :
⚫Data types available in Base can be divided into three
categories as alphanumeric, numeric, calender (dateand
time) and binary type.
D a t a T y p e N a m e D e s c r i p t i o n
T i n y I n t e g e r
[ T I N Y I N T ]
S t o r e s s m a l l I n t e g e r .
B i g I n t [ B I G I N T ]
S t o r e s B i g I n t e g e r ( h o p p i n g w h o l e n u m b e
r a r e l y u s e d
I m a g e [ L O N G V A R B I N A R Y ] S t o r e s I m a g e .
B i n a r y [ V A R B I N A R Y ]
S t o r e s b i n a r y i n f o r m a t i o n o f v a r i a b l e
l e n g t h .
B i n a r y ( f i x ) [ B I N A R Y ] S t o r e s b i n a r y d a t a o f f i x e d l e n g t h .
M e m o [ L O N G V A R C H A R ]
S t o r e s d e s c r i p t i v e t y p e o f i n f o r m a t i o n i.e
l a r g e b l o c k o f t e x t l i k e a r t i c l e t e x t.
T e x t ( f i x ) [ C H A R ] S t o r e s f i x s i z e d t e x t.
9. D a t a T y p e N a m e D e s c r i p t i o n
N u m b e r [ N U M E R I C ] S t o r e s a n u m b e r w i t h o r w i t h o u t d e c i m a l
p o i n t . B a s e w i l l
d i s p l a y d a t a t y p e ’ s o r i g i n a l l e n g t h a n d all
t o s e t d e c i m a l
p l a c e s a f t e r d e c i m a l p o i n t i n d e s i g n v i e w
t a b l e . it i s u s e d w h e n a c c u r a c y i s r e q u i r e d
D e c i m a l [ D E C I M A L ]
I n t e g e r [ I N T E G E R ]
S t o r e s I n t e g e r m o s t c o m m o n l y u s e d d a t a
t y p e .
S m a l l I n t e g e r [ S M A L L I N T ] S t o r e s i n t e g e r
F l o a t [ F L O A T ] S t o r e s a n u m b e r w i t h d e c i m a l p o i n t .
R e a l [ R E A L ] S t o r e s a n u m b e r w i t h o r w i t h o u t d e c i m
p o i n t . It is u s e d w h e n a p p r o x i m a t e r e s u l t
r e q u i r e d
D o u b l e [ D O U B L E ]
T e x t [ V A R C H A R ] S t o r e s v a r i a b l e s i z e d t e x t .
T e x t [ V A R C H A R _ I G N O R E C A S E ] A c a s e i n s e n s i t i v e v e r s i o n .
Y e s / N o [ B O O L E A N ] S t o r e s b o o l e a n t y p e o f d a t a .
D a t e [ D A T E ] S t o r e s d a t e i n m m / d d / y y f o r m a t .
T i m e [ T I M E ] S t o r e s t i m e i n h h : m m : s s f o r m a t
D a t e / T i m e
[TIMESTAMP]
S t o r e s d a t e a s w e l l a s t i m e .
O t h e r [ O T H E R ] S t o r e s a n y o t h e r o b j e c t .
10. A)Creating a Table :
Steps areas follows :
Open adatabaseand from left paneclick on 'Tables' icon
From right paneclick on 'Create table in Design View‘
A window will appearon the screen, type 'Field Name‘
Select 'Field type' ( field type means typeof data to be stored in
that field e.g. 'Name' Field should have 'Text' asa Field Type)
In nextcolumn type thedescription about the field.
In the bottom section in 'Field Properties' select 'Yes' for 'Entry
required' property
Youcan setdefaultvalue and for numeric field typesyou can set
decimal places also. In this waycreateall fields.
Rightclick on the small button presenton the leftside of the field
name which is decided as primary key and select 'primary key'
option.
Click on 'Save' icon tosave the table, type name forthe table, Click
on 'ok'.
11. B) Inserting records in the table :
⚫Stepsareas follows :
⚫Open adatabase , from left paneclick on 'Tables' icon.
⚫In the rightpane from bottom partdoubleclick on the
nameof Table in which data is to be inserted.
⚫A window will appearon the screen, typedata undereach
field and
⚫completeone record, in thiswayadd some records.
icon to makeedit modeoff, awindow
⚫Click on 'Edit Data'
will appear.
⚫Click on 'Yes' iconand click on 'close' button.
⚫For inserting a new record 'Edit Data' must beon.
12. C) Editing a record in the table :
⚫Steps areas follows :
Double click on the required table.
Click on the required record forediting.
Do necessarychanges.
Click on 'Edit Data' icon to makeedit modeoff, Click on 'Yes'
and click on close button.
D) Deleting a record from the table :
Stepsare as follows :
Doubleclick on the table , click on the record which is
to bedeleted
Click on 'Edit' menu, select 'Delete Record' option
Click on 'Yes' button todelete it permanently.
13. Query Creation
A Query is a question asked within the database environment. For example
how many students are in XII standard. Query displays subset of data
contained in various tablesof database Query is used to retrieverecords from
the table.
Steps tocreate query byusing wizard :
o Open adatabase , from left pane click on 'Queries' objects.
o From right pane click on 'Use Wizard to Create Query' (Wizard means step by
step instructions provided by thecomputer tocomplete a task. )
o Select nameof 'Table' and shift fields from 'Available fields' list to 'Fields in the
query' list byclicking on arrow button and click on 'Next' button.
o Selecta field forsorting the records, select the orderascending/ descending
then click on 'Next' button.
o In next step the user has to selectsearchcondition (more than one search
conditions can also be selected) select the field, select thecondition, typevalue
forcondition then click on 'Next' button.
o If you want to replaceoriginal field nameswith some new field names in the
output of thequery, then type aliases foreach field and click on 'Next' button
o Type name for thequery and Click on 'Finish' button.