0% found this document useful (0 votes)
6 views30 pages

Unit 1

The document outlines a syllabus for a Database Management Systems (DBMS) course, covering key topics such as data processing, entity-relationship models, relational models, SQL, and PL/SQL. It includes detailed units on various aspects of DBMS, advantages and disadvantages of database systems, and a model question paper for assessment. The document also discusses the evolution of DBMS and contrasts file-based systems with database approaches.

Uploaded by

SATYA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views30 pages

Unit 1

The document outlines a syllabus for a Database Management Systems (DBMS) course, covering key topics such as data processing, entity-relationship models, relational models, SQL, and PL/SQL. It includes detailed units on various aspects of DBMS, advantages and disadvantages of database systems, and a model question paper for assessment. The document also discusses the evolution of DBMS and contrasts file-based systems with database approaches.

Uploaded by

SATYA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

S.

BHARGAVI Lecturer in Computer science

Semester-III

Database
management
systems
(DBMS)

UNIT I: Overview of Database Management System:


1
S.BHARGAVI Lecturer in Computer science
 Introduction to data, information, database,
 Database management systems,
 File-based system,
 Drawbacks of file-Based System,
 Database approach,
 Classification of Database Management Systems,
 Advantages of database approach,
 Various Data Models,
 Components of Database Management System,
 Three schema architecture of data base,
 Costs and risks of database approach.
UNIT II: Entity-Relationship Model:
 Introduction,
 The building blocks of an entity relationship diagram,
 Classification of entity sets,
 Attribute classification,
 Relationship degree,
 Relationship classification,
 Reducing ER diagram to tables,
 Enhanced entity-relationship model (EER model),
 Generalization and specialization,
 IS A relationship and attribute inheritance,
 Multiple inheritance,
 Constraints on specialization and generalization,
 Advantages of ER modeling.
UNIT III: Relational Model:
 Introduction,
 CODD Rules,
 Relational data model,
 Concept of key,
 Relational integrity,
 Relational algebra,
 Relational algebra operations,
 Advantages of relational algebra,
 Limitations of relational algebra,
 Relational calculus,
 Tuple relational calculus,
 Domain relational Calculus (DRC),
 Functional dependencies and normal forms upto 3 rd normal form.

2
S.BHARGAVI Lecturer in Computer science
UNIT IV: Structured Query Language:
 Introduction,
 History of SQL Standard,
 Commands in SQL,
 Data Types in SQL,
 Data Definition Language,
 Selection Operation,
 Projection Operation,
 Aggregate functions,
 Data Manipulation Language,
 Table Modification Commands,
 Join Operation,
 Set Operations,
 View,
 Sub Query.
UNIT V: PL/SQL:
 Introduction,
 Shortcomings of SQL,
 Structure of PL/SQL,
 PL/SQL Language Elements,
 Data Types,
 Operators Precedence,
 Control Structure,
 Steps to Create a PL/SQL,
 Program,
 Iterative Control,
 Procedure,
 Function,
 Database Triggers,
 Types of Triggers.

3
S.BHARGAVI Lecturer in Computer science
Model question paper
Section - A
Answer any 5 question 5X5 = 25M
1. Explain disadvantages of file processing system?
2. Explain the concept of entity and entity set with suitable example.
3. Explain about various attribute classification.
4. What are the advantages of Relational algebra? Explain.
5. Explain various types of keys.
6. Explain the selection command with an example.
7. Explain sub queries.
8. Explain structure of PL/SQL.
Section - B
Answer following question 5X10 = 50M
9. a) With a neat diagram, explain the architecture of a DBMS.
(OR)
b) Explain about Data Models.
10. a) Explain about Specialization and Generalization in EER model.
(OR)
b) What is ER-Modeling? Write advantages and disadvantages of ER-Modelling.
11. a) What is Functional Dependency? Explain difference between 3NF and BCNF?
(OR)
b) What is relational model? Write about key features of relational model.
12. a) What is SQL? Explain different types of commands in SQL.
(OR)
b) What is Nested Queries? How to create them? Discuss it with relevant example.
13. a) Explain steps in creating a PL/SQL Program.
(OR)
b) Explain about Triggers and types of triggers.

4
S.BHARGAVI Lecturer in Computer science

UNIT-I

Data:
 Data is defined as collection of raw or unorganized facts about a place,
person, thing or object.
 Raw facts indicates that this data is not yet processed to reveal its
meaningful form.

5
S.BHARGAVI Lecturer in Computer science
 Data can be represented in various forms like text, numbers, images, audio,
