0% found this document useful (0 votes)
252 views

18CS53 - Database Management System

The document provides an overview of the Database Management System (DBMS) course including the instructor details, modules covered, and characteristics of the database approach. The key topics covered include conceptual data modeling using entities and relationships, data independence, concurrency control, and the history of database applications from hierarchical to relational and current systems.

Uploaded by

YASHASHWINI S
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
252 views

18CS53 - Database Management System

The document provides an overview of the Database Management System (DBMS) course including the instructor details, modules covered, and characteristics of the database approach. The key topics covered include conceptual data modeling using entities and relationships, data independence, concurrency control, and the history of database applications from hierarchical to relational and current systems.

Uploaded by

YASHASHWINI S
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

18CS53 - Database Management System

Subject: Database Management System


Semester : V

Course Instructor: Dr. Mannar Mannan J


Department of Information Science and
Engineering, CMRIT – Bangalore.
Email Id: [email protected]
Phone: 09677357738
2
DBMS - Module 1

Introduction to Databases  Conceptual Data modeling


Introduction
Using Entities and Relationship
Characteristicsof Data base Approach
 Entity Types
Advantages of using the DBMS approach
 Entity
sets
History of database applications.
 Attributes
Overview of Database Languages and Architectures
 Roles
Data Models
 Structural Constraints
Schemas and Instances
Three Schema Architecture and Data Independence  Weak Entity Types

Database Languages and Interfaces  ER diagrams – Examples


 Specialization and Generalization
3
Introduction

• A database is a collection of Related data


• Facts that can be recorded and that have implicit meaning
4
Characteristics of the Database Approach

• Self-describing nature of a database system


• Insulation between programs and data, and data abstraction
• Support of multiple views of the data
• Sharing of data and multiuser transaction processing
Self-describing nature of a database system

• Database system contains not only the database itself but also a complete definition or
description of the database structure and constraints
• This definition is stored in the DBMS catalog, which contains information such as the structure
of each file, the type and storage format of each data item, and various constraints on the data.
The information stored in the catalog is called meta-data, and it describes the structure of the
primary database
5

Insulation between programs and data, and data abstraction

• In the file processing, the structure of data files is embedded in the application programs, so any
changes to file structure may require changing the application program that access those files.
• Whereas DBMS access programs do not require such changes in most cases.
• The structure of data files is stored in the DBMS catalog separately from the access programs.
We call this property as program-data independence.
• The characteristic that allows program-data independence and program-operation independence
is called data abstraction.
• A DBMS provides users with a conceptual representation of data that does not include many of
the details of how the data is stored or how the operations are implemented.
6

Support of multiple views of the data


• A database typically has many types of users, each of whom may require a different perspective
or view of the database.
• A view may be a subset of the database or it may contain virtual data that is derived from the
database files but is not explicitly stored.
• A multiuser DBMS whose users have a variety of distinct applications must provide facilities for
defining multiple views
7

Sharing of Data and Multiuser Transaction Processing


• This is essential if data for multiple applications is to be integrated and maintained in a single
database.
• The DBMS must include concurrency control software to ensure that several users trying to update
the same data
8
Advantages of Using the DBMS Approach

Controlling Redundancy
• Storing same data multiple times can be avoided
• Second, storage space is wasted when the same data is stored repeatedly, and this problem may be
serious for large databases
• Third, files that represent the same data may become inconsistent.
• In the database approach, the views of different user groups are integrated during database design
Restricting Unauthorized Access
• When multiple users share a large database, it is likely that most users will not be authorized to
access all information in the database.
• For example, financial data such as salaries and bonuses is often considered confidential, and only
authorized persons are allowed to access such data.
• A DBMS should provide a security and authorization subsystem, which the DBA uses to create
• accounts and to specify account restrictions. 07/14/2022
9

Providing Persistent Storage for Program Objects


• Databases can be used to provide persistent storage for program objects and data structures.
This is one of the main reasons for object-oriented database systems

