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

Database Management

The document explains the concepts of data and information, highlighting the importance of processing data to generate meaningful information. It details the structure and advantages of Database Management Systems (DBMS), including organized storage, data analysis, and security. Additionally, it covers different data models, types of relationships between tables, and the components of a relational database, emphasizing the significance of maintaining referential integrity.

Uploaded by

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

Database Management

The document explains the concepts of data and information, highlighting the importance of processing data to generate meaningful information. It details the structure and advantages of Database Management Systems (DBMS), including organized storage, data analysis, and security. Additionally, it covers different data models, types of relationships between tables, and the components of a relational database, emphasizing the significance of maintaining referential integrity.

Uploaded by

Eric Immanuel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Data

The raw facts constitute 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. This data must be processed by any
computing machine in a proper way to generate
the useful and meaningful information. The
examples of data are marks scored by the
students, weights, prices, costs etc.

Information
Information is the processed or organized form of
data. If data is not correct or accurate, the
information obtained by processing such data
may not be correct. For example, marks obtained
by students and their roll numbers is the data,
while the report card/sheet is the information.
Other forms of information are pay-slips,
schedules, worksheet, bar charts, invoices,
account returns etc

DBMS OR Database Management System:


A database is a collection of logically related data
items stored in an organised manner. 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. Some of the common
examples of DBMS are MS Access, Open Office or
LibreOffice Base, Oracle, Ingress, MySQL.

The advantages of DBMS:


• 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.
• 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.
• Minimal 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 minimising 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.
• 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.
• Security – Unauthorised access can be
controlled by assigning passwords to the users.
The data might be translated in such a manner
that unauthorised users are not able to read it.
This is known as encryption.

A database can be designed in different ways


depending on the data being stored. This
structure of database is known as data model
that describes the manner in which data will be
stored and retrieved. 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. A record is a collection of fields and its
data values. 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


Relational Database Model The Relational
Database Model was proposed in 1970 by E. F.
Codd. Relational database model is the most
common type of database model. The data
elements are stored in different tables made up
of rows and columns. The data in different tables
are related through the use of common fields. So
relations are set between tables based on
common fields. That is why this model is termed
as relational database model.

Entity – It is a real world object about which


information is to be stored in a database. 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- 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.

Record or Row – 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.

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.

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.

Objects of an RDBMS An object in a database is a


structure or a feature that is used to store,
represent or retrieve data. In fact a database is a
collection of these objects that work on multiple
sets of data related to each other. Various objects
in a database are as discussed below:
• Table – As mentioned before, 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.

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

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

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.

The various components of the Base User


Interface are discussed below:
• 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.

CREATE TABLES: Tables are the basic building


blocks of a database. You store the data in the
database in the form of tables.
There are different ways to create a table:
a) Use Wizard To Create Table: The following are
the steps to create a table:
1) Click on Tables > Use Wizard to Create Table
2) Click the Select Fields > Choose Category >
Select the table > Click on Next Button.
3) Select the fields as per the requirements. Click
on the Next button
4) Set the data types and properties of the
selected fields. Click on the Next Button
5) Set the Primary Key and Click on the Next
Button
6) The window to rename the table will open. A
user can either go ahead with the same table
name or change it.
7) Click on Finish to insert the data in the table.

b) Creating a table using Design View


1) Click on Create Table in Design View.
2) Specify the field name and data type of the
field.
3) Save the table by clicking on File > Save
4) Specify the table name. The default name is
Table 1. Click OK.
5) An alert appears if there is no primary key in
the table. 6) Click yes set the primary key and
finally save the table.

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
• 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.
The various components of Navigation Box are as
follows:
• Record Selector Box – This 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.
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.

Editing A Table
Editing a table involves the task such as adding a
new field or removing any field in a table or to
alter any of the field properties. 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.

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

Renaming A 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

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.
For Ex: The record for Admission_No in the
master table (Student_Detail) will have only one
corresponding record of same value of Admission
No in the transaction table of Student_ Result.
This is because no two students will be given
same admission number.
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.
For Ex: one teacher can teach multiple students
or multiple classes, or one person can sell
multiple products. So we can say that there is a
one to many relationship between a teacher and
class or teacher and student or seller and
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.
Generally this type of relationship is set when
certain records have to be saved more than once
in both the related tables.
For Ex: a teacher in a school may hold multiple
responsibilities such as class teacher, an activity
in charge or examination in-charge. For each
responsibility the teacher might be attached with
multiple students. So, this type of relationship
will be many to many relationship.
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.

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.

The raw facts constitute 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. This data must be processed by any
computing machine in a proper way to generate
the useful and meaningful information. The
examples of data are marks scored by the
students, weights, prices, costs

You might also like