video, graphs, document files, etc.
EX: 1, sno, name, ram, 21, age etc.
Processing:
Processing is the manipulation of data.
(Or)
It is the actual interpretation and execution of instruction on data which is carried
out by the computer’s processing unit to obtain a result.

Manipulation:
Manipulation means changing of data from one form to another form.

Information
 Information can be defined as processed data that increases the knowledge
of end user.

DATA INFORMATION
1. Raw facts. 1. Processed data.
2. Unorganized data. 2. Organized data.
3. Not useful in making 3. Useful in making decisions.
decisions.
Ex: 89, 42, 24, 32, 18, 94, 21 Ex: marks age
89 21
94 18
48 32

Knowledge:
 Knowledge is what we know about a particular domain (field).
 Knowledge is obtained from information in the same way as information is
derived from data.
 Knowledge refers to the use of information to make decisions.
Example between data, information and knowledge.
Data -- 30000,7000,18000
Information -- Samsung ---- 30000
Redmi ---- 7000
Vivo ---- 18000

6
S.BHARGAVI Lecturer in Computer science
Knowledge -- Redmi ----7000

Need of Information:
Information is necessary for the people living in the modern world. Without proper
information it is difficult to survive.
Information is needed to
 To gain knowledge.
 To keep system up to date.
 To know about rules and regulations of society, Gov., etc.
 To arrive at a particular decision that helps in forming, running and
protecting a system.

Differences between data and information:

DATA INFORMATION
 Data is raw fact and figures.  Information is processed form
Ex: 32 of data.
Ex: age--32
 Data is not sufficient to a  Information is sufficient to a
business. business.
 Data is atomic level piece of  Information is meaningful
information. It can be in any collection of data.
form. Ex: age and 32 are collected
together to form information.
 Data does not help in decision  Information help in decision
making. making.
 Observations and recordings  Analysis is done to obtain
are done to obtain data. information.
 Input to any system may be  Output after processing the
treated as data. system is information.
 Difficult to understand  Easy to understand.
properly.
 Data may not be in order.  Information must be in order.

Metadata
 A Meta data is the data about the data.
 Metadata in DBMS is the data (details/schema) of any other data.
 Metadata is a special data that describes the characteristics or properties of
the data.
 Metadata consists of name, data type, length, min, max, description, special
constraints.
 Metadata allows the database designers and users understand what data
exists and what data means.
7
S.BHARGAVI Lecturer in Computer science
 Metadata is generally stored in a repository.
Example for Metadata:
A simple example of metadata for a document might include a collection of
information like the author, file size, the date the document was created, and
keywords to describe the document.

Database:
 Database can be defined as collection of organized and logically related data
without any redundancy stored in one place and can be accessed by
multiple users.
 Database can be of any size and complexity.
 Data are structured so as to be easily stored, manipulated, and retrieved by
users.

Example: Let us consider a telephone directory in which names of people are


arranged in alphabetical order.so, it becomes easier to find a particular name. If
this ordering is not done in organized manner it will become difficult to search a
particular name.
 The most commonly used operations performed on data are Insertion,
Selection, Updation, Sorting, deleting
Advantages of Database
 Enhanced and improved data security.
 Data redundancy is reduced.
 The consistency of data is increased.
 Data integrity and independence.
 Improved data access to users through use of host and query languages
 Development of new applications program is facilitated.
Disadvantages of Database
 Time is consumed in designing complex database systems
 Damage to database affects virtually all applications programs
 Considerable hardware and software start-up costs
 Extensive conversion costs in shifting from a file-based system to a
database system

8
S.BHARGAVI Lecturer in Computer science
 Training is required for all programmers and users.

DBMS:
DBMS stands for Database management system. It consists of two parts
(i) Database
(ii) Management system
Database:
Database can be treated as main building block of DBMS. Generally database
contains
Data: It is the collection of raw or unorganized facts represented in various forms
like text, numbers, images, audio, video, graphs, document files, etc
Ex: 1, sno, name, ram, 21, age
Record: It is the collection of related data items. The items can be organized and
represented as meaningful information or record.
Ex:
Sno nam age
e
1 ram 21
Table: It is the collection of related records. The columns of the table are called
fields. The rows of the table are called record or tuples. Table is also called as
relation.
Ex:
Fields
name na a
Year
Record or tuple
ramme g I
sn e
o
1 ram 21
Database: Collection of related tables makes a database.
Related tables
name nam Yearage
ram e I
ravi II
sno
1 ram 21
2 ravi 22
name addres
course
ram s
Mpcs
ravi Mccs
nam
e
ram kvr

