Beruflich Dokumente
Kultur Dokumente
6-Jan-04
Agenda
6-Jan-04
Introduction
6-Jan-04
Data? Information?
6-Jan-04
Data is represented in one or more flat files Flat file is nothing but electronic representation of cardboard file. Every business group has its own set of files
6-Jan-04
No centralized control. Data Redundancy Data Inconsistency Data can not be shared Standards can not be enforced Security issues Integrity can not be maintained Data dependence
Satyam Computer Services Ltd.
6-Jan-04
6-Jan-04
A system whose overall purpose is to record and maintain information A database is a repository for stored data and programs to manipulate it.
6-Jan-04
Advantages of DBMS
Centralized control. No Data Redundancy Data Consistency Data can be shared Standards can be enforced Security can be enforced Integrity can be maintained Data independence
Satyam Computer Services Ltd.
6-Jan-04
Data Models
A data model is a collection of concepts for describing data A Schema is a description of a particular collection of data using the given data model The relational model is the most widely used model today
Satyam Computer Services Ltd.
6-Jan-04
Levels of Abstraction
Many Views and single Conceptual and Physical Schema Views Describe how users see the data Conceptual Schema defines the logical structure Physical Schema defines the physical files and Indexes
6-Jan-04
Conceptual Schema
Students(sid: string, name: string, login: string, age: integer, gpa:real) Courses(cid: string, cname:string, credits:integer) Relations stored as unordered files. Index on first column of Students. Course_info(cid:string,enrollment:integer)
Satyam Computer Services Ltd.
Physical Schema
6-Jan-04
Data Independence
Applications insulated from how data is structured and stored Logical Data Independence: Protection from changes in logical structure of data Physical Data Independence: Protection from changes in physical structure of data
Satyam Computer Services Ltd.
6-Jan-04
Structure of a DBMS
6-Jan-04
ACID Test
6-Jan-04
Types of DBMS
6-Jan-04
Example Data
S# S1 S2 S3 SNAME Smith Jones Blake STATUS 20 10 30 CITY London Paris Paris
P# P1 P2 P3 P4
WEIGHT 12 17 17 14
S# S1 S1 S1 S2 S2 6-Jan-04 S3
P# P1 P2 P3 P1 P2 P2
Hierarchical DBMS
Data is represented by a tree structure
P1 Nut Red 12 London P2 Bolt Green 17 Paris
S2 S1
Jones 20
10 London
Paris 300
300 S1
S3 S2 Smith
Blake Jones 20
30 10 Londo n
200 400
Smith
P3
Screw
Blue
17
Rome
P4
Screw
Red
14
London
S1
Smith
20
London
400
6-Jan-04
Can not handle Many-Many relations Can not reflect all real life situations Anomalies in insert, delete and update operations.
6-Jan-04
Network DBMS
Data is represented by records and pointers Addresses Many-Many relations Insert,delete,update operations possible Complex in design
6-Jan-04
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
Satyam Computer Services Ltd.
6-Jan-04
Relational Terminology
Tuple (Row) Attribute (Column) Relation (Table) Integrity Constraints
Primary Key Alternate Key Foreign Key
6-Jan-04 Satyam Computer Services Ltd.
Normalization
6-Jan-04
Normalization
Normalization - process of removing data redundancy by decomposing relations in a Database. De normalization - carefully introduced redundancy to improve query performance.
Satyam Computer Services Ltd.
6-Jan-04
The decomposition approach starts with one relation and the relation is decomposed into more number of relations to remove insert, delete and update anomalies. 1NF, 2NF, 3NF and BCNF can be achieved by this approach.
Satyam Computer Services Ltd.
6-Jan-04
Un normalized Form
A relation is said to be in Un normalized Form (0NF) if the values of any of its attributes are non-atomic. In other words more than one value is associated with each instance of the attribute.
6-Jan-04
Un normalized Relation
#
S1
PQ
P# 1 2 3 4 1 2 2 QTY 300 200 400 200 300 400 200
S2
S3
6-Jan-04
6-Jan-04
6-Jan-04
Functional Dependency
Given a relation R, attribute Y of R is functionally dependent on attribute X if and only if each X-value in R has associated with it precisely one Y-value in R (at any one time)
6-Jan-04
6-Jan-04
6-Jan-04
6-Jan-04
A subject can be taught to a student by only one teacher. Each teacher teaches only one subject. Each subject is taught by several teachers.
Satyam Computer Services Ltd.
6-Jan-04
Positio 1 2 2 1
6-Jan-04
Codd s Rules
6-Jan-04
Codd s Rules
6-Jan-04
6-Jan-04
DDL Data Definition Language DML Data Manipulation language DCL Data Control Language
6-Jan-04
DDL
6-Jan-04
DML
6-Jan-04
DCL
6-Jan-04
Integrity Constraints
Primary key (PK) Foreign Key (FK) Unique key (UK) Not Null Check
6-Jan-04
Data Types
6-Jan-04
Arithmetic Operator
+ * / Mod ABS
6-Jan-04
Logical Operators
AND OR IN NOT IN < > <= >= <> BET EEN 6-Jan-04
Set Operators
6-Jan-04
Thank You
6-Jan-04