0% found this document useful (0 votes)
11 views12 pages

Database - Intro 1

A database is a structured collection of inter-related data that allows for efficient retrieval, insertion, and deletion, commonly organized in tables. Database Management Systems (DBMS) are widely used across various applications, including banking, healthcare, and social media, offering advantages like data integrity and security, but also presenting challenges such as complexity and cost. The document also discusses the differences between DBMS and RDBMS, types of databases, and their architectures.

Uploaded by

pritampaul2k17
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)
11 views12 pages

Database - Intro 1

A database is a structured collection of inter-related data that allows for efficient retrieval, insertion, and deletion, commonly organized in tables. Database Management Systems (DBMS) are widely used across various applications, including banking, healthcare, and social media, offering advantages like data integrity and security, but also presenting challenges such as complexity and cost. The document also discusses the differences between DBMS and RDBMS, types of databases, and their architectures.

Uploaded by

pritampaul2k17
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/ 12

What is Database

The database is a collection of inter-related data which is used to retrieve, insert and delete the data
efficiently. It is also used to organize the data in the form of a table, schema, views, and reports, etc.

For example: The college Database organizes the data about the admin, staff, students and faculty etc.
Applications of DBMS
DBMS are used almost in every software that we use. For example, Emails, WhatsApp, Social Media
and in-fact this article that you are reading is being stored and accessed using DBMS. Almost all
programming languages provide libraries from different popular database management systems like
MySQL, Oracle, Microsoft SQL Server, MongoDB, etc.

• Banking: Manages accounts, transactions, and financial records.

• Airlines: Handles bookings, schedules, and availability.

• E-commerce: Supports catalogs, orders, and secure transactions.

• Healthcare: Stores patient records and billing.

• Education: Manages student data and course enrollments.

• Telecom: Tracks call records and billing.

• Government: Maintains census and taxation data.

• Social media: Stores user profiles and posts efficiently.

Paradigm Shift from File System to DBMS


File System manages data using files on a hard disk. Users are allowed to create, delete, and update
the files according to their requirements. Let us consider the example of file-based University
Management System. Data of students is available to their respective Departments, Academics
Section, Result Section, Accounts Section, Hostel Office, etc. Some of the data is common for all
sections like Roll No, Name, Father Name, Address, and Phone number of students but some data is
available to a particular section only like Hostel allotment number which is a part of the hostel office.
Let us discuss the issues with this system:

• Redundancy of data: Data is said to be redundant if the same data is copied at many places.
If a student wants to change their Phone number, he or she has to get it updated in various
sections. Similarly, old records must be deleted from all sections representing that student.

• Inconsistency of Data: Data is said to be inconsistent if multiple copies of the same data do
not match each other. If the Phone number is different in Accounts Section and Academics
Section, it will be inconsistent. Inconsistency may be because of typing errors or not updating
all copies of the same data.

• Difficult Data Access: A user should know the exact location of the file to access data, so the
process is very cumbersome and tedious. If the user wants to search the student hostel
allotment number of a student from 10000 unsorted students’ records, how difficult it can be.

• Unauthorized Access: File Systems may lead to unauthorized access to data. If a student gets
access to a file having his marks, he can change it in an unauthorized way.
• No Concurrent Access: The access of the same data by multiple users at the same time is
known as concurrency. The file system does not allow concurrency as data can be accessed by
only one user at a time.

• No Backup and Recovery: The file system does not incorporate any backup and recovery of
data if a file is lost or corrupted.

Advantages of DBMS
• Data organization: A DBMS allows for the organization and storage of data in a structured
manner, making it easy to retrieve and query the data as needed.

• Data integrity: A DBMS provides mechanisms for enforcing data integrity constraints, such as
constraints on the values of data and access controls that restrict who can access the data.

• Concurrent access: A DBMS provides mechanisms for controlling concurrent access to the
database, to ensure that multiple users can access the data without conflicting with each
other.

• Data security: A DBMS provides tools for managing the security of the data, such as controlling
access to the data and encrypting sensitive data.

• Backup and recovery: A DBMS provides mechanisms for backing up and recovering the data
in the event of a system failure.

• Data sharing: A DBMS allows multiple users to access and share the same data, which can be
useful in a collaborative work environment.

Disadvantages of DBMS
• Complexity: DBMS can be complex to set up and maintain, requiring specialized knowledge
and skills.

• Performance overhead: The use of a DBMS can add overhead to the performance of an
application, especially in cases where high levels of concurrency are required.

• Scalability: The use of a DBMS can limit the scalability of an application, since it requires the
use of locking and other synchronization mechanisms to ensure data consistency.

• Cost: The cost of purchasing, maintaining and upgrading a DBMS can be high, especially for
large or complex systems.

• Limited Use Cases: Not all use cases are suitable for a DBMS, some solutions don’t need high
reliability, consistency or security and may be better served by other types of data storage.