Providing Storage Structures and Search Techniques for Efficient Query Processing
• Database systems must provide capabilities for efficiently executing queries and updates. Because
the database is typically stored on disk, the DBMS must provide specialized data structures and
search techniques to speed up disk search for the desired records.
• The query processing and optimization module of the DBMS is responsible for choosing an
efficient query execution plan for each query based on the existing storage structures.
10

Providing Backup and Recovery


A DBMS must provide facilities for recovering from hardware or software failures. The backup and
recovery subsystem of the DBMS is responsible for recovery.

Providing Multiple User Interfaces


Because many types of users with varying levels of technical knowledge use a database, a DBMS
should provide a variety of user interfaces. These include apps for mobile users, query languages
for casual users, programming language interfaces for application programmers, forms and
command codes for parametric users, and menu-driven interfaces and natural language interfaces
for standalone users.

07/14/2022
11

Representing Complex Relationships among Data


A DBMS must have a capability to represent variety of complex relationships among the data, to define
the new relationship.

Enforcing Integrity Constraints


A DBMS may have certain integrity constraints, and the DBMS should capable of enforcing these
constraints.
Eg., Relationship between two tables. If deleting data from one table, it should immediately
reflect on the other table.
Ex2. Key constraint, Integrity Constraint, etc.,
Permitting Inferencing and Actions Using Rules and Triggers
Some Database system provide capabilities for defining deduction rules for inferencing new
information from the stored database facts. (Instead of writing declarative rules, we can use triggers)
07/14/2022
12

Additional Implications of Using the Database Approach


• Potential for Enforcing Standards
• Reduced Application Development Time
• Flexibility
• Availability of Up-to-Date Information
• Economies of Scale

07/14/2022
13

A Brief History of Database Applications

• Early Database Applications Using Hierarchical and Network Systems


Eg., In University application, similar information would be kept for each student,
each grade, each course. Here, there are many types of data and interrelationships among
them.
Intermixing of conceptual relationship with the physical storage and placement of
records on disk.

• Providing Data Abstraction and Application Flexibility with Relational Databases


• Data abstraction and program-data independence were much improved when
compared to earlier systems
14

• Object-Oriented Applications and the Need for More Complex Databases


• abstract data types, encapsulation of operations, inheritance, and object identity
• Interchanging Data on the Web for E-Commerce Using XML
• Documents can be linked through hyperlinks, which are pointers to other
documents
• Extending Database Capabilities for New Applications
• Scientific, Storage and retrieval of images, Data mining, Spatial, Time series
• Emergence of Big Data Storage Systems and NOSQL (Not-Only SQL) Databases

07/14/2022
15
Database System Concepts and Architecture

Data Models, Schemas, and Instances

Data abstraction generally refers to the suppression of details of data organization and storage, and the
highlighting of the essential features for an improved understanding of data One of the main characteristics
of the database approach is to support data abstraction so that different users can perceive data at their
preferred level of detail

A data model—a collection of concepts that can be used to describe the structure of a database By structure
of a database we mean the data types, relationships, and constraints that apply to the data. Most data models
also include a set of basic operations for specifying retrievals and updates on the database.

Include concepts in the data model to specify the dynamic aspect or behavior of a database application
16

Categories of Data Models


High-level or conceptual data models provide concepts that are close to the way many users perceive
data, whereas low-level or physical data models provide concepts that describe the details of how data is
stored on the computer storage media, typically magnetic disks.

Conceptual data models use concepts such as entities, attributes, and relationships. An entity represents a real-
world object or concept.
An attribute represents some property of interest that further describes an entity, such as the employee’s
name or salary.
Entity–relationship model—a popular high-level conceptual data model. A relationship among two or
more entities represents an association among the entities.

Other Data models are


Relational data model, as well as the so-called legacy data models—the network and hierarchical models, and
object data model (OMG) Object Data Management Group (ODMG)
17

Schemas, Instances, and Database State


