Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

Database Management System (DBMS)

Collection of interrelated data Set of programs to access the data DBMS contains information about a particular enterprise Database Applications:
Banking: all transactions Airlines: reservations, schedules Universities: registration, grades Sales: customers, products, purchases Manufacturing: production, inventory, orders, supply chain Human resources: employee records, salaries

Databases touch all aspects of our lives

What is a database? It is an organized collection of logically related data . Ex. the names, telephone numbers and addresses of all the people you know Metadata Metadata is defined as data about data. It describes the properties and context of user data.

Name Name Rollno

Type Alphabets Integer

Length 30 6

Min 6

Max 6

DBMS It is a collection of programs that enables user to create and maintain a database. In other words it is general-purpose software that provides the users with the processes of defining, constructing and manipulating the database for various applications.

Characteristics of DBMS
Represents complex relationship between data Controls data redundancy. Enforces user defined rules. Ensures data sharing. It has automatic and intelligent backup and recovery procedures. It has central dictionary to store information.

ACID Test
Atomicity Consistency Isolation Durability

Database Architecture

External View
User View 1 Customer city Customer Balance Customer name User view 2 Customer city

Customer name

CUSTOMER

Conceptual View

Customer ID: integer(4) Customer Name:String(20) Customer Street:String(40) Customer City:String(10) Customer Balance:integer(8)

CUSTOMER

Internal View

Customer ID: 4 decimal offset 0 unique Customer Name:String length 20 offset 4 Customer Street: String length 40 offset 4 Customer City: String length 10 offset 64 Customer Balance:8,2 dec offset 74

Advantages of DBMS
Control of data redundancy Data consistency Sharing of data Improved data integrity Improved maintenance through data independence.

Disadvantages of DBMS
Complexity Cost of DBMS Cost of conversion Performance Higher impact of a failure

Relational DBMS
Based on Relational Mathematics principles Data is represented in terms of rows and columns of a table Addresses all types of relations Easy to design No anomalies for insert/delete/update

Database & RDBMS concepts


RELATIONAL MODEL
Primary Key Attribute Relation
EMPNO 10 20 30 FIRSTNME Age Ananya Swetha Prashanth WORKDEPT 25 A00 32 B01 55 C01

Tuple

Relation Tuple Attribute Domain

:: Table :: Row :: Column :: Range of values for an attribute

Relational Database Model


department
A00 B01 C01

location
Chennai Pune Hyderabad

Relational Terminology
Tuple (Row) Attribute (Column) Relation (Table) Integrity Constraints
Primary Key Foreign Key

Database & RDBMS concepts: Terminology


PRIMARY KEY: Column used to uniquely identify a Tuple COMPOSITE KEY: A combination of columns used to identify a unique row. Combination of customer name and address can consider to be the composite key of the customer table. ALTERNATE KEY: Column or combination of columns which has unique values but not selected as primary key and is not part of the primary key. FOREIGN KEY: Column of a table used to establish relationship with other tables and present itself in all the relation tables.

Structured Query Language

Structured Query Language


DDL Data Definition Language DML Data Manipulation language DCL Data Control Language

DDL
Create Alter Drop Truncate

DML
Insert Update Delete Select

DCL
Commit Rollback Save point Set transaction

Integrity Constraints
Primary key (PK) Foreign Key (FK) Unique key (UK) Not Null Check

Object Oriented Database Management System (OODBMS)

What is an object?
Tangible Things Roles Incidents Interactions Specifications as a car, printer, ... as employee, boss, ... as flight, overflow, ... as contract, sale, ... as colour, shape,

The two parts of an object


Object = Data + Methods or to say the same differently: An object has the responsibility to know and the responsibility to do.

Example: A Rabbit object


You could (in a game, for example) create an object representing a rabbit It would have data:
How hungry it is How frightened it is Where it is

And methods:
eat, hide, run, dig

Basic Terminology
Abstraction is the representation of the essential features of an object. These are encapsulated into an abstract data type. Encapsulation is the practice of including in an object everything it needs hidden from other objects. The internal state is usually not accessible by other objects.

Basic Terminology: Polymorphism


Polymorphism means having many forms. It allows different objects to respond to the same message in different ways, the response specific to the type of the object. E.g. the message displayDetails() of the Person class should give different results when send to a Student object (e.g. the enrolment number).

Basic Terminology: Inheritance


Inheritance means that one class inherits the characteristics of another class. This is also called a is a relationship: A car is a vehicle A dog is an animal A teacher is a person

OODBMS and RDBMS OODBMS


Object Data Encapsulation and Data independence OODBMS store data and methods. Object Identifier (OID) Complex Data Inheritance

RDBMS
Entity Data Independence RDBMS store only data. Primary Key Simple Data None

You might also like