9
S.BHARGAVI Lecturer in Computer science
ravi Rjy
Database
sno nam age Year cours addres
e e s
1 ram 21 I Mpcs kvr
2 ravi 22 II Mccs Rjy

Management system:
It is the software system used to manage database and perform various
operations like insertion, deletion, updation, retrieval.
It enables the users to store, modify and extract information from database as per
requirement.
It acts as an interface between the user and the database.
Definition of DBMS:
Database management system is defined as the software that can be used to
create a database, to insert data into database, to modify data in database, to
remove/delete data in a database and to maintain a database.

Evolution of DBMS
In recent years, two approaches to DBMS are more popular, which are
a. Object-Oriented DBMS (OODBMS) and
b. Object Relational DBMS (ORDBMS).
The sequential order of the development of DBMS is as follows:
1. Flat files – 1960s–1980s
2. Hierarchical – 1970s–1990s
3. Network – 1970s–1990s
4. Relational – 1980s–present
5. Object-oriented – 1990s–present
6. Object-relational – 1990s–present
7. Data warehousing – 1980s–present
8. Web-enabled – 1990s–present
Early 1960s.
1. Charles Bachman at GE created the first general purpose DBMS Integrated
Data Store.
2. It created the basis for the network model which was standardized by
CODASYL (Conference on Data System Language).
Late 1960s:
1. IBM developed the Information Management System (IMS).
2. IMS used an alternate model, called the Hierarchical Data Model.
In 1970:
1. Edgar Codd, from IBM created the Relational Data Model.
In 1981:
1. Codd received the Turing Award for his contributions to database theory.
2. Codd Passed away in April 2003.
In 1976:

10
S.BHARGAVI Lecturer in Computer science
1. Peter Chen presented Entity-Relationship model, which is widely used in
database design.
In 1980:
1. SQL developed by IBM, became the standard query language for databases.
SQL
was standardized by ISO.
In 1980s and 1990s:
1. IBM, Oracle, Informix and others developed powerful DBMS.

Filebased approach:
 File based approach was first used to computerized manual filing system.
 It is basically collection of programs that perform services to the end users.
 Each program within a file based system has its own definitions and
manages its own data.
 In this system a large number of files are needed to perform various tasks.
 This approach to data management in which separate data files are created
and stores each application program is called traditional file approach.

Characteristics of the file based approach:


Some of the important characteristics of file based approach are
 It stores data of an organization in group of files.
 Each file is independent from one another.
 Each file is called flat file.
 Each file contain processed information for one specific task such as
accounts or inventory.
 Files are designed by using programs written in programming languages
such as c, cpp, java etc.
 Each file must have its own file management.
 It is less flexible and has many limitations.
 It is very difficult to maintain file processing system.
 Any change in one file affects all the files that creates burden on the
programmer.

Advantage of File-oriented system:


1. Backup:

11
S.BHARGAVI Lecturer in Computer science
 It is possible to take faster and automatic back-up of database stored in files
of computer-based systems.
 Computer systems provide functionalities to serve this purpose.it is also
possible to develop specific application program for this purpose.
2. Compactness:
 It is possible to store data compactly.
3. Data Retrieval:
 Computer-based systems provide enhanced data retrieval techniques to
retrieve data stored in files in easy and efficient way.
4. Editing:
 It is easy to edit any information stored in computers in form of files.
 Specific application programs or editing software can be used for this
purpose.
5. Remote Access:
 In computer-based systems,it is possible to access data remotely.
 So, to access data it is not necessary for a user to remain present at location
where these data are kept.
6. Sharing:
 Data stored in files of computer-based systems can be shared among
multiple users at a same time.

Disadvantage of File-oriented system:


1. Data Redundancy:
 It is possible that the same information may be duplicated in different
files.this leads to data redundancy results in memory wastage.
2. Data Inconsistency:
 Because of data redundancy, it is possible that data may not be in
consistent state.
3. Difficulty in Accessing Data:
 Accessing data is not convenient and efficient in file processing system.
4. Limited Data Sharing:
 Data are scattered in various files.
 Also different files may have different formats and these files may be stored
in different folders may be of different departments.
 So, due to this data isolation, it is difficult to share data among different
applications.
5. Integrity Problems:
 Data integrity means that the data contained in the database in both correct
and consistent.
 For this purpose the data stored in database must satisfy correct and
constraints.
6. Atomicity Problems:
 Any operation on database must be atomic, this means, it must happen in
its entirely or not at all.
7. Concurrent Access Anomalies:
 Multiple users are allowed to access data simultaneously.
 This is for the sake of better performance and faster response.
12
S.BHARGAVI Lecturer in Computer science
8. Security Problems:
 Database should be accessible to users in limited way.
 Each user should be allowed to access data concerning his requirements