The description of a database is called the database schema A displayed schema is called a displayed
schema is called a schema diagram

Student
Name Student_Number Class Major

Course
Course_Name Course_Number Credit_Hours Department

Prerequisite
Course_Number Prerequisite_Number
18
Three-Schema Architecture and Data Independence

The internal level has an internal


schema, which describes the physical
storage structure of the database. The
internal schema uses a physical data
model and describes the complete
details of data storage and access
paths for the database.

07/14/2022
19

The conceptual level has a conceptual schema, which describes the structure of the whole database
for a community of users. The conceptual schema hides the details of physical storage structures and
concentrates on describing entities, data types, relationships, user operations, and constraints.

The external or view level includes a number of external schemas or user views. Each external
schema describes the part of the database that a particular user group is interested in and hides the
rest of the database from that user group.

07/14/2022
20
Data Independence

Logical data independence is the capacity to change the conceptual schema without having to change
external schemas or application programs. We may change the conceptual schema to expand the
database (by adding a record type or data item), to change constraints, or to reduce the database.

Physical data independence is the capacity to change the internal schema without having to change
the conceptual schema. Hence, the external schemas need not be changed as well.

07/14/2022
21
Database Languages and Interfaces

DDL – Data Definition Languages – used by DBA and by database designers to schemas

DML – Data Manipulation Language – Manipulations include retrieval, insertion, deletion, and modification of the data

SDL – Storage Definition Language – is used to specify internal schema

DBMS Interfaces • Menu-based Interfaces for Web Clients or Browsing Apps for Mobile Devices
• Forms-based Interfaces
• Graphical User Interfaces
• Natural Language Interfaces
• Keyword-based Database Search
• Speech Input and Output
• Interfaces for Parametric Users
• Interfaces for the DBA 07/14/2022
22
The Database System Environment

07/14/2022
23

Database System Utilities

Loading – Loading utility is used to load existing data files—such as text files or sequential files—into the
database

Backup – Backup utility creates a backup copy of the database, usually by dumping the entire database onto tape
or other mass storage medium.

Database storage reorganization – This utility can be used to reorganize a set of database files into different file
organizations and create new access paths to improve performance.

Performance monitoring – Such a utility monitors database usage and provides statistics to the DBA.

07/14/2022
24

Tools, Application Environments, and Communications Facilities

• Data dictionary
• Information Repository
• Application Development Environment
• Communication Software

07/14/2022
25
Data Modeling Using the Entity–Relationship (ER) Model

Using High-Level Conceptual Data Models for Database Design

• The first step is requirements collection and


analysis.
• The database designers interview prospective database
users to understand and document their data
requirements.
• Describe functional requirements and User defined
operations
• Create a conceptual schema for the database, using a
high-level conceptual data model – is known as
Conceptual design.
07/14/2022
26
A Sample Database Application

COMPANY - Database
We list the data requirements for the database here, and then create its conceptual schema step-by-step as we
introduce the modeling concepts of the ER model.
The COMPANY database keeps track of a company’s employees, departments, and projects.

• The company is organized into departments. Each department has a unique name, a unique number, and a
particular employee who manages the department. We keep track of the start date when that employee
began managing the department. A department may have several locations.
• A department controls a number of projects, each of which has a unique name, a unique number, and a
single location.
• The database will store each employee’s name, Social Security number, address, salary, gender, and birth
date. An employee is assigned to one department, but may work on several projects, which are not
necessarily controlled by the same department.
• The database will keep track of the dependents of each employee for insurance purposes, including each
07/14/2022
dependent’s first name, gender, birth date, and relationship to the employee.
27

Entity Types and Entity Sets - A database usually contains groups of entities that are similar.

An entity type describes the schema or intension for a set of entities that share the same structure (Employee
Entities). The collection of entities of a particular entity type is grouped into an entity set, which is also called
the extension of the entity type.

Key Attributes of an Entity Type

An important constraint on the entities of an entity type is the key or uniqueness constraint on attributes.
key attribute - An entity type usually has one or more attributes whose values are distinct for each individual
entity in the entity set

