You are on page 1of 45

DATABASE MANAGEMENT

SYSTEM
Introduction to DBMS
Ms. Deepikkaa.S
Database

• Database is a collection of related data stored


in a organized manner.

• Can create, insert, update and retrieve data


easily and quickly.
DataBase & DBMS

Database DBMS
• Collection of data in a • Software used to
structure manner. manage different
database.
• The structure of
database provided by • Allows users to make
DBMS. use of the structured
data.
• Database is built on
some specific model • Supports all the
such as hierarchal, model to create a
network, relational database of specific
and object model. type.
Features of Database Systems

• Self- describing with the help of meta-data


• Program-data Independence
• Data abstraction by hiding storage details
• Multiple views for multiple user
• Concurrent access to database for retrieving
and updating table.
• Granular level Authentication and Authorization
provided.
Overall System Structure
Database Models

• Data model provides the format in which the


data is stored.
• Types:
• Hierarchal
• Network
• Relational
• Object model.
Hierarchical Model

• Upside down Tree structure.


• Parent and child relationship exists.
• This child/parent rule assures that data is
systematically accessible.
• Eg: IMS DB / DC.
• Advantage:
• Simple.
• This structure is used with organizational structures to
define the relationship between different data sets.
• Disadvantage:
• Issue of independence. Data is not completely
independent while doing an analysis.
• Non-Flexible due to 1-M relationship.
Hierarchical Model
Network Model

• Similar to hierarchical model.

• Supports complex relationship. i.e. M-M r/s.


Network Model

HR Prod . Sales
Manager Manager Manager

Phone
number

Employee1 Employee2 Employee3


Relational Model

• Created in 1970 with the core concept


Relational algebra.
• Developed by Dr. E.F. Codd
• Represent data in the format of Table.
• The tables of records can be connected by
common key values.
Relational Model

Eno Ename Dno Did Dnam Location


e
1 Priya 100 100 HR Chennai

2 Ganesh 200 200 Admin Bangalore

3 Arun 100 300 IT Chennai


Object Oriented Model

• Support objects, graphics, pictures etc..

• Popular for multimedia based application.

• Supports application developed using Java.


Schematic Represenation of the
Different Schemes
Three-Schemes Architecture
Three-Schemes Architecture

• External Scheme: An external data scheme


describes the information about the user view of
specific users (single users and user groups)
and the specific methods and constraints
connected with this information.
• Internal Scheme: The internal data scheme
describes the content of the data and the
required service functionality which is used for
the operation of the DBMS
Data Independence
• Each higher level of the data architecture is
immune to changes of the next lower level of
the architecture.
• Physical Independence: Therefore, the logical
scheme may stay unchanged even though the
storage space or type of some data is changed
for reasons of optimisation or reorganisation.
• Logical Independence: Also the external
scheme may stay unchanged for most changes
of the logical scheme. This is especially
desirable as in this case the application
software does not need to be modified or newly
translated.
Why Data Model
• To ensure that we understand
• All User Perspective

• Nature of data itself, independent of the physical


representation

• How to use data across views.

• Three phases of database design includes:


• Conceptual database design ( uses E-R Model)

Logical database design (Relational Data Model)


Physical database design.


Data Modeling

• Data Modeling is a methodology used to define


and explore what kind of data need to be stored
in the database and how it should be stored in
the database(using data structures).

Environment Tabel1 Tabel2


Data Modelling

Tabel3 Tabel4
Data Modeling

• To model a database, we need data models like


Hierarchical, Network model etc.

• Data Modeling is the design phase during the


creation of a database.

• To design a database, we use E-R diagram.


E-R Model(ERM)

• Entity – Relationship model is the abstract


conceptual representation of the structured data
in the relational Database management system.

• E-R model shows the relationship between


Entity, Attribute and Relationship among
entities using symbols.
E-R Model

Entity

Weak Entity

Relationship

Connector
E-R Model

Attribute

Key Attribute

Mutivalued Attribute

Derived Attribute

Composite Attribute
E-R Diagram Example
Types of Attributes

• Simple and composite attributes.


• Single-valued and multi-valued attributes.
• Null attributes.
• Derived attributes.
Relational Keys

• Super key
• Candidate Key
• Primary Key
• Alternate Keys
• Foreign Key
Specialization / Generalization