Types of Databases

• There are various types of databases used for storing different varieties of data:

1) Relational Database

This database is based on the relational data model, which stores data in the form of rows(tuple) and
columns(attributes), and together forms a table(relation). A relational database uses SQL for storing,
manipulating, as well as maintaining the data. E.F. Codd invented the database in 1970. Each table in
the database carries a key that makes the data unique from others. Examples of Relational databases
are MySQL, Microsoft SQL Server, Oracle, etc.

2) Hierarchical Databases

It is the type of database that stores data in the form of parent-children relationship nodes. Here, it
organizes data in a tree-like structure.

Data get stored in the form of records that are connected via links. Each child record in the tree will
contain only one parent. On the other hand, each parent record can have multiple child records.

3) Network Databases

It is the database that typically follows the network data model. Here, the representation of data is in
the form of nodes connected via links between them. Unlike the hierarchical database, it allows each
record to have multiple children and parent nodes to form a generalized graph structure.

What is RDBMS (Relational Database Management System)


How it works
Data is represented in terms of tuples (rows) in RDBMS.

A relational database is the most commonly used database. It contains several tables, and each table
has its primary key.

Due to a collection of an organized set of tables, data can be accessed easily in RDBMS.

What is table/Relation?
Everything in a relational database is stored in the form of relations. The RDBMS database uses tables
to store data. A table is a collection of related data entries and contains rows and columns to store
data. Each table represents some real-world objects such as person, place, or event about which
information is collected. The organized collection of data into a relational table is known as the logical
view of the database.

Properties of a Relation:
o Each relation has a unique name by which it is identified in the database.
o Relation does not contain duplicate tuples.

o The tuples of a relation have no specific order.

o All attributes in a relation are atomic, i.e., each cell of a relation contains exactly one value.

A table is the simplest example of data stored in RDBMS.

Let's see the example of the student table.

ID Name AGE COURSE

1 Ajeet 24 B.Tech

2 aryan 20 C.A

3 Mahesh 21 BCA

4 Ratan 22 MCA

5 Vimal 26 BSC

What is a row or record?


A row of a table is also called a record or tuple. It contains the specific information of each entry in the
table. It is a horizontal entity in the table. For example, The above table contains 5 records.

Properties of a row:
o No two tuples are identical to each other in all their entries.

o All tuples of the relation have the same format and the same number of entries.

o The order of the tuple is irrelevant. They are identified by their content, not by their position.

Let's see one record/row in the table.

ID Name AGE COURSE

1 Ajeet 24 B.Tech

What is a column/attribute?
A column is a vertical entity in the table which contains all information associated with a specific field
in a table. For example, "name" is a column in the above table which contains all information about a
student's name.

Properties of an Attribute:
o Every attribute of a relation must have a name.

o Null values are permitted for the attributes.

o Default values can be specified for an attribute automatically inserted if no other value is
specified for an attribute.

o Attributes that uniquely identify each tuple of a relation are the primary key.

Name

Ajeet

Aryan

Mahesh

Ratan

Vimal

What is data item/Cells?


The smallest unit of data in the table is the individual data item. It is stored at the intersection of tuples
and attributes.

Properties of data items:


o Data items are atomic.

o The data items for an attribute should be drawn from the same domain.

In the below example, the data item in the student table consists of Ajeet, 24 and Btech, etc.

ID Name AGE COURSE

1 Ajeet 24 B.Tech

Degree:
The total number of attributes that comprise a relation is known as the degree of the table.
For example, the student table has 4 attributes, and its degree is 4.

ID Name AGE COURSE

1 Ajeet 24 B.Tech

2 aryan 20 C.A

3 Mahesh 21 BCA

4 Ratan 22 MCA

5 Vimal 26 BSC

Cardinality:
The total number of tuples at any one time in a relation is known as the table's cardinality. The relation
whose cardinality is 0 is called an empty table.

For example, the student table has 5 rows, and its cardinality is 5.

ID Name AGE COURSE

1 Ajeet 24 B.Tech

2 aryan 20 C.A

3 Mahesh 21 BCA

4 Ratan 22 MCA

5 Vimal 26 BSC

Domain:
The domain refers to the possible values each attribute can contain. It can be specified using standard
data types such as integers, floating numbers, etc. For example, an attribute entitled Marital_Status
may be limited to married or unmarried values.

NULL Values
The NULL value of the table specifies that the field has been left blank during record creation. It is
different from the value filled with zero or a field that contains space.
Difference between DBMS and RDBMS
Although DBMS and RDBMS both are used to store information in physical database but there are
some remarkable differences between them.

The main differences between DBMS and RDBMS are given below:

No. DBMS RDBMS

DBMS applications store data as RDBMS applications store data in a tabular


1)
file. form.

Normalization is not present in


2) Normalization is present in RDBMS.
DBMS.

DBMS does not apply any