only.

Data base approach


 To remove all the limitations of file based approach the concept of database
was introduced.
 This approach is known as database approach.
 A database is computer based record keeping system whose purpose is to
record and maintain information.
 Database is a single large repository of data which can be used by many
departments and users.
 In database approach all data items are integrated with minimum amount of
duplication and maintained only at one location.
 Here related data is shared by multiple application programs.

Characteristics of database approach


The following are the characteristics of database approach.
 It is central repository of shared data and allows several users to access the
database concurrently.
 The database approach is that database system does not only contain the
data but also the complete definition and description of data (extent,
structure, type, format and relationship of data).
 The database approach is standardized uniform approach to database
access which means same overall procedures are used by the application
programs to retrieve data and information.
 Data should be correct with respect to the real world entity that they
represent.
 Data should be protected from unauthorized access.
 Its organization is such that duplication is minimized.
 Data in database exist permentantly until it is not explicitly deleted.

Draw backs of database approach


 DBMS can be difficult to set up and operate and decisions must be made
correctly for effective working.
 Users must be updated to take full advantage of DBMS.
 In file management system failure of a file affects only a single program but
in DBMS a failure can shut down the entire database.
 DBMS can be more expensive to purchase and operate as the cost includes
the database cost and specialized personnel such as DBA.
 Recovery is more complex. Initial training is required for all programmers
and users.
13
S.BHARGAVI Lecturer in Computer science

Primary goal of database management system


Primary goal of database management system is to
1) Store information
2) Maintain information
3) Retrieve it.
Primary goal of database management system is to provide a way to store and
retrieve database information that is convenient and efficient. Management of data
involves both defining structure for storage of information and providing mechanism
for manipulation of information.
A database management system (DBMS) is the software that allows a computer to
perform database functions of storing, retrieving, adding, deleting, and modifying data.

Advantages of Database Management System (DBMS)


1. Improved data sharing
 An advantage of the database management approach is, the DBMS helps to
create an environment in which end users have better access to more and
better-managed data.
 Such access makes it possible for end users to respond quickly to changes in
their environment.
2. Improved data security
 The more users access the data, the greater the risks of data security
breaches.
 Corporations invest considerable amounts of time, effort, and money to
ensure that corporate data are used properly.
 A DBMS provides a framework for better enforcement of data privacy and
security policies.
3. Better data integration
 Wider access to well-managed data promotes an integrated view of the
organization’s operations and a clearer view of the big picture.
 It becomes much easier to see how actions in one segment of the company
affect other segments.
4. Minimized data inconsistency
 Data inconsistency exists when different versions of the same data appear
in different places.
For example, data inconsistency exists when a company’s sales department
stores a sales representative’s name as “Bill Brown” and the company’s personnel
department stores that same person’s name as “William G. Brown,” or when the
company’s regional sales office shows the price of a product as $45.95 and its
national sales office shows the same product’s price as $43.95.
 The probability of data inconsistency is greatly reduced in a properly
designed database.
14
S.BHARGAVI Lecturer in Computer science
5. Improved data access
 The DBMS makes it possible to produce quick answers to ad hoc queries.
 From a database perspective, a query is a specific request issued to the
DBMS for data manipulation—for example, to read or update the data.
 Simply put, a query is a question, and an ad hoc query is a spur-of-the-
moment question.
 The DBMS sends back an answer (called the query result set) to the
application.
6. Improved decision making
 Better-managed data and improved data access make it possible to
generate better-quality information, on which better decisions are based.
 The quality of the information generated depends on the quality of the
underlying data.
 Data quality is a comprehensive approach to promoting the accuracy,
validity, and timeliness of the data.
 While the DBMS does not guarantee data quality, it provides a framework to
facilitate data quality initiatives.
7. Increased end-user productivity
 The availability of data, combined with the tools that transform data into
usable information, empowers end users to make quick, informed decisions
that can make the difference between success and failure in the global
economy.

Disadvantages of Database Management System (DBMS):


1. Increased costs
 One of the disadvantages of dbms is Database systems require
sophisticated hardware and software and highly skilled personnel.
 The cost of maintaining the hardware, software, and personnel required to
operate and manage a database system can be substantial.
 Training, licensing, and regulation compliance costs are often overlooked
when database systems are implemented.
2. Management complexity
 Database systems interface with many different technologies and have a
significant impact on a company’s resources and culture.
 The changes introduced by the adoption of a database system must be
properly managed to ensure that they help advance the company’s
objectives.
 Given the fact that database systems hold crucial company data that are
