Database

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Database and Database Management System

Database
A database is a collection of related files and is usually integrated, linked or cross-referenced to one
another.
Hierarchy of database as under:
 Database: This is a collection of Files.  File: This is a collection of Records.
 Record: This is a collection of Fields.
 Field: This is a collection of Characters.
 Characters: These are a collection of Bits.

Database Management Systems (DBMS)


Every enterprise needs to manage its information in an appropriate and desired manner. The enterprise has
to do the following for this:

• Knowing its information needs;


• Acquiring that information;
• Organizing that information in a meaningful way;
• Assuring information quality; and
• Providing software tools so that users in the enterprise can access information they require.

To achieve the above objectives, we use Data Base Management System. Let’s think of a DBMS as
basically just a computerized record keeping. Database is just an electronic filing cabinet i.e., a collection
of computerized data files. Even this simple system helps us do various operations on the files, such as:

• Adding new files to database,


• Deleting existing files from database,
• Inserting data in existing files,
• Modifying data in existing files,
• Deleting data in existing files, and
• Retrieving or querying data from existing files.

DBMS are software that aid in organizing, controlling and using the data needed by the application
programmer. They provide the facility to create and maintain a well-organized database. Applications
access the DBMS, which then accesses the data. Commercially available Data Base Management Systems
are Oracle, My SQL, SQL Servers and DB2 etc.

B
DATA
M

User S Database
User communicate to the DBMS Different programmes to insert
Interface for the efficient and faster delete, update and query database
Way of for her requirement. For information
Components of DBMS
DBMS have several components, each performing very significant tasks in the database management
system environment. Below is a list of components within the database and its environment . There are six
major components of database system:

1. Data: Data is defined as collection of fact in raw. It is not in directly useful and some processing to
become useful.
2. Hardware: Hardware is a term used for physical components of the computer system (such as CPU, VDU
etc.). Depending upon size of the database, suitable hardware is selected.
3. Software: This is the set of programs used to control and manage the overall database. This includes the DBMS
software itself, the Operating System, the network software being used to share the data among users, and the
application programs used to access data in the DBMS.
4. Procedures: Procedures refer to general instructions to use a database management system. This includes
procedures to setup and install a DBMS, to login and logout of DBMS software, to manage databases, to
take backups, generating reports etc.
5. Database Access Language: Database Access Language is a simple language designed to write
commands to access, insert, update and delete data stored in any database.

Structured Query Language (SQL) as we all know is the database language by the use of which
we can perform certain operations on the existing database and also we can use this language to
create a database. SQL uses certain commands like Create, Drop, and Insert etc. to carry out the
required tasks.
These SQL commands are mainly categorized into five categories as:
i. DDL – Data Definition Language
ii. DQL – Data Query Language
iii. DML – Data Manipulation Language
iv. DCL – Data Control Language
v. TCL – Transaction Control Language
(i) DDL (Data Definition Language): DDL or Data Definition Language actually consists of
the SQL commands that can be used to define the database schema. It simply deals with
descriptions of the database schema and is used to create and modify the structure of
database objects in the database.
Examples of DDL commands:
• CREATE – is used to create the database or its objects (like table, index, function, views,
store procedure and triggers).
• DROP – is used to delete objects from the database.
• ALTER-is used to alter the structure of the database.
• TRUNCATE–is used to remove all records from a table, including all spaces allocated
for the records are removed.
• COMMENT –is used to add comments to the data dictionary.
• RENAME –is used to rename an object existing in the database.
(ii) DQL (Data Query Language): DQL statements are used for performing queries on the
data within schema objects. The purpose of DQL Command is to get some schema relation
based on the query passed to it.
Example of DQL:
 SELECT – is used to retrieve data from the database.
(iii) DML (Data Manipulation Language): The SQL commands that deals with the
manipulation of data present in the database belong to DML or Data Manipulation
Language and this includes most of the SQL statements.
Examples of DML:
• INSERT – is used to insert data into a table.
Insert into student_info (BBA-F21/001, Alishba, Kamran, ...);
• UPDATE – is used to update existing data within a table.
• DELETE – is used to delete records from a database table.
(iv) DCL (Data Control Language): DCL includes commands such as GRANT and
REVOKE which mainly deals with the rights, permissions and other controls of the
database system.
Examples of DCL commands:
• GRANT-gives user’s access privileges to database.
• REVOKE-withdraw user’s access privileges given by using the GRANT
command.
(v) TCL (transaction Control Language): TCL commands deals with the transaction within
the database.
Examples of TCL commands:

•COMMIT– commits a Transaction.


•ROLLBACK– rollbacks a transaction in case of any error occurs.
•SAVEPOINT–sets a save point within a transaction.
•SET TRANSACTION–specify characteristics for the transaction.
2. Users: There are three type of users of the DBMS:-

• Database Administrators (DBA): Database Administrator or DBA is the one who


