You are on page 1of 40

Chapter 1

Introduction to Database Management

McGraw-Hill/Irwin

Copyright 2007 by The McGraw-Hill Companies, Inc. All rights reserved.

Overview of DBMS
 Data: raw facts that can be stored and processed as information  Database: collection of interrelated and organized data(collections of files)  Entity: a person,place or event about which information must kept  Attribute: piece of information describing a particular entity
1-2

Overview of DBMS
 Ex, student table
Name john Father Name albert

field name / attribute


Age 23

records  DBMS: collections of 25 inter-related ramesh raja data(usually called database) and set of program to access,update and manage those data(management system)

1-3

Overview of DBMS
 1.Defining: specifying data types and structures, and constraints for data to be stored  2.Constructing: storing data in storage medium  3.Manipulating: involves querying,updating and generating reports  4.Sharing: allowing multiple users and programs to access data simultaneously
1-4

Overview of DBMS
 Ex of DBMS: Access,oracle,...

1-5

Overview of DBMS
 Primary goals : store and retrieve database information that is both convenient and efficient  Manage large and small bodies of information( defining structure for storage of information and providing mechanism for manipulating of information  Should ensure that safety of information stored  Sharing of data avoid anomalous result 1-6

Overview of DBMS
 Advantages & Disadvantages:  * Data independence: provides abstract view of data  * Efficient Data Access  * Data Integrity and Security:integrity constraints  * Data administration: deals with implementations of types of database are in use

1-7

Overview of DBMS
Advantages & Disadvantages: Advantages & Disadvantages: * Data independence: provides abstract * Concurrent Access & crash recovery: view of data data being used only one user at a time  also protect the system form crashes * Efficient Data Access  * Data Integrity and Security:integrity  Reduced Application Development time: constraints supports all the important functions  * Data administration: deals with implementations of types of database are    
1-8

Overview of DBMS
Advantages & Disadvantages: Advantages & Disadvantages: * Data independence: provides abstract set up the database require more view of data knowledge,money, skills and time  The complexity of database may results in * * Efficient Data Access  * Data Integrity and Security:integrity poor performance constraints Applications of DBMS:  * Data administration: deals with implementations of types of database are    *
1-9

Purpose of Database system


Advantages & Disadvantages: File processing: user defines and * Data independence: provides abstract implements the files needed for a specific software application view of data  * Efficient Data Access processing: Disadvantages of file  * Data Integrity and storing the same data Data redundancy: Security:integrity multiple time (need to perform single constraints logical update multiple times, storage  * Data administration: deals with space is wasted) implementations of types of database are   
1-10

Purpose of Database system


Advantagesaccessing data Difficulty in & Disadvantages: * Data independence: provides abstract Data isolation: data are writing in various view of data different formats, writing new files, and its application programs to  * Efficient Data Access retrieve the appropriate data is difficult.  * Data Integrity and Security:integrity  constraints Integrity problems:must satisfy certain types of consistency constraints  * Data administration: deals with  Atomicity problems: transaction must implementations of types of database are happen in entirety( transact A to B n/w 1-11 fails)    

Purpose of Database system


 Advantages access anomalies:  Concurrent & Disadvantages:  * Data independence: provides data allow multiple user to update the abstract view of data simultaneously  * Efficientproblems: authentication Security Data Access  * Data Integrity and Security:integrity constraints  * Data administration: deals with implementations of types of database are
1-12

Data Model
Advantages is a collection of A data model& Disadvantages: concepts * Data independence: provides abstract for describing data, data relationships, data semantics and consistency view of data constraints.  * Efficient Data Access * * schema is a and Security:integrity  A Data Integritydescription of a particular collection of data, using a given data constraints mode.  * Data administration: deals with * Primary categories for various data models implementations of types of database are are:  * 
1-13

Data Model
 Object-based logical models * Advantages & Disadvantages:  *Provide very high level design of the Data independence: provides abstract view of data database  Provide flexible structuring capabilities. The * Efficient Data Access most popular ones Security:integrity  * Data Integrity andare as follows: The Entity-Relationship model constraints The administration: model  * Data object oriented deals with The semantic model implementations of types of database are The functional model 1-14

Data Model
 Advantages & Disadvantages: * Record-based logical models  Provideindependence: provides abstract * Data more implementation based view of data design Specify overall logical structure of the database and provide high level  * Efficient Data Access description of the implementation  * Data Integrity and Security:integrity The most constraints popular ones are as follows: Relational Model  * Data administration: deals with Network Model implementations of types of database are Hierarchical Model 1-15

Data Model
 Physical models * Advantages & Disadvantages:  * Data independence: provides abstract Describe data at the lowest level view of data aspects of database-system Captures  * Efficient Data Access implementation  * Data Integrity and Security:integrity and Widely known are unifying model frame-memory model constraints * * Data administration: deals with  Entity Relationship model (E-R Model): Identifies basic types of database are implementations ofelements,or objects, or entities which are core to the data base
1-16

Data Model
Consider for example the Library  Advantages & Disadvantages:  database * Data independence: provides abstract view of data two entities Access  * Efficient Data Books and Users can be formed as follows  * Data IntegrityBook Security:integrity and s Books constraints  * Data administration: deals with User implementations of types of database are
1-17

Data Model
We identify what are various attributes that describes the entities of an entity set. A book is described in library by its Accession Number, Call Number, Title, Author, Publisher, Year of publication etc. They are attached to entities as Ellipses as shown below
1-18

Data Model

Acc.N o Card. No

Books Autho r

Yr.of. Publ Publis her

Title

1-19

Data Model

Card. No Name

Librar y UserId

Userty pe

1-20

Data Model
Date of Issue e when a book has been borrowed by a particular user it is Car Acc. d.N No o Book Borrow User User .Id Call. User Date No Type Aut of Is hor Publ Na Title Yr. is me Of.P
1-21

Data Model
 AdvantagesModel: Both the data and * Relational & Disadvantages:  * Data independence: provides tables relationships are represented by abstract view of data BookTable: Acc.no,Call.no,Title,Author,publisher,  * Efficient Data Access year.of.pub.  * Data Integrity and Security:integrity UserTable: constraints Card.no,Name,usertype,userid  * Data administration: deals with BorrowTable: implementations of types of database are Acc.no,card.no,dateofissue
1-22

Data Model
* Network model:  Advantages & Disadvantages: Data in Network Model are abstract  * Data independence: providesrepresented by collection of records view of data Relationships between data are  * Efficient Data Access represented by links or pointers  * Data Integrity and Security:integrity Book User constraints 312 245 DBMS .... 422 ravi student * * Data administration: deals with * * * * 433 246 FOC .... implementations of types of database are
*
So the combination of data records and links can be used in any way to form 1-23 the networkof data

Data Model
* Hierarchical & Disadvantages:  AdvantagesModel  * Data independence: provides abstract view of data  * Efficient Data Access  * Data Integrity and Security:integrity Book 1 Book 2 constraints 312 245 DBMS .... 422 ravi student * Data administration: deals with * 422 ravi student 422 ravi student implementations of types of database are
.... * .... *
1-24

ER Model
*

An Entity is a basic element of a system identified by a set of attributes


1-25

* A relationship type R

ER Model
*

entity set uniquely are called key attributes. For example attribute Roll no. for an entity type Student is a key attribute

1-26

ER Model

* The attributes which need not be stored with the entities derived attributes for ex, birth date storing the date of person age need not be

1-27

Degree of Relationship set


* The number of entity sets participating in a relationship is the degree of relationship * Example of unary relation ship only one entity set participate in the relationship.
Emp Mgr Mgr

subroutine

1-28

Degree of Relationship set


* Example of Binary relationship. Two entity sets participate in a relationship
Book Borrow User

1-29

Degree of Relationship set


* Example of ternary relationship. Three entity types participate in a relationship
Accou nt Owns Branch

Custom er

1-30

Degree of Relationship set


* N-ary relationship associates n entity sets. * Mapping Constraints: Two most important type of mapping constraints are Mapping cardinalities and Existence Dependencies

1-31

Degree of Relationship set


*For a binary relationship set R between entity sets A and B, The mapping cardinalities must be one of the following: o One to One: An entity in A is associated to at most one entity in B and vice-versa. o One to Many: An entity in A is associated with any number of entities in B but an entity in B is associated to at most one entity in A.
1-32

Degree of Relationship set


o Many to One: An entity in A is associated to only one entity in B while an entity in B is associated to any number of entities in A. o Many to Many: An entity in A is related to any number of entities in B and vice-versa.

1-33

Degree of Relationship set


One to one
* * * * * * * *

One to many
* * * * * * * *

1-34

Degree of Relationship set


Many to one
* * * * * * * *

Many to many
* * * * * * * *

1-35

Degree of Relationship set


If the existence of entity x depends on the existence of entity y, then x is said to be existence dependent on y. If y is deleted so is x. y is dominant entity and x is subordinate entity. Example a payment entity is dependent on the loan entity. Payment are identifies by payment number, payment date, and payment amount 1-36

Degree of Relationship set


Many to one
* * * * * * * *

Many to many
* * * * * * * *

1-37

Degree of Relationship set


* Example of ternary relationship. Three entity types participate in a relationship
Accou nt Owns Branch

Custom er

1-38

Degree of Relationship set


* Example of ternary relationship. Three entity types participate in a relationship
Accou nt Owns Branch

Custom er

1-39

Degree of Relationship set


* The number of entity sets participating in a relationship is the degree of relationship * Example of unary relation ship only one entity set participate in the relationship.
Emp Mgr Mgr

subroutine

1-40

You might also like