UNIT 4
UNIT 4
UNIT 4
The Database is an essential part of our life. As we encounter several activities that
involve our interaction with databases, for example in the bank, in the railway station, in
school, in a grocery store, etc. These are the instances where we need to store a large
amount of data in one place and fetch these data easily. Data refers to raw, unprocessed facts and
figures without any context
Data : statistics it is raw and unprocessed . ex- name , class , marks etc.
information = when data is processed . ” record is also information “. example – pass or
fail table etc.
Database : an organized collection of data and information or interrelated data collected
at one place.
DBMS: Collection of interrelated data and set of program to access data example –
MySql, Oracle.
Application : Company Information , Account information, manufacturing, banking
,finance transactions, telecommunications.
A database is a collection of data that is organized, which is also called structured data. It
can be accessed or stored in a computer system. It can be managed through a Database
Management System (DBMS), a software used to manage data. Database refers to related
data in a structured form.
In a database, data is organized into tables consisting of rows and columns and it is
indexed so data can be updated, expanded, and deleted easily. Computer databases
typically contain file records data like transactions money in one bank account to another
bank account, sales and customer details, fee details of students, and product details.
There are different kinds of databases, ranging from the most prevalent approach, the
relational database, to a distributed database, cloud database, and NoSQL databases.
Relational Database:
A relational database is made up of a set of tables with data that fits into a predefined
category.
Distributed Database:
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.
Cloud Database:
A cloud database is a database that typically runs on a cloud computing platform.
Database service provides access to the database. Database services make the
underlying software-stack transparent to the user.
These interactions are the example of a traditional database where data is of one type-that
is textual. In advancement of technology has led to new applications of database systems.
New media technology has made it possible to store images, video clips. These essential
features are making multimedia databases.
Nowadays, people are becoming smart – before taking any decisions they analyze facts
and figures related to it, which come from these databases. As the databases have made it
easier to manage information, we are able to catch criminals and do deep research.
DBMS
INTRODUCTION:
A Database Management System (DBMS) is a software system that is designed
to manage and organize data in a structured manner. It allows users to create,
modify, and query a database, as well as manage the security and access
controls for that database.
1. Data modeling: A DBMS provides tools for creating and modifying data
models, which define the structure and relationships of the data in a
database.
2. Data storage and retrieval: A DBMS is responsible for storing and retrieving
data from the database, and can provide various methods for searching and
querying the data.
3. Concurrency control: 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.
4. Data integrity and security: A DBMS provides tools for enforcing data
integrity and security constraints, such as constraints on the values of data
and access controls that restrict who can access the data.
5. Backup and recovery: A DBMS provides mechanisms for backing up and
recovering the data in the event of a system failure.
6. DBMS can be classified into two types: Relational Database Management
System (RDBMS) and Non-Relational Database Management System
(NoSQL or Non-SQL)
7. RDBMS: Data is organized in the form of tables and each table has a set of
rows and columns. The data is related to each other through primary and
foreign keys.
8. NoSQL: Data is organized in the form of key-value pairs, document, graph,
or column-based. These are designed to handle large-scale, high-
performance scenarios.
Advantages of DBMS over File system
File System: A File Management system is a DBMS that allows access to single files or
tables at a time. In a File System, data is directly stored in a set of files. It contains flat
files that have no relation to other files (when only one table is stored in a single file, then
this file is known as a flat file).
DBMS: A Database Management System (DBMS) is application software that allows
users to efficiently define, create, maintain and share databases. Defining a database
involves specifying the data types, structures and constraints of the data to be stored in
the database. Creating a database involves storing the data on some storage medium that
is controlled by DBMS. Maintaining a database involves updating the database whenever
required to evolve and reflect changes in the miniworld and also generating reports for
each change. Sharing a database involves allowing multiple users to access the database.
DBMS also serves as an interface between the database and end users or application
programs. It provides control access to the data and ensures that data is consistent and
correct by defining rules on them.
An application program accesses the database by sending queries or requests for data to
the DBMS. A query causes some data to be retrieved from the database.
Application of DBMS
There are different fields where a database management system is utilized. Following are
a few applications which utilize the information base administration framework –
1. Railway Reservation System –
In the rail route reservation framework, the information base is needed to store the
record or information of ticket appointments, status about train’s appearance, and
flight. Additionally, if trains get late, individuals become acquainted with it through
the information base update.
3. Banking –
Database the executive’s framework is utilized to store the exchange data of the client
in the information base.
4. Education Sector –
Presently, assessments are led online by numerous schools and colleges. They deal
with all assessment information through the data set administration framework
(DBMS). In spite of that understudy’s enlistments subtleties, grades, courses,
expense, participation, results, and so forth all the data is put away in the information
base.
7. Broadcast communications –
Without DBMS any media transmission organization can’t think. The Database the
executive’s framework is fundamental for these organizations to store the call
subtleties and month to month postpaid bills in the information base.
8. Account –
The information base administration framework is utilized for putting away data
about deals, holding and acquisition of monetary instruments, for example, stocks and
bonds in a data set.
9. Online Shopping –
These days, web-based shopping has become a major pattern. Nobody needs to visit
the shop and burn through their time. Everybody needs to shop through web based
shopping sites, (for example, Amazon, Flipkart, Snapdeal) from home. So all the
items are sold and added uniquely with the assistance of the information base
administration framework (DBMS). Receipt charges, installments, buy data these are
finished with the assistance of DBMS.
11. Manufacturing –
Manufacturing organizations make various kinds of items and deal them consistently.
To keep the data about their items like bills, acquisition of the item, amount,
inventory network the executives, information base administration framework
(DBMS) is utilized.
12. Airline Reservation System –
This framework is equivalent to the railroad reservation framework. This framework
additionally utilizes an information base administration framework to store the
records of flight takeoff, appearance, and defer status.
13. Healthcare: DBMS is used in healthcare to manage patient data, medical records,
and billing information.
14. Data retrieval: DBMS provides a way to retrieve data quickly and easily using
search queries.
15. Data manipulation: DBMS provides tools to manipulate data, such as sorting,
filtering, and aggregating data.
16. Security: DBMS provides security features to ensure that only authorized users have
access to the data.
17. Data backup and recovery: DBMS provides tools to back up data and recover it in
case of system failures or data loss.
18. Multi-user access: DBMS allows multiple users to access and modify data
simultaneously.
19. Reporting and analysis: DBMS provides tools to generate reports and analyze data
to gain insights and make informed decisions.
3. System Analyst :
System Analyst is a user who analyzes the requirements of parametric end users. They
check whether all the requirements of end users are satisfied.
5. Database Designers : Data Base Designers are the users who design the structure of
database which includes tables, indexes, views, triggers, stored procedures and
constraints which are usually enforced before the database is created or populated
with data. He/she controls what data must be stored and how the data items to be
related. It is responsibility of Database Designers to understand the requirements of
different user groups and then create a design which satisfies the need of all the user
groups.
7. Casual Users / Temporary Users : Casual Users are the users who occasionally
use/access the database but each time when they access the database they require the
new information, for example, Middle or higher level manager.
SQL Datatype
o SQL Datatype is used to define the values that a column can contain.
o Every column is required to have a name and data type in the database table.
binary It has a maximum length of 8000 bytes. It contains fixed-length binary data.
varbinary It has a maximum length of 8000 bytes. It contains variable-length binary data.
image It has a maximum length of 2,147,483,647 bytes. It contains variable-length binary data.
float -1.79E + 308 1.79E + 308 It is used to specify a floating-point value e.g. 6.2, 2.9 etc.
char It has a maximum length of 8000 characters. It contains Fixed-length non-unicode characters.
varchar It has a maximum length of 8000 characters. It contains variable-length non-unicode characters.
Datatype Description
timestamp It stores the year, month, day, hour, minute, and the second value