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

Database Management System

Lecture 02
By Hemant Tulsani
Assistant Professor
ECE Department

Department of Electronics and Communication Engineering 1


Maharaja Agrasen Institute of Technology
Till now we have covered…
• Database and Database Management Systems
• File system and its drawbacks
• Schemas and Instances
• Levels of Abstraction

Department of Electronics and Communication Engineering 2


Maharaja Agrasen Institute of Technology
In this lecture…
• Data Independence
• Data Models
• Database Languages and SQL
• Database Design
• Database Engine
• Database Users
• Database Architecture

Department of Electronics and Communication Engineering 3


Maharaja Agrasen Institute of Technology
Data Independence
• Capacity to change the schema at one level of abstraction without having
to change schemas at another level.
• Only the mapping between the two levels is changed.
• Physical data independence
– capacity to change the internal (physical) schema without having to change the
conceptual (or external) schemas
– for example, by creating additional access structures—to improve the
performance of retrieval or update.

Department of Electronics and Communication Engineering 4


Maharaja Agrasen Institute of Technology
Data Independence
• Logical data independence
– capacity to change the conceptual (logical) schema without having to change
external (view level) schemas or application programs.
– to expand the database (by adding a record type or data item), or to reduce the
database (by removing a record type or data item).
– Application programs must work after the conceptual schema undergoes a
logical reorganization as well.

• In general, the interfaces between the various levels and components


should be well defined so that changes in some parts do not seriously
influence others.
Department of Electronics and Communication Engineering 5
Maharaja Agrasen Institute of Technology
Data Models
• Underlying the structure of a database
• A collection of tools for describing
– Data
– Data relationships
– Data semantics
– Data constraints
• Relational model
• Entity-Relationship data model (mainly for database design)
• Object-based data models (Object-oriented and Object-relational)
• Semi-structured data model (XML)
• Other older models:
– Network model
– Hierarchical model
Department of Electronics and Communication Engineering 6
Maharaja Agrasen Institute of Technology
Entity-Relationship Data Model
• Models an enterprise as a collection of entities and relationships
– Entity: a “thing” or “object” in the enterprise that is distinguishable from other
objects
• Described by a set of attributes
– Relationship: an association among several entities
• Represented diagrammatically by an entity-relationship diagram:

Department of Electronics and Communication Engineering 7


Maharaja Agrasen Institute of Technology
Relational Model
• The relational model uses a collection of tables to represent both data and the
relationships among those data.
• Each table has multiple columns, Attributes,
Columns
and each column has a unique name.

Faculty
Rows
Tuples,
Records
Relation Name
Table

Department of Electronics and Communication Engineering 8


Maharaja Agrasen Institute of Technology
Object Based Data Models
• Relational model: flat, “atomic” values
• Object Relational Data Models
– Extend the relational data model by including object orientation and constructs
to deal with added data types.
– Allow attributes of tuples to have complex types, including non-atomic values
such as nested relations.
– Preserve relational foundations, in particular the declarative access to data,
while extending modeling power.
– Provide upward compatibility with existing relational languages.

Department of Electronics and Communication Engineering 9


Maharaja Agrasen Institute of Technology
Object Relational Data Model

Department of Electronics and Communication Engineering 10


Maharaja Agrasen Institute of Technology
Extensible Markup Language (XML)
• Defined by the WWW Consortium (W3C)
• Originally intended as a document markup language not a database
language
• The ability to specify new tags, and to create nested tag structures made
XML a great way to exchange data, not just documents
• XML has become the basis for all new generation data interchange
formats.
• A wide variety of tools is available for parsing, browsing and querying
XML documents/data

Department of Electronics and Communication Engineering 11


Maharaja Agrasen Institute of Technology
XML Example
<mydata> // database
<authors> // table
<author> //tuple
<name>Robert Roberts</name> //attribute
<address>10 Tenth St, Decapolis</address>
<editor>Ella Ellis</editor>
<born>1960/05/26</born>
</author>
<author>
<name>Tom Thomas</name>
<address>2 Second Av, Duo-Duo</address>
<editor>Ella Ellis</editor>
</author>
</mydata>
Department of Electronics and Communication Engineering 12
Maharaja Agrasen Institute of Technology
Database Languages and SQL
• Data Definition Language (DDL)
– Specification notation for defining the database schema
• Data Manipulation Language (DML)
– Language for accessing and manipulating the data organized by the appropriate data
model
• Data Control Language (DCL)
– allows database administrators to configure security access of users to relational
databases.
• SQL
– The most widely used commercial language

Department of Electronics and Communication Engineering 13


Maharaja Agrasen Institute of Technology
Database Design
• The process of designing the general structure of the database
• Logical Design – Deciding on the database schema. Database design
requires that we find a “good” collection of relation schemas.
– Business decision – What attributes should we record in the database?
– Computer Science decision – What relation schemas should we have and
how should the attributes be distributed among the various relation schemas?
• Physical Design – Deciding on the physical layout of the database
– File organization
– Internal storage structures

Department of Electronics and Communication Engineering 14


Maharaja Agrasen Institute of Technology
Database Design (Cont.)
Any
problem
with this
relation?