manages the complete database management system. DBA takes care of the security of the
DBMS, its availability, managing the license keys, managing user accounts and access etc.
• Application Programmer or Software Developer: This user group is involved in
developing and designing the parts of DBMS.
• End User: These days all the modern applications, web or mobile, store user data. How
do you think they do it? Yes, applications are programmed in such a way that they collect
user data and store the data on DBMS systems running on their server. End users are the
one who store, retrieve, update and delete data.

Advantages of DBMS
Major advantages of database management system are:
 Controlling Data Redundancy: Data is recorded in only one place in the database and it is
not duplicated.
 Data consistency: Data items appears only once, and the updated value is immediately
available to all users
 Control over concurrency: In computer file-based system in updating, one may overwrite the
value recorded by the other.
 Backup and recovery procedures: Automatically creates the backup of data and restore data
if required.
 Data Independence: Separation of data structure of database from application program that
uses the data is called data independence.
 Efficient data access: The DBMS uses several powerful functions to store and retrieve data
efficiency.
 Data integrity and security: The DBMS enforce integrity constraints to get a kind of
protection against prohibited access of data.
Disadvantages of DDBMS:
Major disadvantages of database management system are:
 DBMS required high initial cost
 DBMS is extremely complex software
 Technical staff requirement
 Database failure
 High conversion cost
 High maintenance cost
 High hardware cost
DBMS Database Models
A database model defines the logical design and structure of a database and defines how data will be stored, accessed
and updated in a database management system. While the Relational Model is the most widely used database model,
there are other models too:
• Hierarchical Model
• Network Model
• Entity-relationship Model  Relational Model
 Hierarchical Model
This database model organises data into a tree-like-structure,
with a single root, to which all the other data is linked. The
hierarchy starts from the Root data, and expands like a tree,
adding child nodes to the parent nodes.
In this model, a child node will only have a single parent
node.
This model efficiently describes many real-world
relationships like index of a book, recipes etc.
In hierarchical model, data is organised into tree-like
structure with one one-to-many relationship between two
different types of data, for example, one department can have many courses, many professors and off-
course many students.

 Network Model
This is an extension of the Hierarchical model. In this model data is
organised more like a graph, and are allowed to have more than one
parent node.
In this database model data is more related as more relationships are
established in this database model. Also, as the data is more related,
hence accessing the data is also easier and fast. This database model was
used to map many-to-many data relationships.
This was the most widely used database model, before Relational Model
was introduced.
 Entity-relationship Model
In this database model, relationships are created by dividing object of interest into entity and its
characteristics into attributes.
Different entities are related using relationships.
E-R Models are defined to represent the relationships into pictorial form to
make it easier for different stakeholders to understand.
This model is good to design a database, which can then be turned into tables
in relational model (explained below).
Let's take an example, if we have to design a School Database, then Student
will be an entity with attributes name, age, address etc. As Address is
generally complex, it can be another entity with attributes street name, pin code, city etc, and there will
be a relationship between them.
 Relational Model
In this model, data is organised in two-dimensional tables and the
relationship is maintained by storing a common field.
This model was introduced by E.F Codd in 1970, and since then it
has been the most widely used database model, in fact, we can say
the only database model used around the world.
The basic structure of data in the relational model is tables. All the
information related to a particular type is stored in rows of that
table.
Hence, tables are also known as relations in relational model.
Distributed database Management system (DDBMS)
A distributed database is a database in which portions of the database are stored in multiple physical
locations, and in which processing is dispersed or replicated among different points in a network.
As we can be seen from the above diagram, all the information
for the organisation located at different sites and every location
has its own database and every site is connected through a
communication network. This database is known as the
distributed database.
Advantages of DDBMS
Some advantages of Distributed Database Management System
are:
:
 Data is located near “greatest demand” site
 Faster data access
 Faster data processing
 Easily expandable
 Improved communication
 Reduced operating cost
 User-friendly interface
 Less -danger single-point failure
 Processer’s independence
Disadvantages of DDBMS:
Some disadvantages of Distributed Database Management System are:
 Complexity of management and control
 More complex of query processing
 Security
 Lack of standards
 Increased storage requirement
 Increased training cost
Centralized Database Management system (CDBMS)
A centralized database is a database that is located, stored and
maintained in a single location. This single location is most often
a central computer or database system, for example a desktop, a
server CPU, a mainframe computer. It is maintained and
modified from that location only and usually accessed using an
internet connection such as a LAN or WAN. The centralized
database is used by organisations such as colleges, companies,
banks etc.
As we can be seen from the above diagram, all the information
for the organisation is stored in a single database. This database is
known as the centralized database.
Advantages of CDBMS:
 Some advantages of Centralized Database Management System are:
 Easy to query processing
 Easy to take backup of the files
 Provides maximum data integrity
 Minimum redundancy
 Easy to access
 Cost effective
Disadvantages CDBMS:
 Time consuming
 Less efficient
 Recovery

You might also like