3 DBMS

Embed Size (px)

Citation preview

  • 7/28/2019 3 DBMS

    1/33

    DATA BASE

    MANAGEMENT

  • 7/28/2019 3 DBMS

    2/33

    INTRODUCTION

    Key components of computer system are: Input The processor Storage

    Output Data communication

    There are two items that add life to the

    computer system allow it to become amanagement information system. YesData and Information !!

  • 7/28/2019 3 DBMS

    3/33

  • 7/28/2019 3 DBMS

    4/33

    DATA and INFORMATION..40,50,45,70,90,130,120,35.

    Just Data

    Weights (in kgs) of the faculties and staffs of XISS, Ranchi.

    We are now somewhere between just data and information.

    Now, let us process the data

    What is the average weight of the people who will use thelift?

    What is the weight of the heaviest faculty/staff who will usethe lift?

    We can now, process the original data to give meaningfuland valuable data information.

    Management can now able to find out the capacity and

    what kind of lift they require to install.

  • 7/28/2019 3 DBMS

    5/33

    DATA BASE DATABASE CONTAINS DATA, NOT

    INFORMATION.

    With some assertions about the meaning of thedata and some rules for processing the data,

    we are able to produce information from thedatabase.

    Thus, through proper design and use of thedatabase, it can be an essential tool for

    producing information for making managementdecisions.

    When a organization has a centrally, integratedcollection of logically organized data, it has a

    database!!

  • 7/28/2019 3 DBMS

    6/33

    DATABASE MANAGEMENT

    SYSTEM DBMS is a system or set of rules and methods

    that allows for the definition, creation, updating,reading, maintenance, and protection of thedatabase.

    Features important in Database management: Speed, process many transaction in a short time Accuracy, firms require the data they store and use to

    be correct Good at repetitive work

    Hence, the computer has radical impact ondatabase management systems becausecomputer has all these characteristics.

  • 7/28/2019 3 DBMS

    7/33

    OBJECTIVES OF DBMS

    Provide the mass storage of relevantdata

    Make access to the data easy for the

    user

    Provide prompt response to userrequests for data.

    Make the latest modifications to thedatabase available immediately.

  • 7/28/2019 3 DBMS

    8/33

    OBJECTIVES OF DBMS

    Eliminate redundant data.

    Allow multiple users to be active at one

    time.

    Allow for growth in the database system.

    Protect the data from physical harm andunauthorized access.

    These are the goals that a DBMS strive to

    fulfill.

  • 7/28/2019 3 DBMS

    9/33

    STEPS IN DESIGNING A

    DATABASE

    Determine the purpose of thedatabase

    Determine the tables needed

    Determine the fields needed

    Identify the Primary keys

    Determine the relationship betweentables

  • 7/28/2019 3 DBMS

    10/33

    DATABASE DESIGN

    Conceptual Model of database designprovides a framework whichspecifies, in a systematic manner. It

    uses two frameworks:

    Entity-relationship model

    Normalisation

  • 7/28/2019 3 DBMS

    11/33

    Entity-Relationship Model (E-R

    Model)

    Based on a perception of real world thatconsists of a set of basic objects, calledentities, and a set of relationships among

    these objects. E-R Model specifies following elements:

    Entity

    Relationship

    Mapping constraints

    E-R Diagram

    Reduction of E-R diagram to tables

  • 7/28/2019 3 DBMS

    12/33

    Entity: An entity is an object thatexists and is distinguishable fromother objects. It may be physical,

    such as a person or a book, or it maybe a concept, such as holiday or ajob.

    An entity is represented by a set ofattributes. It is the properties possessedby each member of the entity set.

  • 7/28/2019 3 DBMS

    13/33

    Entity

    CUSTOMER

    Name

    Cust_id Address

    attributes

    entity

  • 7/28/2019 3 DBMS

    14/33

    RELATIONSHIP: An association amongseveral entities.

    MAPPING CONSTRAINTS:

    E-R Model defines certain constraints towhich the contents of a database mustconform. It may be of three types:

    Cardinalities: it express the number ofentities to which another entity set canbe associated via a relationship. It canbe of four types: one to one, one tomany, many to one, many to many.

  • 7/28/2019 3 DBMS

    15/33

    Existence dependencies: If theexistence of entity A depends on theexistence of entity B, A is said to beexistence-dependent on B. Ex: Account

    and Transaction have existencedependencies. If account (B) is closed,transaction (A) has to be closed.

    Keys: It specifies how entity andrelationships are distinguished. Ex. PANis the super-key for income taxpurpose. Roll Number is the super-keyfor identifying different students of ainstitution.

  • 7/28/2019 3 DBMS

    16/33

    ENTITY - RELATIONSHIP DIAGRAM:

    After identifying the various entities, theirattributes, relationships and constraints,

    the database designers document theseinto an entity-relationship diagram.

    Rectangle represents entity

    Ellipses-attributes

    Diamonds- Relationship Line- represents link

    CUSTOMER

    Name

    Cust_id Address

    Account

    balance

    Depositor

    AccNumber

  • 7/28/2019 3 DBMS

    17/33

    REDUCTION OF E-R DIAGRAM TO TABLES

    On the basis of E-R diagram, tables are prepared.For each entity set, a table is prepared with the

    corresponding name assigned and attributesshown in column.

    A similar table is prepared for relationship set.

    Cust_id Cust Name Address

    A101 AMIT CLUB RD,RANCHI

    A102 MOHIT HARMU, RANCHI

    A104 PRINCE PURULIA ROAD, RANCHI

    CUSTOMER

    ACCOUNT

    Acc Number Balance

    291300000156 10,000

    291300000278 23,000

    291300000822 16,000

  • 7/28/2019 3 DBMS

    18/33

    Cust_id Account Number

    A101 291300000156

    A102 291300000278

    A104 291300000822

    DEPOSITOR

  • 7/28/2019 3 DBMS

    19/33

    NORMALISATION

    Normalization is a process of simplifying therelationships among data elements in a record.During this process, the complex and redundantattributes are simplified and removed.

    It helps to: Structure the data

    Permit simple retrieval of data in response to query

    Simplify the maintenance of data

    Reduce the need to restructure or re-organise the datawhen new application requirements arise.

  • 7/28/2019 3 DBMS

    20/33

    Normalization Process

    The tests (conditions) for normalisationare:

    1NF : First Normal Form: Nowconsidered to be part of the formaldefinition of a relational model. It statesthat domain of an attribute must includeonly atomic values.

  • 7/28/2019 3 DBMS

    21/33

    Normalization Process 2NF (Second Normalisation Form):

    It is based on the concept of full functionaldependency. A functional dependency X Y is afull functional dependency if removal of anyattribute A from X means that the dependencydoes not hold any more, that is for any attribute

    A belongs to X, (X-{A}) does not functionallydetermine Y.

    An entity is said to be in 2NF if all its columnsdepend on the primary key only.

    3NF (Third Normalization Form): Based on transitive dependency. A table qualifies

    for 2NF and do not have transitive dependencies.

    Each column in a table must be dependent onthe entire primary key, not just part of it.

    First Normal Form Example

  • 7/28/2019 3 DBMS

    22/33

    DNAME DNUMBER DMGRIDN DLOCATIONS

    DNAME DNUMBER DMGRIDN DLOCATIONS

    Sales 5 10051 (Delhi,Mumbai,Banglore)

    Administration 1 20061 Delhi

    Plant 2 30088 Gurgaon

    DNAME DNUMBER DMGRIDN DLOCATIONS

    Sales 5 10051 Delhi,

    Sales 5 10051 Mumbai

    Sales 5 10051 Banglore

    Administration 1 20061 Delhi

    Plant 2 30088 Gurgaon

    First Normal Form Example

  • 7/28/2019 3 DBMS

    23/33

    Example: Project Management

    ProjectNo.

    ProjectName

    EmployeeNo.

    EmployeeName

    RateCategory

    HourlyRate(Rs.)

    1055 CIL Survey 11,12,16 Paul,Rahul,Binay

    A,B,C 300,250,200

    1088 EducationProject 11,17 Paul, Kartik A,B 300,250

    1NF: No keys defined and repeating

    groups. When we remove groups anddefine the primary key (PK), we are leftwith

  • 7/28/2019 3 DBMS

    24/33

    ProjectNo.(PK)

    ProjectName

    EmployeeNo. (PK)

    EmployeeName

    RateCategory

    HourlyRate(Rs.)

    1055 CIL Survey 11 Paul A 300

    1055 CIL Survey 12 Rahul B 250

    1055 CIL Survey 16 Binay C 200

    1088 EducationProject

    11 Paul A 300

    1088 EducationProject

    17 Kartik B 250

    2NF: The project name is only dependent on

    project number. The employee name,category, rate are dependent on employeenumber. So we remove them and placethese fields in a separate table. So we are

    left with

  • 7/28/2019 3 DBMS

    25/33

    EmployeeNo.

    EmployeeName

    RateCategory

    Hourly Rate(Rs.)

    11 Paul A 300

    12 Rahul B 25016 Binay C 200

    11 Paul A 300

    17 Kartik B 250

    ProjectNo.

    EmployeeNo.

    1055 111055 12

    1055 16

    1088 11

    1088 17

    ProjectNo.

    ProjectName

    1055 CIL Survey

    1088 EducationProject

    EmployeeTable

    ProjectTable

    Employee-Project Table

  • 7/28/2019 3 DBMS

    26/33

    3NF: Now, only the employee table has morethan one-key attributes. Employee name is not

    dependent on either rate category or hourlyrate and same applies to rate category. OnlyHourly rate is dependent on rate category, sowe have to remove this

    EmployeeNo.

    EmployeeName

    RateCategory

    11 Paul A

    12 Rahul B

    16 Binay C

    17 Kartik B

    RateCategory

    HourlyRate

    (Rs.)A 300

    B 250

    C 200

    EmployeeTable

    Rate Table

  • 7/28/2019 3 DBMS

    27/33

    Owner

    BName CName

    LienOrRegular

    Registered_vehicle

    CYear

    Owns

    CAR

    Truck TYear

    TModel

    TMake

    TEng_NoCEng_No

    CMake

    CModel

    CAddress

    Name

    Address

    DrvLicNo BAddress

    Person

    Bank

    Company

    Purch_Date

    U

    U

    Reg_No

  • 7/28/2019 3 DBMS

    28/33

  • 7/28/2019 3 DBMS

    29/33

    Recent Trends in Database Because of the development of new trends in

    information technology, new trends in databasesystems have also emerged.

    In recent years, several new application areas fordatabase systems have emerged that are notserved by relational data model.

    Some areas are distributed processing,computer-aided design, multimedia andhypermedia etc.

    Moreover, traditional business applications havegrown more complex over time. For example,todays business applications often have to dealwith image data and hypermedia databases.

  • 7/28/2019 3 DBMS

    30/33

    Recent Trends in Database

    Distributed Database:

    The DDBMS emerged as a merger of twotechnology:

    Database technology

    Network and data communication technology

    Tremendous development due to wire andwireless technologies from satellite and

    cellular communications.

    A DDB is one that is stored in more than onephysical location. Parts of the database arestored physically in one location and other partsare maintained in other locations.

  • 7/28/2019 3 DBMS

    31/33

    Recent Trends in Database

    Object Oriented Database:

    OOPLs: It creates software programs byselecting and arranging objects rather than bywriting program code.

    When you integrate database capabilities withobject programming language capabilities, theresult is an object-oriented databasemanagement system or OODBMS

    OODB is proposed to meet the needs of thesemore complex applications.

    The object typically has two components state

    (value) and behavior (operations)

  • 7/28/2019 3 DBMS

    32/33

    Recent Trends in Database

    Hypermedia Database:

    Also referred as multimedia or hypertext,

    includes various media, such as text, graphics,audio and video alongwith procedure for theiruse.

    In hypermedia databases, the concept ofdistributed information systems is used whichhas led to the emergence of global internet.

  • 7/28/2019 3 DBMS

    33/33

    Management Responsibility

    Management must understand some ofthe terms related to DBMS, concepts &approaches

    Manager to participate intelligently

    User needs a facility for asking DBMSfor information and reports

    Success of database also depends on

    user acceptance