accessed from multiple sources, security issues must be assessed
constantly.
3. Maintaining currency

15
S.BHARGAVI Lecturer in Computer science
 To maximize the efficiency of the database system, you must keep your
system current.
 Therefore, you must perform frequent updates and apply the latest patches
and security measures to all components.
 Because database technology advances rapidly, personnel training costs
tend to be significant.
 Vendor dependence. Given the heavy investment in technology and
personnel training, companies might be reluctant to change database
vendors.
 As a consequence, vendors are less likely to offer pricing point advantages
to existing customers, and those customers might be limited in their choice
of database system components.
4. Frequent upgrade/replacement cycles
 DBMS vendors frequently upgrade their products by adding new
functionality.
 Such new features often come bundled in new upgrade versions of the
software. Some of these versions require hardware upgrades.
 Not only do the upgrades themselves cost money, but it also costs money to
train database users and administrators to properly use and manage the
new features.

Classification of Database Management Systems


The DBMS is classified into different categories based on several criteria
such as the data model they are using, the number of users they support,
number of sites over which the data base is distributed and on the purpose
they serve.

Based on number of users.


 The database management system can also be classified on the basis of its
user.
 So, a DBMS can either be used by a single user or it can be used by multiple
users.
 The database system that can be used by a single user at a time is referred
to as a single-user system and the database system that can be used by
multiple users at a time is referred to as a multiple user system.
16
S.BHARGAVI Lecturer in Computer science
Based on purpose.
 Depending upon the purpose the DBMS serves.
 They are classified intotwo types
 General purpose
 Specific purpose
 DBMS is a general purpose software however it can also be designed for specific
purposes. Specific DBMS can’t be used for all applications.
Based on number of sites
Depending on the distribution of the database over numerous sites we can
classify the database as:
a. Centralized DBMS
 In the centralized DBMS, the entire database is stored in a single computer
site.
 Though the centralized database support multiple users still the DBMS
software and the data both are stores on a single computer site.

b. Distributed DBMS
 In the distributed DBMS (DDBMS) the database and the DBMS software are
distributed over many computer sites.
 These computer sites are connected via a computer network.

 The DDBMS is further classified as homogeneous DDBMS and heterogeneous


DDBMS.
 Homogeneous DDBMS: The homogeneous DDBMS has the same DBMS
software at all the distributed sites.
 Heterogeneous DDBMS: The heterogeneous DDBMS has different
DBMS software for different sites.

17
S.BHARGAVI Lecturer in Computer science
Based on data models
 Hierarchical database
Here data is organized like a tree which is similar to a folder structure in
your computer system.
The hierarchy starts from the root node, connecting all the child nodes to the
parent node.

 Network database
It also has a hierarchical structure, but the data is organized like a graph and
it is allowed to have more than one parent for one child record.
Example
Teachers can teach in multiple departments. This is shown below −

 Relation Database
This is one of the most popular data models which is used in industries. It is
based on SQL.
Every table in a database has a key field which uniquely identifies each
record.
This type of system is the most widely used DBMS.
Relational database management system software is available for personal
computers, workstation and large mainframe systems.
For example − Oracle Database, MySQL, Microsoft SQL Server etc.
Std ID Name City

201 Bob Hyderabad

18
S.BHARGAVI Lecturer in Computer science
Std ID Name City

204 Lucky Chennai

205 Pinky Bangalore

In the above student table Std ID, Name and city are called as attributes and their
values. Std ID is a primary key attribute which uniquely identifies each record in
the student table.
Various data models
Model:
A model is a representation of reality real world objects and events and their
association.
Data model:
Data model is defined as integrated collection of concepts that can be used to
describe the logical structure of database including data type’s relationship
between data and constraints that should apply on data.
Data modelling:
Data modelling is the process of creating data model for the data to be stored in
the database.
Components of data model:
A data model has 3 components 1. Structural part
2. Manipulative part
3. Integrity rules
Data model building blocks:
1. Entity: Anything about which data can be collected and stored.
Ex: student, teacher, employee etc.
2. Attribute: The characteristic of an entity.
Ex: name, salary, job etc.
3. Relationship: An association between two or more entities.
 One-one relationship
 One-many relationship
 Many-one relationship
 Many-many relationship
4. Constraint: A constraint is a restriction placed on data.
Types of data model:
There are so many types of data models. Some of the data models are
1. Hierarchical model
2. Network model
3. Relational model
4. Entity relation model
Hierarchical Model
 Hierarchical Model was the first DBMS model.
 This model organizes the data in the hierarchical tree structure.

19
S.BHARGAVI Lecturer in Computer science
 The hierarchy starts from the root which has root data and then it expands
