Вы находитесь на странице: 1из 32

MCA Course, B.R.A.

BIHAR UNIVERSITY, MUZAFFARPUR, BIHAR


4/28/2012 Rajesh.... 1

Database Basics by Rajesh.. Faculty,

Database and Information Systems


An information system is a well-coordinated collection of resources that gather and transform data into information products and services that help the enterprise perform its designed functions. retrieves, updates and deletes these facts derives other facts from existing ones Data - raw facts/details of the model DATABASE- A shared collection of logically related data (and a description of this data), designed to meet the organisation needs of an organisation The Database Management System (DBMS) - software that enables users to define, create and maintain the database and provides controlled access to the database
4/28/2012 Rajesh.... 2

Introducing the Database


Data versus Information Data constitute building blocks of information Information produced by processing data Information reveals meaning of data Good, timely, relevant information key to decision making Good decision making key to organizational survival
4/28/2012 Rajesh.... 3

Database
A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose.

4/28/2012

Rajesh....

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. What is a Database system? The database and DBMS software together is called as Database system.

4/28/2012

Rajesh....

Functions of a DBMS

Data storage, retrieval, update A user-accessible catalog Transaction support Concurrency control Recovery services Authorisation services Support for data communication Integrity services
4/28/2012

Data independence

Rajesh....

Interaction of DBMS with Operating System


DBMS
request for stored record returned stored record

FILE MANAGER
request for stored page returned stored page

DISK MANAGER
disk I/O operation retrieved data

Physical record occurrences


4/28/2012

Database
Rajesh.... 7

Data Models, Schemas and Instances Data Model


Specifies the allowable logical structures and operations in a database. A DBMS operates always according to a specific data model eg relational
Database Schema (intension)

The description of a database for a particular universe of discourse which follows the rules layered down by the data model supported by the target DBMS
Database Instance (extension)

The data in the database at a particular moment in time


4/28/2012 Rajesh.... 8

Advantages of DBMS
Sharing of data Enforcement of security Enforcement of development and maintenance standards Reduction of redundancy Avoidance of inconsistency across files Maintenance of integrity Data independence

4/28/2012

Rajesh....

Disadvantages of DBMS
size complexity cost Additional hardware costs Higher impact of failure Recovery more difficult
4/28/2012 Rajesh.... 10

Maintaining a Database System - the Task of the DBA


Maintaining information structure of the database (metadata in the Data Dictionary) Define user requirements of data usage Monitor use of database Determine and optimise storage structure and access strategies Define authorisation checks Define strategies for backup and recovery Define testing procedures and changeover policy
4/28/2012 Rajesh.... 11

Classification of DBMS
1. Classical DBMS
Hierarchical Network Relational

2.

New Directions Extended Relational Object-Oriented

Distributed

4/28/2012

Rajesh....

12

Database Models
Collection of logical constructs used to represent data structure and relationships within the database
Conceptual models: logical nature of data representation Implementation models: emphasis on how the data are represented in the database
4/28/2012 Rajesh.... 13

Database Models (cont.)


Relationships in Conceptual Models
One-to-one (1:1) One-to-many (1:M) Many-to-many (M:N)

Implementation Database Models


Hierarchical Network Relational
4/28/2012 Rajesh.... 14

Hierarchical Database Model


Logically represented by an upside down tree Each parent can have many children Each child has only one parent

Figure 1.8

4/28/2012

Rajesh....

15

Advantages Conceptual simplicity Database security and integrity Data independence Efficiency Disadvantages Complex implementation Difficult to manage and lack of standards Lacks structural independence Applications programming and use complexity Implementation limitations
4/28/2012 Rajesh....

Hierarchical Database Model

16

Network Database Model


Each record can have multiple parents Composed of sets Each set has owner record and member record Member may have several owners

4/28/2012

Rajesh....

Figure 1.10

17

Network Database Model


Advantages Conceptual simplicity Handles more relationship types Data access flexibility Promotes database integrity Data independence Conformance to standards Disadvantages System complexity Lack of structural independence

4/28/2012

Rajesh....

18

Relational Database Model


Perceived by user as a collection of tables for data storage Tables are a series of row/column intersections Tables related by sharing common entity characteristic(s)

4/28/2012

