Unit-I-Basic Concepts

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 42

Database Management System

By
Dr. Rifaqat Ali
Department of Mathematics and Scientific Computing
National Institute of Technology Hamirpur
Email id : rifaqatali@nith.ac.in
Syllabus
• Basic Concepts: Introduction to File and Database systems- Database system structure – concepts
and architecture, date models, schemas & instances, DBMS architecture & data independence,
database languages & interfaces, Data Model, ER model.
• Relational Models: SQL – Data definition- Queries in SQL-relational model concepts, relational
model constraints, relational algebra, SQL- a relational database language: date definition in SQL,
view and queries in SQL, specifying constraints and indexes in SQL; relational database
management systems-Updates, Views, Integrity and Security, Relational Database design,
Functional dependences and Normalization for Relational Databases, normal forms based on
primary keys, (1NF, 2NF, 3NF & BCNF), lossless join and dependency preserving decomposition,
converting ER-diagrams into relations.
• Data Storage and Query Processing: Record storage and Primary file organization- Secondary
storage Devices, Operations on Files, Heap File, Sorted Files, Hashing Techniques, Index Structure
for files, Different types of Indexes- B-Tree - B+Tree.
• Transaction Management: Transaction Processing, Need for Concurrency control, Desirable
properties of Transaction, Schedule and Recoverability, Serializability and Schedules; Concurrency
Control, Types of Locks, Two Phases locking, Deadlock.
Books and References
An introduction to database concepts by B. Desai, Galgotia publications.
An introduction to database systems by C. J. Date, Addison Wesley.
Fundamentals of database systems by Elmsari and Navathe, Addison Wesley.
Database System Concepts by Abraham Silberschatz, Henry F. Korth and S. Sudarshan,
McGraw-Hill.
Database System Implementation, Hector Garcia–Molina by Jeffrey D. Ullman and
Jennifer Widom, Pearson Education.
Database System, Design, Implementation and Management by Peter Rob and Corlos
Coronel, Thompson Learning Course Technology.
Basic Concepts:
Data: It is a raw and isolated facts about an entity (recorded).
• e.g., Text, Audio, Video, Image, Map, etc.

Data: Raw facts which may be numbers, values, names, dates, etc. When we
combine related data, they describe any real-world entity.

Related data: Data which belong to the same entity (person, place, event or thing).

For example: Suppose the entity like ‘Doctor’ (person type of entity),
Doctor’s Name, Address, Date-of-Birth, Qualification, Specialization, etc., are
related data.
 But cannot say that supplier’s name and doctor’s qualification are related data.
Continued…

Note that: Data can be stored manually or electronically. Similarly,


stored data may be processed manually or electronically.
Information: Processed the data which give meaningful information.
Information is useful to take decisions,
it can be stored for future use,
it has some meaning.
To obtain information, we need data.
Continued…

• For example, when we process students’ attendance data,


we can get a list of students with low attendance,
 students who are attending lectures regularly,
students who come to college to attend particular lectures,
pattern of class bunking for each student, etc.
Examples of Data and Information
Example of Data and Information:

Let us Suppose that


• If percentage < 40 then, Grade = ‘F’
• If percentage ≥ 40 and < 50 then, Grade = ‘D’
• If percentage ≥ 50 and < 60 then, Grade = ‘C’
• If percentage ≥ 60 and < 70 then, Grade = ‘B’
• If percentage ≥ 70 then, Grade = ‘A’
Continued…
Continued…
Continued…
Continued…
Database: It is a collection of similar/related data, i.e., database is a
storage area where we can store all related data and process them.
One logical example of database: our brain.
The example of physical database is a grain warehouse.

A database is like an electronic storage, which contains


computerized data files (entities). It can contain one or many data
files. Data files contain various related data within it.
Database should contain accurate, consistent and non-redundant
data which could be shared by different application programs.
Continued…
Continued…

• In the previous slide the real-life example of database is schoolbag.


• It is a stationery database which contains entities such as notebook,
textbook, compass box, geometry case, etc.
• Entity Notebook has distinguished notebooks of various subjects.
• Entity Textbook has distinguished textbooks of various subjects.
• Entity Compass box has pencils, erasers, sharpeners, and ruler.
• Entity Geometry box has common mathematical tools.
Operational data:

• In Database, To process the stored data, we need application


programs.
• The processed data could be again stored into database for future
use.
• The data, on which we can do some processing, is known as
operational data.
• Any organization contains operational data.
Continued…
Physical Database:
Physical database: is useful for the computer (i.e., how a machine sees
data), while logical database is useful for the user (i.e., how a human being
sees data).
For example: The database of a university, which contains various related
entities, such as course, college, student, class, attendance, exam, etc.
There are many colleges in a university; each college contains many
students in different courses and classes.
Students attend lectures, appear in exams and get results.
The ‘University’ database contains interrelated data which could be shared
by different application programs to obtain meaningful information.
Continued…
Components of Database System:
There are four types of components of database system :
1) User
 End User
Application Programmer
Database Designer
Database Administrator (DBA)
2) Hardware
3) Software
4) Data
Continued…
Continued…

1). User: User is any person who uses a database or any other object
of the database.
Naive User, or End-user, or Layman: The clerk of the university uses the
‘university’ database to enter the data of applicants who have applied for
various courses and the same data are retrieved to generate a merit list.
The clerk does not know anything about the technical features of the database
or the language, using which data is entered or retrieved. He is completely
unaware about the technology. Therefore, he/she is known as an end-user or
Layman or Naive user.
Continued…
Software Programmer, or Application Programmer, or Application
Developer: A software programmer is a person who writes application
programs or logic in some specific language to insert, delete, update or fetch
data to/from database.
Database Designer: A database designer decides about entities (data files)
which should be stored within database, constraints to be applied on data,
data types, format and other specifications regarding data. The database
designer is responsible for designing of data files.
Database Administrator: A database administrator (DBA) is the person
who is the overall in-charge of a database. He/she assigns authorization to
users, writes validation procedures, decides backup and recovery policies,
and manages users and privileges. In short, DBA keeps control on database.
Continued…