in the form of a tree adding child node to the parent node.
 This model easily represents some of the real-world relationships like food
recipes, sitemap of a website etc.
Example: We can represent the relationship between the shoes present on a
shopping website in the following way:

Advantages of Hierarchical Model


 It is very simple and fast to traverse through a tree-like structure.
 Any change in the parent node is automatically reflected in the child node
so, the integrity of data is maintained.

Disadvantages of Hierarchical Model


 Complex relationships are not supported.
 As it does not support more than one parent of the child node so if we have
some complex relationship where a child node needs to have two parent
node then that can't be represented using this model.
 If a parent node is deleted then the child node is automatically deleted.

Network Model
 This model is an extension of the hierarchical model.
 It was the most popular model before the relational model.
 This model is the same as the hierarchical model, the only difference is that
a record can have more than one parent.
 It replaces the hierarchical tree with a graph.
Example: In the example below we can see that node student has two parents
i.e. CSE Department and Library.
This was earlier not possible in the hierarchical model.

Advantages of Network Model


20
S.BHARGAVI Lecturer in Computer science
 The data can be accessed faster as compared to the hierarchical model.
This is because the data is more related in the network model and there
can be more than one path to reach a particular node. So the data can be
accessed in many ways.
 As there is a parent-child relationship so data integrity is present. Any
change in parent record is reflected in the child record.
Disadvantages of Network Model
 As more and more relationships need to be handled the system might get
complex. So, a user must be having detailed knowledge of the model to
work with the model.
 Any change like updation, deletion, insertion is very complex.

Entity-Relationship Model
 Entity-Relationship Model or simply ER Model is a high-level data model
diagram.
 In this model, we represent the real-world problem in the pictorial form to
make it easy for the stakeholders to understand.
 It is also very easy for the developers to understand the system by just
looking at the ER diagram.
We use the ER diagram as a visual tool to represent an ER Model. ER diagram
has the following three components:
 Entities: Entity is a real-world thing. It can be a person, place, or even a
concept. Example: Teachers, Students, Course, Building, Department, etc
are some of the entities of a School Management System.
 Attributes: An entity contains a real-world property called attribute. This is
the characteristics of that attribute. Example: The entity teacher has the
property like teacher id, salary, age, etc.
 Relationship: Relationship tells how two attributes are
related. Example: Teacher works for a department.
Example:

In the above diagram, the entities are Teacher and Department. The attributes
of Teacher entity are Teacher_Name, Teacher_id, Age, Salary and

21
S.BHARGAVI Lecturer in Computer science
Mobile_Number. The attributes of entity Department entity are Dept_id,
Dept_name. The two entities are connected using the relationship. Here, each
teacher works for a department.
Advantages of ER Model
 Simple: Conceptually ER Model is very easy to build. If we know the
relationship between the attributes and the entities we can easily build the
ER Diagram for the model.
 Effective Communication Tool: This model is used widely by the database
designers for communicating their ideas.
 Easy Conversion to any Model: This model maps well to the relational
model and can be easily converted relational model by converting the ER
model to the table. This model can also be converted to any other model
like network model, hierarchical model etc.
Disadvantages of ER Model
 No industry standard for notation: There is no industry standard for
developing an ER model. So one developer might use notations which are
not understood by other developers.
 Hidden information: Some information might be lost or hidden in the ER
model. As it is a high-level view so there are chances that some details of
information might be hidden.

Relational Model
 Relational Model is the most widely used model.
 In this model, the data is maintained in the form of a two-dimensional
table.
 All the information is stored in the form of row and columns.
 The basic structure of a relational model is tables.
 So, the tables are also called relations in the relational model.
Example: In this example, we have an Employee table.

Advantages of Relational Model


 Simple: This model is simpler as compared to the network and hierarchical
model.
 Scalable: This model can be easily scaled as we can add as many rows and
columns we want.

22
S.BHARGAVI Lecturer in Computer science
 Structural Independence: We can make changes in database structure
without changing the way to access the data. When we can make changes
to the database structure without affecting the capability to DBMS to
access the data we can say that structural independence has been
achieved.
Disadvantages of Relational Model
 Hardware Overheads: For hiding the complexities and making things easier
for the user this model requires more powerful hardware computers and
data storage devices.
 Bad Design: As the relational model is very easy to design and use. So the
users don't need to know how the data is stored in order to access it. This
ease of design can lead to the development of a poor database which
would slow down if the database grows.

Components of database management systems


The term database system refers to an organization of components that define
and regulate the collection, storage, management, and use of data within a
database environment.
The five major components of database management system are
 Hardware
 Software
 People
 Procedures &
 Data