Rajesh....

19

Relational Database Model (cont.)

Figure 1.11

4/28/2012

Rajesh....

20

Advantages

Relational Database Model


Structural independence Improved conceptual simplicity Easier database design, implementation, management, and use Ad hoc query capability with SQL Powerful database management system

4/28/2012

Rajesh....

21

Relational Database Model


Disadvantages
Substantial hardware and system software overhead Poor design and implementation is made easy May promote islands of information problems

4/28/2012

Rajesh....

22

Objects or abstractions of real-world entities are stored Attributes describe properties Collection of similar objects is a class Methods represent real world actions of classes Classes are organized in a class hierarchy Inheritance is ability of object to inherit attributes and methods of classes above it

Object-Oriented Database Model

4/28/2012

Rajesh....

23

THE HIERARCHICAL MODEL


It defines data as and relationships through hierarchy of data values. This database model is the oldest database model. A DBMS belonging to the hierarchical data model uses tree structures to represent relationship among records. Tree structures occur naturally in many data organizations because some entities have an intrinsic hierarchical order. For example, an institute has a number of programmes to offer. Each program has a number of courses. Each course has a number of students registered in it. The following figure depicts, the four entity types Institute, Program, Course and Student make up the four different levels of hierarchical structure. The figure 1 shows an example of database occurrence for an institute. A database is a collection of database occurrence.
4/28/2012 Rajesh.... 24

Institute Programme

Courses
Student
Figure 1: A simple Hierarchy

A hierarchical database therefore consists of a collection of records that are connected with each other through links. Each record is a collection of fields (attributes), each of which contains one data value. A link is an association between precisely two records.
4/28/2012 Rajesh.... 25

The hierarchical data model has the following features:


Each hierarchical tree can have only one root record type and this record type does not have a parent record type. The root can have any number of child record types and each of which can itself be a root of a hierarchical sub tree. Each child record type can have only one parent record type Data in a parent record applies to all its children records A child record occurrence must have a parent record occurrence; deleting a parent record occurrence requires deleting its entire children record occurrence.
4/28/2012 Rajesh....

26

THE NETWORK MODELThe network data model was formalised in the late 1960s by the Database Task Group of the Conference on Data System Language (DBTG/ CODASYL). Their first report, which has been, revised a number of times, contained detailed specifications for the network data model (a model conforming to these specifications is also known as the DBTG data model). The specifications contained in the report and its subsequent revisions have been subjected to much debate and criticism. Many of the current database applications have been built on commercial DBMS systems using the DBTG model.

4/28/2012

Rajesh....

27

The Relational Model

The relational model is conceptually simple and more importantly based on mathematical theory of relation. It also frees the users from details of storage structure and access methods. The relational model like all other models consists of three basic components A set of domains and a set of relations Operation on relations Integrity rules CONCEPTS OF A RELATIONAL MODEL The relational model was propounded by E.F. Codd of the IBM in 1972. The basic concept in the relational model is that of a relation. A relation can be viewed as a table, which has the following properties:
4/28/2012 Rajesh.... 28

Property 1: it is column homogeneous. In other words, in any given column of a table, all items are of the same kind. Property 2: each item is a simple number or a character string. That is, a table must be in 1NF. (First Normal Form) which will be introduced in the second unit. Property 3: all rows of a table are distinct. Property 4: the ordering of rows within a table is immaterial. Property 5: the columns of a table are assigned distinct names and the ordering of these columns is immaterial.Example of a valid relation S# P# SCITY 10 1 BANGALORE 10 2 BANGALORE 11 1 BANGALORE 11 2 BANGALORE

4/28/2012

Rajesh....

29

THE RELATIONAL COMPLETENESS The notion of relational completeness was propounded by Codd in 1972 as a basis for evaluating the power of different query languages. A language is relationally complete if the basic relational algebra operations can be performed. The basic relational algebra operations are Union Difference Gross product Selection

4/28/2012

Rajesh....

30

Object-based models It is a collection of real world objects called entities and their relationships.It defines the database as a collection of objects and contains both data members/values and operation that are allowed on the data.The interrelationships and constraints are implemented through objects.
4/28/2012 Rajesh.... 31

4/28/2012

Rajesh....

32

Вам также может понравиться