• Specialization: Process of maximizing


differences between members of an entity by
identifying their distinguishing characteristics.
• Generalization: Process of minimizing
differences between entities by identifying their
common characteristics.
Constraints on Specialization /
Generalization

• Two constraints that may apply to a


specialization/generalization:

 Participation constraints

 disjoint constraints.
Participation constraint

 Determines whether every member


in superclass must participate as a member of
a subclass.
 May be mandatory or optional.
Disjoint constraint

 Describes relationship between members


of the subclasses and indicates whether
member of a super class can be a member of
one, or more than one, subclass.
 May be disjoint or non-disjoint.
Mapping Cardinalities

• Express the number of entities to which another


entity can be associated via a relationship set.

• Types:
 One to One
 One to many
 Many to one
 Many to many
Alternative Terminology

• Table  Relation
• Row  Tuple
• Column  Attribute
• No. of rows  Cardinality
• No. of Columns  Degree of the table
Relational Operators

• There are 8 relational operators


• 1. Restrict => Works with one table and retrieve
rows based on condition
• 2. Project => Works with one table and retrieve
columns based on condition
• 3. Product => Works with many table & gives
Cartesian product (A x B)
• 4. Union => Works with many table result in
(A U B)
Relational Operators

• 5. Intersect => Works with many table result


in (A ∩ B)
• 6. Difference => Works with many table result in
(A - B)
• 7. Join => Works with many table result
selection of rows based on some
condition
• 8. Division => Works with many table result
selection of rows that matches
combination of every row in other table
Normalization

• Splitting-up of a larger table into smaller table


based upon a condition.
• Why Normalization?
 Avoid data redundancy

 To avoid inconsistent dependency.

• To do normalization certain rules are followed


which are called “NORMAL FORM”.
• Domain  Set of related attributes together
Normalization

• Types:

 First Normal Form (1 NF)

 Second Normal Form (2 NF)

 Third Normal Form (3 NF)

 Boyce code Normal Form (BCNF)


First Normal Form (1NF)

• A relation is in 1NF if and only if all underlying


domains contain atomic values only.
• Aim : Deals only with the basic structure of the
relation.
• End result :
 No redundant column value from the same table.

 Primary key values are identified.


Second Normal Form (2NF)

• A relation is in 2NF if it is in 1NF and every non-


key attribute is fully dependent on each
candidate key of the relation.
• Aim : To ensure that all information in one
relation is only about one thing.
• End result:
 Remove subsets of data that apply to multiple
rows of a table and place them in separate
tables.
 Introduce Foreign key to create relationship
between the separated table.
Third Normal Form (3NF)

• A relation R is in third normal form if it is in 2NF


and every non-key attribute of R is non-
transitively dependent on each candidate
key of R.
Boyce Codd Normal Form (BCNF)

• A relation R is said to be in BCNF if whenever


X -> A holds in R, and A is not in X, then X is a
candidate key for R.
SQL

• DDL - create, alter, drop,truncate,rename


• DML - insert, update,delete,merge
• DCL – grant,revoke
• DQL - select
• TCL – commit,rollback,savepoint
Data Warehousing

• A data warehouse is a software product that is


used to store large volumes of data and run
specifically designed queries and reports.
• Process – ETL(Extract, Transform , Load)
• Data warehousing is the process that is used to
integrate and combine data from multiple
sources and format into a single unified
schema.
• Organization use this for decision making.
• Subject Oriented and not Application oriented.
• Can have redundant data.
Data Warehouse Architecture

Relational
Databases
Optimized Loader
Extraction
ERP
Systems Cleansing

Data Warehouse
Engine Analyze
Purchased Query
Data

Legacy
Data Metadata Repository
43
Data Fragmentation

• A single object can be broken into two or more


segments or fragments. The details about
fragments are maintained in the distributed data
catalog (DDC).
• Data Fragmentation may be
 Horizontal – subset of tuples
 Vertical – attribute subset.(Key repeated)
 Mixed
DataMining

• Data mining is the process of extracting


interesting patterns and knowledge from huge
amount of data.
• Apply data mining techniques on the data
warehouse of an enterprise to discover useful
patterns.
• Used for models and forecasting.
• Data Warehousing provides the Enterprise with
a memory. Data Mining provides the
Enterprise with intelligence.

You might also like