1. Hardware
 Hardware is the one of the most important component of DBMS system.
 It refers to all of the system’s physical devices like computers (PCs,
workstations, servers, and supercomputers), storage devices, printers,
network devices (hubs, switches, routers, fiber optics)and other devices
(automated teller machines, ID readers, and so on).

2. Software
23
S.BHARGAVI Lecturer in Computer science
Although the most readily identified software is the DBMS itself, to make the
database system function fully, three types of software are needed:
operating system software, DBMS software, and application programs and
utilities.
a. Operating system software:
• It manages all hardware components and makes it possible for all other
software to run on the computers.
Examples of operating system software include Microsoft Windows, Linux,
Macintosh OS, UNIX, and MVS.
b. DBMS software:
 It manages the database within the database system.
Some examples of DBMS software include Microsoft SQL Server, Oracle
Corporation’s Oracle, Sun’s MySQL, and IBM‟s DB2.
c. Application programs and utility software:
 These are used to access and manipulate data in the DBMS and to manage
the computer environment in which data access and manipulation take
place.
 Application programs are most commonly used to access data found within
the database to generate reports, tabulations, and other information to
facilitate decision making.
 Utilities are the software tools used to help manage the database system‟s
computer components.
For example, all of the major DBMS vendors now provide graphical user interfaces
(GUIs) to help create database structures, control database access, and monitor
database operations.
3. DBMS users
This component includes all DBMS users.
 On the basis of primary job functions, five types of users can be identified in
a database system:
System administrators, database administrators, database designers,
system analysts and programmers, and end users.
 Each user type, described below, performs both unique and complementary
functions. –
 System administrators oversee the database system’s general operations.
 Database administrators, also known as DBAs, manage the DBMS and
ensure that the database is functioning properly.
 Database designers design the database structure.
They are, in effect, the database architects.
If the database design is poor, even the best application programmers and
the most dedicated DBAs cannot produce a useful database environment.
Because organizations strive to optimize their data resources, the database
designer’s job description has expanded to cover new dimensions and
growing responsibilities.
 System analysts and programmers design and implement the application
programs.
They design and create the data entry screens, reports, and procedures
through which end-users access and manipulate the database’s data.

24
S.BHARGAVI Lecturer in Computer science
 End users are the people who use the application programs to run the
organization’s daily operations.
For example, salesclerks, supervisors, managers, and directors are all
classified as end users.
 High-level end users employ the information obtained from the database to
make tactical and strategic business decisions.
4. Procedures
 Procedures are the instructions and rules that govern the design and use of
the database system.
 Procedures are another important component of the DBMS system.
 Procedures play an important role in a company because they enforce the
standards by which business is conducted within the organization and with
customers.
 Procedures are also used to ensure that there is an organized way to
monitor and audit both the data that enter the database and the information
that is generated through the use of those data.
5. Data
 The word data covers the collection of facts stored in the database.
 Because data are the raw material from which information is generated, the
determination of what data are to be entered into the database and how
those data are to be organized is a vital part of the database designer‟s job.

Three schema Architecture


 The three schema architecture is also called ANSI/SPARC architecture or
threelevel architecture.
 This framework is used to describe the structure of a specific database system.
 The three schema architecture is also used to separate the user applications and
physical database.
 The three schema architecture contains three-levels. It breaks the database
down
into three different categories.
The three-schema architecture is as follows:

25
S.BHARGAVI Lecturer in Computer science
In the above diagram:
 It shows the DBMS architecture.
 Mapping is used to transform the request and response between various
database
levels of architecture.
 Mapping is not good for small DBMS because it takes more time.
 In External / Conceptual mapping, it is necessary to transform the request from
external level to conceptual schema.
 In Conceptual / Internal mapping, DBMS transform the request from the
conceptual to internal level.
1. Internal Level
 The internal level has an internal schema which describes the physical storage
structure of the database.
 The internal schema is also known as a physical schema.
 It uses the physical data model. It is used to define that how the data will be
stored in a block.
 The physical level is used to describe complex low-level data structures in detail.
2. Conceptual Level
 The conceptual schema describes the design of a database at the conceptual
level.
 Conceptual level is also known as logical level.
 The conceptual schema describes the structure of the whole database.
 The conceptual level describes what data are to be stored in the database and
also describes what relationship exists among those data.
 In the conceptual level, internal details such as an implementation of the data
structure are hidden.
 Programmers and database administrators work at this level.
3. External Level
 At the external level, a database contains several schemas that sometimes called
as subschema.
 The subschema is used to describe the different view of the