3) security with regards to data RDBMS defines the integrity constraint.
manipulation.

in RDBMS, data values are stored in the form


DBMS uses file system to store
of tables, so a relationship between these
4) data, so there will be no relation
data values will be stored in the form of a table
between the tables.
as well.

DBMS has to provide some RDBMS system supports a tabular structure of


5) uniform methods to access the the data and a relationship between them to
stored information. access the stored information.

DBMS does not support


6) RDBMS supports distributed database.
distributed database.

DBMS is meant to be for small


RDBMS is designed to handle large amount of
7) organization and deal with small
data. it supports multiple users.
data. it supports single user.

Examples of DBMS are file Example of RDBMS are mysql, postgre, sql
8)
systems, xml etc. server, oracle etc.
After observing the differences between DBMS and RDBMS, you can say that RDBMS is an extension
of DBMS. There are many software products in the market today who are compatible for both DBMS
and RDBMS. Means today a RDBMS application is DBMS application and vice-versa.

There are the following differences between DBMS and File systems:

Basis DBMS Approach File System Approach

The file system is a collection of


DBMS is a collection of data. In
data. In this system, the user has
Meaning DBMS, the user is not required to
to write the procedures for
write the procedures.
managing the database.

Data is distributed in many files,


Due to the centralized approach,
Sharing of data and it may be of different formats,
data sharing is easy.
so it isn't easy to share data.

The file system provides the detail


DBMS gives an abstract view of
Data Abstraction of the data representation and
data that hides the details.
storage of data.

DBMS provides a good protection It isn't easy to protect a file under


Security and Protection
mechanism. the file system.

The file system doesn't have a


DBMS provides a crash recovery crash mechanism, i.e., if the
Recovery Mechanism mechanism, i.e., DBMS protects system crashes while entering
the user from system failure. some data, then the content of
the file will be lost.

DBMS contains a wide variety of


The file system can't efficiently
Manipulation Techniques sophisticated techniques to store
store and retrieve the data.
and retrieve the data.

In the File system, concurrent


DBMS takes care of Concurrent access has many problems like
Concurrency Problems access of data using some form of redirecting the file while deleting
locking. some information or updating
some information.

The database system is expensive The file system approach is


Cost
to design. cheaper to design.
In this, the files and application
Due to the centralization of the
programs are created by different
Data Redundancy and database, the problems of data
programmers so that there exists
Inconsistency redundancy and inconsistency are
a lot of duplication of data which
controlled.
may lead to inconsistency.

In this system, Data


Independence exists, and it can
be of two types.
In the File system approach, there
Data Independence o Logical Data
exists no Data Independence.
Independence

o Physical Data
Independence

Integrity Constraints are easy to Integrity Constraints are difficult


Integrity Constraints
apply. to implement in file system.

In the database approach, 3 types


of data models exist:
In the file system approach, there
Data Models o Hierarchal data models is no concept of data models
o Network data models exists.

o Relational data models

Changes are often a necessity to


the content of the data stored in The flexibility of the system is less
Flexibility any system, and these changes as compared to the DBMS
are more easily with a database approach.
approach.

Examples Oracle, SQL Server, Sybase etc. Cobol, C++ etc.

DBMS Architecture
o The DBMS design depends upon its architecture. The basic client/server architecture is used
to deal with a large number of PCs, web servers, database servers and other components that
are connected with networks.

o The client/server architecture consists of many PCs and a workstation which are connected via
the network.

o DBMS architecture depends upon how users are connected to the database to get their
request done.
Types of DBMS Architecture

Database architecture can be seen as a single tier or multi-tier. But logically, database architecture is
of two types like: 2-tier architecture and 3-tier architecture.

1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user can directly
sit on the DBMS and uses it.

o Any changes done here will directly be done on the database itself. It doesn't provide a handy
tool for end users.

o The 1-Tier architecture is used for development of the local application, where programmers
can directly communicate with the database for the quick response.

2-Tier Architecture
o The 2-Tier architecture is same as basic client-server. In the two-tier architecture, applications
on the client end can directly communicate with the database at the server side. For this
interaction, API's like: ODBC, JDBC are used.

o The user interfaces and application programs are run on the client-side.

o The server side is responsible to provide the functionalities like: query processing and
transaction management.

o To communicate with the DBMS, client-side application establishes a connection with the
server side.
Fig: 2-tier Architecture

3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.

o The application on the client-end interacts with an application server which further
communicates with the database system.

o End user has no idea about the existence of the database beyond the application server. The
database also has no idea about any other user beyond the application.

o The 3-Tier architecture is used in case of large web application.

Fig: 3-tier Architecture


Schema:
A database schema is the skeleton structure of the database. It represents the logical view of the entire
database.

Instance:
An instance of the database is also called a database state. It is the data in the database at any given
point of time. Every time any modifications such as update, insert and delete operation are performed
on the database, the database changes from one state to another.

You might also like