Dbms Class

Embed Size (px)

Citation preview

  • 8/6/2019 Dbms Class

    1/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

  • 8/6/2019 Dbms Class

    2/28

    MetadataMetadata is defined as data about data. It describes theproperties and context of user data.

    Name Type Length Min Max

    Name Alphabets 30

    Rollno Integer 6 6 6

    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

  • 8/6/2019 Dbms Class

    3/28

    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 theusers with the processes of defining,

    constructing and manipulating the database for

    various applications.

  • 8/6/2019 Dbms Class

    4/28

    Characteristics ofDBMS

    Represents complex relationship between data

    Controls data redundancy.

    Enforces user defined rules.

    Ensures data sharing.

    It has automatic and intelligent backup and recoveryprocedures.

    It has central dictionary to store information.

  • 8/6/2019 Dbms Class

    5/28

    ACID Test Atomicity

    Consistency

    Isolation

    Durability

  • 8/6/2019 Dbms Class

    6/28

    D

    atabase Arch

    itecture

  • 8/6/2019 Dbms Class

    7/28

    External View

    User View 1 User view 2

    Customer

    name

    Customer

    city

    Customer

    BalanceCustomer

    name

    Customer city

    Conceptual ViewCUSTOMER

    Customer ID: integer(4)

    Customer Name:String(20)

    Customer Street:String(40)

    Customer City:String(10)

    Customer Balance:integer(8)

    Internal View

    CUSTOMER

    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

  • 8/6/2019 Dbms Class

    8/28

    Advantages of DBMS Control of data redundancy

    Data consistency

    Sharing of data

    Improved data integrity

    Improved maintenance through data

    independence.

  • 8/6/2019 Dbms Class

    9/28

    Disadvantages of DBMS Complexity

    Cost of DBMS

    Cost of conversion

    Performance

    Higher impact of a failure

  • 8/6/2019 Dbms Class

    10/28

    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

  • 8/6/2019 Dbms Class

    11/28

    Database & RDBMS concepts RELATIONAL MODEL

    Tuple

    Attribute

    RelationEMPNO FIRSTNME Age WORKDEPT

    10 Ananya 25 A00

    20 Swetha 32 B01

    30 Prashanth 55 C01

    Relation :: Table

    Tuple :: Row

    Attribute :: Column

    Domain :: Range ofvalues for an attribute

    Primary

    Key

  • 8/6/2019 Dbms Class

    12/28

    Relational Database Model

    department location

    A00 Chennai

    C01 Hyderabad

    B01 Pune

  • 8/6/2019 Dbms Class

    13/28

    Relational TerminologyTuple (Row)

    Attribute (Column)

    Relation (Table)

    Integrity Constraints

    Primary KeyForeign Key

  • 8/6/2019 Dbms Class

    14/28

    Database & RDBMS concepts: Terminology

    PRIMARY KEY: Column used to uniquely identify aTuple

    COMPOSITE KEY: A combination of columns used to

    identify a unique row.C

    ombination of customer nameand address can consider to be the composite key of thecustomer table.

    ALTERNATE KEY: Column or combination of

    columns whichhas unique values but not selected asprimary key and is not part of the primary key.

    FOREIGN KEY: Column of a table used to establishrelationship with other tables and present itself in allthe relation tables.

  • 8/6/2019 Dbms Class

    15/28

    Structured Query Language

  • 8/6/2019 Dbms Class

    16/28

    Structured Query Language DDL Data Definition Language

    DML Data Manipulation language

    DCL Data Control Language

  • 8/6/2019 Dbms Class

    17/28

    DDL Create

    Alter

    Drop

    Truncate

  • 8/6/2019 Dbms Class

    18/28

    DML Insert

    Update

    Delete

    Select

  • 8/6/2019 Dbms Class

    19/28

    DCL Commit

    Rollback

    Save point

    Set transaction

  • 8/6/2019 Dbms Class

    20/28

    Integrity Constraints Primary key (PK)

    Foreign Key (FK)

    Unique key (UK)

    Not Null

    Check

  • 8/6/2019 Dbms Class

    21/28

    Object Oriented Database

    Management System(OODBMS)

  • 8/6/2019 Dbms Class

    22/28

    What is an object?

    Tangible Things as a car, printer, ...

    Roles as employee, boss, ...

    Incidents as flight, overflow, ...

    Interactions as contract, sale, ...

    Specifications as colour, shape,

  • 8/6/2019 Dbms Class

    23/28

    The two parts of an objectObject = Data + Methods

    or to say the same differently:

    An object has the responsibility to know and

    the responsibility to do.

    = +

  • 8/6/2019 Dbms Class

    24/28

    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

    W

    here it is And methods:

    eat, hide, run, dig

  • 8/6/2019 Dbms Class

    25/28

    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 notaccessible by other objects.

  • 8/6/2019 Dbms Class

    26/28

    Basic Terminology:

    Polymorphism Polymorphism means having many

    forms. It allows different objects to

    respond to the same message in differentways, the response specific to the type of

    the object.

    E.g. the message displayDetails() of thePerson class should give different resultswhen send to a Student object (e.g. theenrolment number).

  • 8/6/2019 Dbms Class

    27/28

    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 teacher is a person

    Adog is an animal

  • 8/6/2019 Dbms Class

    28/28

    OODBMS and RDBMS

    OODBMS RDBMS

    Object Entity

    Data Encapsulation and Dataindependence Data Independence

    OODBMS store data and

    methods.

    RDBMS store only data.

    Object Identifier (OID) Primary Key

    Complex Data Simple Data

    Inheritance None