Introduction To Data Base Mangement
Introduction To Data Base Mangement
INTRODUCTION TO DBMS
TOPICS TO DISCUSS
➢ Overview of DBMS
➢ File system versus a DBMS
➢ Advantages of a DBMS
➢ Three Schema architecture of DBMS
➢ Data Models
➢ Database Languages
➢ Transaction Management
➢ Structure of a DBMS
➢ Client/Server Architecture
➢ Database Administrator and Users
OVERVIEW OF DBMS
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.
Needs Definition of 3 Terms
➢ Data
➢ Information
➢ Database
➢ DBMS
Data: are the raw facts collected for processing (or) unprocessed
raw information
In simple terms:
➢ Raw facts
➢ Unprocessed raw information
➢ Stored in database or file
➢ Unorganized
Information: Processed data are called as information (or)
processed outcome of data.
In simple terms:
Processed data
Organized / arranged data
Refers to that are concerned with particular entities.
Types of Data:
Quantitative Data: refers to data that are strictly numbers
Qualitative Data: refers to data that are expressed in categorical
Database:
➢ It is organized collection of data
➢ Database or D/B is organized in various models for every
processing
Three Types :
➢ Relational Model
➢ Hierarchical Model
➢ Network model
Relational Model:
➢ In relational model, the data and relationships are
represented by collection of inter-related tables.
➢ Each table is a group of column and rows, where column
represents attribute of an entity and rows represents records.
It has 4 components:
Components:
E1
E2
E3
E4
Cardinality Constraints
Cardinality defines the number of entities in one entity set,
which can be associated with the number of entities of other
set via relationship set.
Cardinality are of 4 types:
➢ One to one
➢ One to many
➢ Many to one
➢ Many to many
One-to-one : One entity from entity set A can be
associated with at most one entity of entity
set B and vice versa.
For example, if a person and passport are two identities, then
one person can have exactly one passport and only one
passport can be assigned to a person.
One-to-many : One entity from entity set A can
be associated with more than one entities of
entity set B however an entity from entity set
B, can be associated with at most one entity.
For example, one teacher can teach many
students at a time.
Many-to-one − More than one entities from entity set
A can be associated with at most one entity of entity
set B, however an entity from entity set B can be
associated with more than one entity from entity set
A.
For example, let us consider two tables employee
table and a department table. Here many
employees can work for one department.
Many-to-many − One entity from A can be
associated with more than one entity from B
and vice versa.
For example, a many-to-many relationship exists between
customers and products: customers can purchase various
products, and products can be purchased by many
customers.
Entity Types
An entity is referred to as an object or thing that exists in the real world. For
example, customer, car, pen, etc.
Entity Type:
➢ A collection of entities with general characteristics is known as an entity
type.
➢ For example, a database of a corporate company has entity types such as
employees, departments, etc.
➢ In DBMS, every entity type contains a set of attributes that explain the
entity.
➢ The Employee entity type can have attributes such as name, age, address,
phone number, and salary.
➢ The Department entity type can have attributes such as name, number,
and location in the department.
➢ Strong Entity
➢ Weak Entity
Strong Entity Type
Strong Entity Type: It is an entity that has its own existence and
is independent.
The entity relationship diagram represents a strong entity type
with the help of a single rectangle. Below is the ERD of the
strong entity type:
Weak Entity Type: It is an entity that does not have its own
existence and relies on a strong entity for its existence.
The Entity Relationship Diagram represents the weak entity type
using double rectangles. Below is the ERD of the weak entity
type:
➢ The relationship between a strong and a weak entity type is
known as an identifying relationship.
➢ Using a double diamond, the Entity-Relationship Diagram
represents a relationship between the strong and the weak
entity type.
Sub Classes and Inheritance
The Enhanced Entity Relationship Model contains all the features
of the Entity Relationship model.
In addition to all that, it also contains features of
➢ Subclasses,
➢ Super classes
➢ Inheritance.
Subclasses:
A subclass is a class derived from the superclass. It inherits the
properties of the superclass and also contains attributes of its
own.
An example is:
➢ Car, Truck and Motorcycle are all subclasses of the superclass
Vehicle.
➢ They all inherit common attributes from vehicle such as
speed, colour etc.
➢ while they have different attributes also i.e Number of wheels
in Car is 4 while in Motorcycle is 2.
Superclasses
➢ A superclass is the class from which many subclasses can be
created. The subclasses inherit the characteristics of a
superclass. The superclass is also known as the parent class or
base class.
➢ In the above example, Vehicle is the Superclass and its
subclasses are Car, Truck and Motorcycle.
Inheritance
➢ Inheritance is basically the process of basing a class on
another class i.e to build a class on a existing class. The new
class contains all the features and functionalities of the old
class in addition to its own.
➢ The class which is newly created is known as the subclass or
child class and the original class is the parent class or the
superclass.
Example for super class, sub class and
inheritance
Generalization and Specialization
Generalization:
➢ It works on the principle of bottom up approach. In
Generalization lower level functions are combined to form
higher level function which is called as entities. This process is
repeated further to make advanced level entities.
➢ In the Generalization process properties are drawn from
particular entities and thus we can create generalized entity.
We can summarize Generalization process as it combines
subclasses to form superclass.
Consider two entities Student and Patient. These two entities will have some
characteristics of their own. For example Student entity will have Roll_No,
Name and Mob_No while patient will have PId, Name and Mob_No
characteristics. Now in this example Name and Mob_No of both Student
and Patient can be combined as a Person to form one higher level entity
and this process is called as Generalization Process.
Specialization
We can say that Specialization is opposite of Generalization. In
Specialization things are broken down into smaller things to
simplify it further.
We can also say that in Specialization a particular entity gets
divided into sub entities and it’s done on the basis of it’s
characteristics. Also in Specialization Inheritance takes place.
Example:
Consider an entity Account. This will have some attributes consider them
Acc_No and Balance. Account entity may have some other attributes like
Current_Acc and Savings_Acc. Now Current_Acc may have Acc_No,
Balance and Transactions while Savings_Acc may have Acc_No, Balance
and Interest_Rate henceforth we can say that specialized entities inherits
characteristics of higher level entity.
Participation Constraints
The participation constraints specifies the
number of instances of an entity can
participate in a relationship set.
Two Types:
➢Total Participation
➢Partial Participation
Total Participation
If every entity in E participate in atleast on
relationship in R is said to be Total
Participation
Denoted by double line
borro
Customer Loan
wer
Conceptual Database Design With the
ER Model
For designing conceptual scheme for large enterprises we are
required with 5 steps.
➢ Identify the entities
➢ Find the relationships
➢ Identify the key attributes for each entity
➢ Indentify the other attributes for each entity
➢ Complete ER Diagram
ER Diagram for a Company
➢ One company has so many kinds of employees
➢ Some of the employees are supervisors
➢ The company has so many departments
➢ Some of the employees manage the department
➢ Employees works on a project
➢ Department controls the project
➢ Company maintains the details of the dependencies
of the particular employee
Step-1:
Identify the entities:
➢ Employee- Strong entity
➢ Department- Strong entity
➢ Project- Strong entity
➢ Dependencies- Weak entity
Step-2:
Identify the Relationship
➢ Works for
➢ Manages
➢ Works on
➢ Controls
➢ Depends- Weak relationship
Step-3:
Identify key attribute
➢ Emp_no (primary key)
➢ Dept_no (primary key)
➢ Prjt_no (primary key)
➢ D_no (foreign key)
Step-4:
Identify the other attributes
➢ Emp_name, addr, dob
➢ Dept_name, Dept_loc
➢ P_name, P_date
Complete ER Diagram