07/14/2022
28

Composite versus Simple (Atomic) Attributes

• Composite attributes can be divided into smaller subparts, which represent more basic attributes
with independent meanings.
• Attributes that are not divisible are called simple or atomic attributes
• Single-Valued versus Multivalued Attributes - attributes have a single value for a particular
entity & a attribute having multiple value is multivalued attributes.
• Stored versus Derived Attributes – Date of Birth & Age
• NULL Values

Complex Attributes - Composite and multivalued attributes can be nested arbitrarily

07/14/2022
29

Schema – Student (USN, Name, DoB, Mobile No)

USN Name DoB Mobile No


1CR19IS001 ABCD 8/02/1990 1254785842
1CR19IS002 EFGH 7/04/1991 1254857254
1CR19IS003 IJKL 1/09/1992 5257845236
1CR19IS004 MNOP 14/03/1991 8754985671

07/14/2022
30
ER – Diagram

Rectangle: Represents Entity sets.


Ellipses: Attributes
Diamond: Relationship Set
Double Diamond: Identifying Relationship
Lines: They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses: Multivalued Attributes
Dashed Ellipses: Derived Attributes
Double Rectangles: Weak Entity Sets
Double Lines: Total participation of an entity in a relationship set

07/14/2022
31

Components of a ER Diagram
ER Model

Entity Attribute Relationship

key One-to-One

Composite One-to-Many

Multivalued Many-to-One
Weak Entity

Derived Many-to-Many 07/14/2022


32

LOCATIONS NAME NUMBER MANAGER MANAGER_START_DATE


NUMBER

NAME
MANAGER

DEPARTMENT
LOCATIO
LOCATIONS
MANGER_ST
NS ART_DATE

Number

Name Controlling_
department LOCATIONS NAME NUMBER Controlling Departments

PROJECT
LOCAT
Location
IONS 07/14/2022
33

LName

Minit
Salary
FName
Name Aadhar

Gender
Department

Employee
Birth_Date

07/14/2022
34

 The Company Organized into departments. Each dept. has a unique name,
number, and who manages the dept.(employee), and date he manages the
dept.
 Department controls ‘n’ number of projects. Each dept. has unique name,
number, and single location.
 Employee – name, Aadhar, address, salary, gender, and DOB
 An employee may associate with dept. but may work on several projects

07/14/2022
35

 Relations: - Company Databases


 EMPLOYEE DEPARTMENT
 SUPERVISION - EMPLOYEE CONTROLS - PROJECT
 WORKFOR - DEPARTMENT
 MANAGES - DEPARTMENT
 WORKS ON - PROJECT
 DEPENDENTS_OF - DEPENDENT

07/14/2022
36

Relationship Types, Relationship Sets, Roles, and Structural Constraints


Whenever an attribute of one entity type refers to another entity type, some relationship exists.
• For example, the attribute Manager of DEPARTMENT refers to an employee who manages the department
• attribute Controlling_department of PROJECT refers to the department that controls the project
• In the ER model, these references should not be represented as attributes but as relationships

Relationship Types, Sets, and Instances

• A relationship type R among n entity types E1, E2, . . . , En defines a set of associations— or a
relationship set—among entities from these entity types.
• Similar to the case of entity types and entity sets, a relationship type and its corresponding relationship
set are customarily referred to by the same name, R.

07/14/2022
37

Relationship – Mapping Cardinality

A relationship is represented by diamond shape in ER diagram, it shows the relationship


among entities. There are four types of relationships

There are four types of relationships


1. One to One
2. One to Many
3. Many to One
4. Many to Many
07/14/2022
38

1. One to One Relationship


When a single instance of an entity is associated with a single instance of
another entity then it is called one to one relationship. For example, a person
has only one passport and a passport is given to one person.

1 1
Person has Phone

07/14/2022
39

One to Many Relationship