Department of Electronics and Communication Engineering 15


Maharaja Agrasen Institute of Technology
Database Design (Cont.)
• Need to come up with a methodology to ensure that each of the relations in the
database is “good”
• Two ways of doing so:
– Entity Relationship Model
• Models an enterprise as a collection of entities and relationships
• Represented diagrammatically by an entity-relationship diagram:
– Normalization Theory
• Formalize what designs are bad, and test for them

Department of Electronics and Communication Engineering 16


Maharaja Agrasen Institute of Technology
Database Design (Cont.)
• Entity Relationship Model

Department of Electronics and Communication Engineering 17


Maharaja Agrasen Institute of Technology
Database Design (Cont.)
• Normalize Table
• Undesirable properties in a bad
design
– Repetition of information
• Changing budget needs
multiple row update
– Inability to represent certain
information
• New department cannot be
added if no faculty is there

Department of Electronics and Communication Engineering 18


Maharaja Agrasen Institute of Technology
Database Design (Cont.)
• Normalized Tables
• Table 1: instructor
– ID
– name
– salary
– dept_id
• Table 2: department
– ID
– dept_name
– building
– budget

Department of Electronics and Communication Engineering 19


Maharaja Agrasen Institute of Technology
Database Design (Cont.)
• Normalized Tables
• Table 1: instructor
– ID
– name
– salary
– dept_id
• Table 2: department
– ID
– dept_name
– building
– budget

Department of Electronics and Communication Engineering 20


Maharaja Agrasen Institute of Technology
Database Engine
• Storage management: program module that provides the interface
between the low-level data stored in the database and the application
programs and queries submitted to the system

• Query processing: Parsing and translation, Optimization, Evaluation

• Transaction Management: transaction control and concurrency control

Department of Electronics and Communication Engineering 21


Maharaja Agrasen Institute of Technology
Database Users and Administrators
• People who work with a database
can be categorized as database
users or database administrators.
• Database Users
– Naive users
– Application programmers
– Sophisticated users
– Specialized users
• Database Administrator (DBA)

Department of Electronics and Communication Engineering 22


Maharaja Agrasen Institute of Technology
Database Users and Administrators
Database Administrator
• A person who has such central control over the system is called a database
administrator (DBA).

Functions:
• Schema definition.
• Storage structure and access-method definition.
• Schema and physical-organization modification.
• Granting of authorization for data access.
• Routine maintenance.
Department of Electronics and Communication Engineering 23
Maharaja Agrasen Institute of Technology
Database Architecture
• Centralized
• Client-server
• Parallel (multi-processor)
• Distributed

Department of Electronics and Communication Engineering 24


Maharaja Agrasen Institute of Technology
Database Architecture (Cont.)
• Most users of a database system are not present at the site of the database
system, but connect to it through a network.
• Client machines, on which remote database users work, and
• Server machines, on which the database system runs.

• Two-Tier Architecture
• Three-Tier Architecture

Department of Electronics and Communication Engineering 25


Maharaja Agrasen Institute of Technology
Database Architecture (Cont.)

Department of Electronics and Communication Engineering 26


Maharaja Agrasen Institute of Technology
System Architecture

27
System Architecture

Department of Electronics and Communication Engineering 28


Maharaja Agrasen Institute of Technology
System Architecture

Department of Electronics and Communication Engineering 29


Maharaja Agrasen Institute of Technology
Recent Database Trends
in Industry

Department of Electronics and Communication Engineering 30


Maharaja Agrasen Institute of Technology
SQL vs No SQL

Department of Electronics and Communication Engineering 31


Maharaja Agrasen Institute of Technology
Most Popular Databases

Department of Electronics and Communication Engineering 32


Maharaja Agrasen Institute of Technology
Single Database Vs. Multi-
Database Use

Department of Electronics and Communication Engineering 33


Maharaja Agrasen Institute of Technology
SQL & NoSQL Multiple
Database Combinations

Department of Electronics and Communication Engineering 34


Maharaja Agrasen Institute of Technology
Most Popular Multiple Database
Type Combinations

Department of Electronics and Communication Engineering 35


Maharaja Agrasen Institute of Technology
Most Important Metric Tracked
For Database Performance

Department of Electronics and Communication Engineering 36


Maharaja Agrasen Institute of Technology
Most Time-Consuming Database
Management Task

Department of Electronics and Communication Engineering 37


Maharaja Agrasen Institute of Technology
Top Cloud Database Providers

Department of Electronics and Communication Engineering 38


Maharaja Agrasen Institute of Technology
Top Cloud Database Providers

• AWS
• Microsoft Azure
• Oracle Database Cloud
• IBM Db2 on Cloud
• Google Cloud Platform
• Mongo DB Atlas
• SAP
• Rackspace
and many more...
Department of Electronics and Communication Engineering 39
Maharaja Agrasen Institute of Technology
AWS Suite of Databases

Department of Electronics and Communication Engineering 40


Maharaja Agrasen Institute of Technology
End of Section I of Unit I

Department of Electronics and Communication Engineering 41


Maharaja Agrasen Institute of Technology

You might also like