2). Hardware: Hardware is a permanent storage where the database is


stored. It may be a hard-disc, or any other secondary memory.
3). Software: are programs or applications which are used to access
data from database.
The common language available with all the databases is known as
Structured Query Language; which is popularly known as SQL and
sometimes pronounced as ‘Sequel’.
4). Data: Data is the most important component of a database system.
Database Management:
• The process of managing data within database is called database
management. To manage database, a database management software/system
is required.
Database management includes the following activities:
Writing schema for creating new data files, updating structure of existing data
file, deleting a data file.
Setting relationship among data files.
Inserting, deleting and updating data values within data files.
Maintaining data dictionary.
Creating, updating and deleting database objects other than data files, such
as views, synonyms, procedures, functions, triggers, indexes, etc.
Database Management System (DBMS):
• Database management system is a collection of application
programs which is used to manage database objects.
• It is software which is used to create, manipulate and delete
database.
• Generalised software which is used to manage database and database
objects, such as tables, users, procedures, functions, etc., and to
connect database with any front-end (language) with the help of some
hardware.
• MySQL is one of the most popular open source database
management system.
Continued…
Need of a Database:
Database is required for efficient and easy storage, retrieval, updation and deletion of
data records.
Interrelated data should be grouped in one named storage area for easy access. This
storage area may be physical or logical which resides in computer.
For avoiding unnecessary repetition of data values, checking correctness of data by
applying some validation rule, and searching the required information faster.
 Database is required for flexibility, i.e., as and when required we can connect the
database with different front-ends.
Once a database is created, it can be shared by many users. Hence, to share data with
many applications a database is required.
Database is needed for storing high volume and complex data, such as documents files,
photographs or images, multimedia data, mobile user’s data, audio and video files.
File-based Data Management System :
• File-based data management system is used by programmers to manage data.
• Languages, such as C or COBOL contain file management system within it.
• In file-based systems, data are managed using data files and these files are
created and manipulated by writing application programs.
• Each application program contains its own data files.
Continued…
Disadvantages of File-based Management System:
File-based management system is not appropriate when volume
of data is very high. For example, it will be difficult to handle
when daily transactions are in thousands or more numbers.
When number of data files increase, it becomes very complicated
to manage data files, i.e., if number of data files increase, number
of application programs are also increased; because to insert,
update, delete or view data from data files, an independent
application program is to be written.
Complex data structures, such as pointers, cannot be handled
easily by a file-based system.
Continued…
When the same data file is required by different programs at the
same time, data sharing is not possible. To use same files at the
same time, copy of that data file must be created and used. When
these are two or more copies of same data file, it may result in
inconsistent and redundant data, because changes made in one file
may not be carried out in the other files.
In a file-based system, the programs should only be written in a
structured manner.
It is not possible to set relationships between data files. Programs
should be written to relate them.
Security settings cannot be applied on data files.
Continued…

To overcome the above mentioned limitations of file-based


management system, DBMS is required.
The traditional database system contains data files which could
be used to store data.
The examples of simple database management system are
dBASE and FoxPro.
Continued…
Limitations of Database:
Cost of database management system is very high. As the number
of users increase, we need to pay more.
To install database in a network, high-end hardware and skilled
personnel to manage the network and database is required.
As data can be shared through DBMS, it is difficult to control and
keep track of data accessed by users. Proper encryption and
decryption techniques are required to secure data over a network.
Efficient employees are required to handle users and decide
policies about data access, which requires considerable and
constant training.
FILE SYSTEM VS. DBMS
• A file system is a type of software that’s responsible for maintaining whole
files in a storage medium, Whereas a database management system (DBMS) is
a software application through which a user interacts with a database.
• In a file system, all of the files are organized into directories and folders, and
sometimes the same file can be duplicated across multiple locations. This
means there’s a much greater chance of data inconsistency with file systems.
• A file systems typically have a drastically smaller capacity than a DBMS and
can only modify the metadata of a specific file rather than its contents.

• Examples of file systems include Microsoft’s NTFS and Apple’s Hierarchical File
System.
FILE SYSTEM VS. DBMS
• A DBMS, on the other hand, is a much larger application that can
manipulate large quantities of data in complex ways.
• It usually has more advanced security features to protect the data it
contains and offers backup and recovery in the event of data loss,
unlike a file system.
• A DBMS is usually much more expensive and complicated to
implement than a file system, however. Prominent DBMS products
include MySQL, IBM DB2, and Amazon RDS.
Advantages of file-based systems include:
• Easy to use
• Inexpensive
• Faster performance
• Suitable for personal data management
Disadvantages of file-based systems include:
• Limited capacity
• Limited functionality
• Less security
• Greater data inconsistency
• No backup or recovery capabilities
References:

1. An introduction to database concepts by B. Desai, Galgotia


publications.
2. An introduction to database systems by C. J. Date, Addison Wesley.
3. Fundamentals of database systems by Elmsari and Navathe, Addison
Wesley.
4. Database System Concepts by Abraham Silberschatz, Henry F.
Korth and S. Sudarshan, McGraw-Hill.
5. CONCEPTS OF DATABASE MANAGEMENT SYSTEM by SHEFALI NAIK,
Pearson.

You might also like