When a single instance of an entity is associated with more than one instances
of another entity then it is called one to many relationship. For example – a
customer can place many orders but a order cannot be placed by many
customers

1 M
Customer Placed Order

07/14/2022
40

Many to One Relationship


When more than one instances of an entity is associated with a single instance
of another entity then it is called many to one relationship. For example –
many students can study in a single college but a student cannot study in many
colleges at the same time.

M 1
Students Study College

07/14/2022
41

 Many to Many Relationship


When more than one instances of an entity is associated with more than one
instances of another entity then it is called many to many relationship. For
example, a can be assigned to many projects and a project can be assigned to
many students
M Assign M
Student ed
Project

07/14/2022
42

Total Participation of an Entity set


A Total participation of an entity set represents that each entity in entity set
must have at least one relationship in a relationship set. For example: In the
below diagram each college must have at-least one associated Student

S_addr
S_Name Col_id Col_name

USN Student
Study
College
IN

07/14/2022
43

The main difference between entity and


relationship in DBMS is that the entity is a
real-world object while the relationship is
an association between the entities.

• A rectangle represents an entity in the ER


diagram.
• A double rectangle represents a weak
entity
• Oval represents the attributes of an entity
07/14/2022
44

07/14/2022
45

Generalization is a process in which the common attributes of more than one entities
form a new entity. This newly formed entity is called generalized entity

Lets say we have two entities Student and Teacher.


Attributes of Entity Student are: Name, Address & Grade
Attributes of Entity Teacher are: Name, Address & Salary

These two entities have two common attributes: Name


and Address, we can make a generalized entity with these
common attributes. Lets have a look at the ER model
after generalization

07/14/2022
46

We have created a new generalized entity Person Name Person Address


and this entity has the common attributes of both
the entities. As you can see in the given ER
Diagram that after the generalization process the
entities Student and Teacher only has the
specialized attributes Grade and Salary respectively
and their common attributes (Name & Address) are Grade Salary
now associated with a new entity Person which is Is A
in the relationship with both the entities (Student &
Teacher)

Student Teacher

07/14/2022
47

1. Generalization uses bottom-up approach where two or more lower level


entities combine together to form a higher level new entity.
2. The new generalized entity can further combine together with lower level
entity to create a further higher level generalized entity.

07/14/2022
48

Specialization Name Employee Salary

Specialization is a process in which


an entity is divided into sub-entities.
You can think of it as a reverse
Is A
process of generalization, in
generalization two entities combine
together to form a new higher level Technician Engineer Accountant
entity. Specialization is a top-down
process
Credit_D
Service Project ebit

07/14/2022
49

Specialization is to find the subsets of entities that have few


distinguish attributes. For example – Consider an entity employee
which can be further classified as sub-entities Technician, Engineer
& Accountant because these sub entities have some distinguish
attributes.

07/14/2022
50
Text books and Reference books

Text Books
Fundamentals of Database Systems, Ramez ElmasriandShamkantB.Navathe,7 thEdition,2017,Pearson. ISBN: 978-0-13-397077-7
1.  

Databasemanagementsystems,Ramakrishnan,andGehrke,3 rdEdition,2014, McGrawHill ISBN-10: 0072465638 


2.

Reference Books
Silberschatz Korth and Sudharshan, Database System Concepts, 6 th Edition,Mc-GrawHill,2013.  ISBN-10: 9332901384
1.    

Coronel, Morris, and Rob, Database Principles Fundamentals of Design, Implementation and Management, Cengage
2.  Learning2012. ISBN 9781285196145
51
Some useful links

https://www.cs.uregina.ca/Links/class-info/215/erd/#:~:text=Data%20modeling%20is%20a%20technique,data%20
requirements%20for%20a%20database
https://www.geeksforgeeks.org/generalization-specialization-and-aggregation-in-er-model/
https://www.guru99.com/relational-data-model-dbms.html
https://www.tutorialspoint.com/dbms/relational_algebra.htm
52

Thank You

You might also like