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

DBMS-notes-2

LibreOffice Base is a free and open-source database management system available for Linux and Windows, allowing users to create and manage databases with various data types including text, numeric, date, currency, boolean, and binary. The software provides tools for creating tables, queries, forms, and reports, as well as managing relationships between tables to ensure data integrity. Users can create and manipulate data using a user-friendly interface, with features like sorting, primary keys, and referential integrity options.

Uploaded by

bingokoi98
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

DBMS-notes-2

LibreOffice Base is a free and open-source database management system available for Linux and Windows, allowing users to create and manage databases with various data types including text, numeric, date, currency, boolean, and binary. The software provides tools for creating tables, queries, forms, and reports, as well as managing relationships between tables to ensure data integrity. Users can create and manipulate data using a user-friendly interface, with features like sorting, primary keys, and referential integrity options.

Uploaded by

bingokoi98
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

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

TEXT DATA TYPE


Name type Text Description
Memo 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
CHAR Text (fix) 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.
VARCHAR Text Stores upto the specified length.
The number of bytes allocated depends on the number of characters
entered by the user.

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

Date Data Type – This data type is used to indicate dates and time
Currency Data Type –
The currency data type indicates the monetary values can be stored using currencies of various
countries. For example$100, £ 500 or Rs. 25.50.
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.
A table in LibreOffice Base can be created using a wizard or using the Design view.

SCREEN ELEMENTS

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.
Depending on the object that is selected, the respective Task Pane and Object Area displaying the
created object( Tables, Forms, Queries, Reports and application modules )appears.

Creating table in DESIGN VIEW


Field Name- name of field at the time of creation
Field Type -allows to assign data type
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 changed as per the requirement and
are used to control and validate the data that is to be entered.

To make a particular field as the primary key, place the mouse pointer before the field name and
right click.

A pop up menu appears- select PRIMARY Key

To set a composite key, i.e. a primary key consisting of two fields, keep the Ctrl key pressed and then
click on multiple fields to select them. Thereafter right click on selected fields and choose Primary
Key option from the pop up menu.

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.


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.

The record for a particular entity should neither be repeated nor different data values should appear
for a single entity in the database.

This is done by setting relationship between the tables of a database. The most important
prerequisite for setting a relationship is that there must be a common field(s) between the two
tables to create a relationship.

Once the relationship between the two tables has been set, the integrity of data will be managed by
the DBMS.

Types of Relationships
The type of relationship between any two tables in a database is based on the number of records
that are present in the transaction table corresponding to the master table. 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.
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

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-shopkeeper may sell multiple products to multiple customers. So many-to-many
relationship exists between a product and a customer.
• Relations are set up between the tables to control data redundancy and inconsistency.
• 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.

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.

1. 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.
2. 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.
3. Set NULL – This option assigns NULL value to all the related fields if the master record is deleted
or updated.
4. Set default – This option assigns any fixed default value to all the related fields if the master
record is deleted or updated.
Queries
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. The information may be retrieved from a single table or from multiple tables.
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.
A query can be created in three ways. In this chapter you will learn the first two methods to create a
query.
Using a Wizard
In Design View
In SQL view
Creating a Query in Design View
1. Open Database: Launch the Sports Day database.
2. Access Queries: Click the Queries icon in the Objects Pane.
3. Start Design View: Select "Create Query in Design View…" to open the Query Design
Window.
4. Add Tables:
o Add the Events table by clicking it and pressing Add, or double-clicking it.
o Add the EventCategory table similarly.
5. Close Dialog: Close the Add Table or Query dialog box.
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.

Overview of Forms
A form is an essential component of a database that provides a user-friendly interface for data entry
and modification. Unlike the standard row and column format of a table, forms present data in a
visually appealing and organized layout, making it easier for users to input and view information.
Key Components of a Form
• Field Controls: Each form contains various controls for data input, typically including:
o Label: Describes the data to be entered.
o Field Value Text Box: Where the user inputs the data.
Using Forms for Data Entry To enter new records:
1. Switch to Form View: Click the Design Mode button to toggle views.
2. Add New Record: Click the New Record button on the Records toolbar.
3. Input Data: Fill in the fields, then click Save Record to save the entry.
To delete records, navigate to the record and click the Delete button.

Reports
A report allows for customized presentation of data, making it visually appealing compared to
standard query outputs.

We have seen that the records that have been extracted using a query are displayed in a simple row
and column format. Instead, 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.

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.

You might also like