database.
 An external schema is also known as view schema.
 Each view schema describes the database part that a particular user group is
interested and hides the remaining database from that user group.
 The view schema describes the end user interaction with database systems

Costs and risks of database approach


The database approach causes some additional costs and risks that must be
recognized and managed when implementing this approach.
New, Specialized Personnel:

26
S.BHARGAVI Lecturer in Computer science
 Frequently, organizations that adopt the database approach need to hire or
train individuals to design and implement databases.
 This personnel increase seems to be expensive, but an organization should
not minimize the need for these specialized skills.
Installation and Management Cost and Complexity:
 A multi-user database management system is large and complex software
that has a high initial cost.
 It requires trained personnel to install and operate, and also has annual
maintenance costs.
 Installing such a system may also require upgrades to the hardware and
data communications systems in the organization.
Conversion Costs:
 The term “legacy systems” is used to refer to older applications in an
organization that are based on file processing.
 The cost of converting these older systems to modern database technology
may seem prohibitive to an organization.
Need for Explicit Backup and Recovery:
 A shared database must be accurate and available at all times.
 This raises the need to have backup copies of data for restoring a database
when damage occurs.
 A modern database management system normally automates recovery
tasks.
Organizational Conflict:
 A database requires an agreement on data definitions and ownership as well
as responsibilities for accurate data maintenance.
 The conflicts on data definitions, data formats and coding causes updating
of shared data.
 Handling these issues requires organizational commitment to the database
approach.

Differences between DBMS and file systems


There are the following differences between DBMS and File systems:
Basis DBMS Approach File System Approach

Meaning DBMS is a collection of data. In DBMS, The file system is a collection of


the user is not required to write the data. In this system, the user
procedures. has to write the procedures for
managing the database.

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

Data DBMS gives an abstract view of data The file system provides the
Abstraction that hides the details. detail of the data representation

27
S.BHARGAVI Lecturer in Computer science
and storage of data.

Security and DBMS provides a good protection It isn't easy to protect a file
Protection mechanism. under the file system.

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

Manipulation DBMS contains a wide variety of The file system can't efficiently
Techniques sophisticated techniques to store and store and retrieve the data.
retrieve the data.

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

Where to use Database approach used in large File system approach used in
systems which interrelate many files. large systems which interrelate
many files.

Cost The database system is expensive to The file system approach is


design. cheaper to design.

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

Structure The database structure is complex to The file system approach has a
design. simple structure.

Data In this system, Data Independence In the File system approach,


Independence exists, and it can be of two types. there exists no Data
Independence.
o Logical Data Independence

o Physical Data Independence

Integrity Integrity Constraints are easy to Integrity Constraints are difficult


Constraints apply. to implement in file system.

28
S.BHARGAVI Lecturer in Computer science
Data Models In the database approach, 3 types of In the file system approach,
data models exist: there is no concept of data
models exists.
o Hierarchal data models

o Network data models

o Relational data models

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

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

Objectives of DBMS
The various objectives of DBMS are as follows…
1. Mass Storage
 DBMS can store a lot of data in it.
 So for all the big firms, DBMS is really ideal technology to use.
 It can store thousands of records in it and one can fetch all that data
whenever it is needed.
2. Removes Duplicity
 If you have lots of data then data duplicity will occur for sure at any
instance.
 DBMS guarantee it that there will be no data duplicity among all the records.
 While storing new records, DBMS makes sure that same data was not
inserted before.
3. Multiple Users Access
 No one handles the whole database alone.
 There are lots of users who are able to access database.
 So this situation may happen that two or more users are accessing
database.
 They can change whatever they want, at that time DBMS makes it sure that
they can work concurrently.
4. Data Protection
 Information such as bank details, employee’s salary details and sale
purchase details should always be kept secured.
 Also all the companies need their data secured from unauthorized use.
 DBMS gives a master level security to their data.
 No one can alter or modify the information without the privilege of using
that data.
5. Data Backup and recovery
 Sometimes database failure occurs so there is no option like one can say
that all the data has been lost.
 There should be a backup of database so that on database failure it can be
recovered.
29
S.BHARGAVI Lecturer in Computer science
 DBMS has the ability to backup and recover all the data in database.
6. Everyone can work on DBMS
 There is no need to be a master of programming language if you want to
work on DBMS.
 Any accountant who is having less technical knowledge can work on DBMS.
7. Integrity
 Integrity means your data is authentic and consistent.
 DBMS has various validity checks that make your data completely accurate
and consistence.
8. Platform Independent
 One can run dbms at any platform.
 No particular platform is required to work on database management system.

30

You might also like