SlideShare a Scribd company logo
1 of 79
Database Management Systems
INTRODUCTION TO DBMS
Objectives….
Introduction to Database
Database Users
Characteristics of the Database Approach
Different people behind DBMS
Implications of Database Approach
Advantages of using DBMS,
When not to use a DBMS.
2
Objectives…
Database System Concepts
Data Base Architecture
Data Models,
Schemas, and Instances.
DBMS Architecture and Data Independence
Database languages and interfaces.
The database system Environment
Classification of DBMS.
3
Introduction
Data – Collection of facts and figures.
e.g., - texts, numbers, alphanumeric, audio, video, image.
Information- Meaningful data is called Information. (Processed data)
Database – Collection of related information.
◦ Types of database –
Traditional database
Multimedia database
Geographic Information System (GIS) Database
Real-time database
Data Warehouse (huge volume of historical data)
DBMS – Collection of interrelated data and a set of programs to access the data. It helps us to store and retrieve database
information in a convenient and efficient manner.
4
Database (DB) + Management System (MS) = Database Management System (DBMS)
Introduction (contd..)
DBMS Software – MS Access, Oracle, SQL Server, MySQL DB2, SYBASE, etc.
MS Excel – Does possess data management capabilities, but not a pure DBMS.
Languages used by DBMS Software – SQL, PL/SQL
Applications – Banking, Airline, Retail, Manufacturing, Telecommunication, Universities,
etc.
Users of Database –
 Naive Users – Who knows nothing about the database but interacts with the system by
invoking one of the application programs that have been written earlier.
 Sophisticated Users – performs the same task of data entry not by using any application
program, but by means of query language like SQL.
5
Introduction (contd..)
Types of Users
 Database Administrator (DBA)
 Database Designer
 Application Programmer
 End User.
6
Database Administrator (DBA):
• Database Administrator (DBA) is the person which makes the
strategic and policy decisions regarding the data of the enterprise,
and who provide the necessary technical support for implementing
these decisions.
• DBA is responsible for overall control of the system at a technical
level.
• In database environment, the primary resource is the database itself
and the secondary resource is the DBMS and related software
administering these resources is the responsibility of the Database
Administrator (DBA).
7
Database Designer
 Database designer determines the requirement
of end users, and develops specifications for
transactions that meet these requirements.
 Database designer plays a major role in
database design, its properties;
 the structure prepares the system requirement
statement, which involves the feasibility aspect,
economic aspect, technical aspect etc. of the
system
8
Application programmers
• These users write application programs to
interact with the database.
• Application programs can be written in some
programming language such a COBOL, PL/I,
C++, JAVA or some higher level fourth
generation language.
• Such programs access the database by issuing
the appropriate request, typically a SQL
statement to DBMS.
9
End Users
• End users are the users, who use the applications developed.
• End users need not know about the working, database design,
the access mechanism etc. They just use the system to get
their task done. End users are of two types:
Direct users
Indirect users
10
Types of End Users
Direct users:
Direct users are the users who use the computer, database system directly, by
following instructions provided in the user interface.
They interact using the application programs already developed, for getting the
desired result.
E.g. People at railway reservation counters, who directly interact with database.
a) Indirect users:
• Indirect users are those users, who desire benefit form the work of DBMS indirectly.
• They use the outputs generated by the programs, for decision making or any other
purpose.
• They are just concerned with the output and are not bothered about the programming
part.
11
Data redundancy and inconsistency
Difficulty in accessing data
Data isolation – multiple files and formats
Integrity problems (enforcing consistency constraints)
Atomicity of updates
Concurrent access by multiple users
Security problems
12
Implications of Using the Database
Approach
 Standards can be Enforced with Database
Approach. ...
 Quicker Application Development. ...
 Flexibility of Altering Data Structures. ...
 Readily Available Information Across
Network. ...
 Economical Scalability.
13
Advantages of Data base approach
Data Independence:
The data is held in such a way that changes to the structure of the
database do not effect any of the programs used to access the data.
Consistency of Data:
Each item of data is held only once therefore no danger of item being
updated on one system and not on another.
Control over Redundancy:
In a non-database system, the same information may be held on several
files. This wastes space and makes updating more time-consuming. A
database system minimizes these effects.
14
Advantages of Data base approach
Integrity of Data:
The DBMS provides users with the ability to specify constraints on data
such as making a field entry essential or using a validation routine.
Greater Security of Data:
The DBMS can ensure only authorized users are allowed access to the
data.
Centralized Control of Data:
The Database Administrator will control who has access to what and will
structure the database with the needs of the database.
15
More Information Available to Users:
Users have access to a wider range of data that was
previously held in separate departments and sometimes on
incompatible systems.
Increased Productivity:
The DBMS provides an easy to use query language that
allows users to get immediate response from their queries
rather than having to use a specialist "programmer" to write
queries for them. whole
16
Dis-advantages:
1. Increased cost
2. Complexity
17
Application
Programs
 Database
18
Server
 Database
Application
Programs
User User
Two-tier Architecture Three-tier Architecture
Views
Part of the database that is visible to a particular user, for e.g., in a banking system,
the person who checks the account debits and credits of a customer is not granted
access to the payroll system. The account, depositor and borrower tables are his
view.
Differ from person to person.
The authorization of access is granted by the DBA.
19
Levels of Abstraction
 User View level describes how users see the
data.
 Conceptual or Logical level defines logical
structure
 Physical level describes the files and indexes
used.
20
Physical Schema
Conceptual Schema
View 1 View 2 View 3
DB
Users
also known as the
ANSI/SPARC model
Example: University Database
Conceptual schema:
◦ Students (sid: string, name: string, age: integer, gpa:real)
◦ Courses (cid: string, cname:string, credits:integer)
◦ Enrolled (sid:string, cid:string, grade:string)
External Schema (View Level):
◦ Course info (cid:string, enrollment:integer)
Physical schema:
◦ Relations stored as unordered files.
◦ Index on first column of Students.
21
Physical Schema
Conceptual Schema
View 1 View 2 View 3
DB
Data Independence
Ability to modify a schema definition in one
level without affecting a schema definition in
the other levels.
Logical data independence: Protection from
changes in logical structure of data.
Physical data independence: Protection from
changes in physical structure of data.
22
Physical Schema
Conceptual Schema
View 1 View 2 View 3
DB
Metadata & Data dictionary
Metadata – Data about data
It is the overall description of the database specified by a set of definitions and
constraints, for e.g. –
Means of creation of the data
Purpose of the data
Time and date of creation
Creator or author of the data
Location on a computer network where the data was created
Standards used
File size
Data dictionary – Metadata repository
It stores information about each data element in the database such as its name, data type,
range of value, source, access authorization and indicates which application programs
use this data item.
23
Database Models
24
Database Models
 Record based
 data model
25
Object based
data model
 Physical
 data model
Entity-Relationship (E-R)
Network
Relational
Hiearchical
Semantic
Functional
Object based
Unifying
Frame-memory
Hierarchical Data Model
26
Network Data Model
27
Relational Data Model
28
Comparison
29
Entity-Relationship (E-R)
Model
30
customer account
depositor
social-security customer-street
customer-name
account-number
balance
customer-city
E-R Model (Contd..)
31
student course
enroll
name dob
roll
cid
cname
age
Attributes
Entity Set
Relationship
RDBMS
32
RDBMS
A relational database management system (RDBMS) is a database
management system (DBMS) that is based on the relational model as invented
by E. F. Codd
He proposed thirteen golden rules to define what is required from a database
management system in order for it to be considered relational, i.e., RDBMS
See Codd’s 13 Golden Rules
Basic Idea –
to present the data to the user as relations (i.e. as a collection of tables with
each table consisting of a set of rows and columns)
to provide relational operators to manipulate the data in tabular form.
33
Relational Schema
34
Student
Roll Name DOB Age
1 Aamir Khan 14-03-1965 50
2 Shahrukh Khan 02-11-1965 50
3 Salman Khan 28-12-1965 50
Fields / Attributes
Tuple /
Record /
Entity
Entity Set
Values
Student
Schema
Degree
C
a
r
d
i
n
a
l
i
t
y
Few Terminologies
Schema – the logical structure of the database (e.g., set of customers and accounts
and the relationship between them).
Instance – the actual content of the database at a particular point in time.
Degree – the number of columns associated with a relation or table.
Cardinality – the number of rows in a table.
Domain – the range of possible values for an attribute.
e.g. – the domain for the attribute gender may be {‘M’, ‘F’}
the domain for the attribute title may be { ‘Mr.’, “Ms.’, ‘Mrs.’, ‘Dr.’}
35
Few Terminologies (Contd..)
Extension - The extension of a given relation is the set of tuples appearing in
that relation at any given instance. The extension thus varies with time. It
changes as tuples are created, destroyed, and updated.
36
EmpNo EmpName Dept
1001 Ramesh Marketing
1002 Suresh Finance
EmpNo EmpName Dept
1001 Ramesh Marketing
1002 Suresh Finance
1003 Amar Sales
1004 Akbar HR
1005 Antony Finance
at time t1
at time t2
Intension - The intension of a given relation is independent of time. It is the permanent
part of the relation. It corresponds to what is specified in the relational schema.
It is a combination of two things : a structure and a set of integrity constraints.
Example -
Employee (EmpNo Number(4) Not NULL, EmpName Char(20), Dept
Char(10) )
This is the intension of Employee relation.
Control Redundancy – Read only data is repeated sometimes to increase availability.
37
Simple attribute – attribute that consist of a single atomic value.
e.g. – Roll, Marks, Salary, etc.
Composite Attribute – attributes which can be decomposed further
e.g. – Name (First Name, Middle Name, Last Name)
Address (House No., Street, City, State)
Single-valued atribute – attribute that hold a single value
e.g. – City, EmpId, Salary, etc.
Multi-valued attribute – attribute that hold multiple values
e.g. – Phone no., EmailID
Derived attribute – an attribute that can be calculated or derived from another attribute
e.g. – Age (derived from DOB)
Null attribute – an attribute whose value is missing for a record.
e.g. - if a record does not contain an assignment for the Price attribute
38
Concept Of Keys
39
Super Key – An attribute or a group of attribute that can uniquely identify a tuple from a relational
schema.
Candidate Key – Minimal Super key.
Prime attribute – Member of some candidate key
Primary Key – One of the Candidate keys (usually the most powerful one, depends on the choice of the
user) that can uniquely fetch a tuple from a relational schema.
A primary key cannot accept NULL values.
A composite primary key is a primary key comprising of more than one attributes.
Alternate / Secondary Key – Rest all candidate keys.
Unique Key – same as primary key, but can accept NULL values.
40
Foreign Key – An attribute of an entity set E, which is dependant on the primary key of
another entity set E1.
The former table is called the referencing table and the latter is called the referenced
or derived table.
In such a case, E has to be constructed first and then E1. While deletion, E1 has to be
deleted first and then E.
e.g. – Consider the below relations:
student = (roll, name, marks)
course = (cid, cname)
enroll = (roll, cid)
roll, cid in the enroll relation are foreign keys and together form the composite
primary key for the relation.
Koushik De- - CSE, UEMK 41
Strong entity set – An entity set that has a fixed entity set.
Weak entity set – An entity set that does not have sufficient attributes to form a
primary key.
e.g. –
loan = (loan_id, loan_name, borrower, amount)
payment = (payment_id, payment_date, amount)
The payment relation does not have a primary key (payment_id cannot uniquely
identify tuples) and hence is a weak entity set.
Discriminator/Partial Key – An attribute of a weak entity set which normally
does not show uniqueness, but shows uniqueness when combined with a strong
Entity set.
e.g. – payment_id when combined with loan_id, can uniquely identify tuples.
Koushik De- - CSE, UEMK 42
Entity Integrity – If an attribute is a prime attribute, it cannot accept NULL values. In
other words, no component of a primary key can be NULL.
Extension to the above rule - No non-key attribute can be referenced.
Referential Integrity – Ensures that a value that appears in one relation for a given set
of attributes also appears for a certain set of attributes in another relation.
In other words, it states that any foreign key value must match a primary key value (or
the foreign key value can be NULL).
e.g. –
 Restrict – do not allow deletion of ‘parent’ side if related rows exist in
‘dependant’ side.
 Cascade – automatically delete ‘dependant’ side rows that correspond to the
‘parent’ side row to be deleted.
Koushik De- - CSE, UEMK 43
Entity-Relationship Diagram
Koushik De- - CSE, UEMK 44
E-R Model
Proposed by Peter Chen in 1976
ER diagram is widely used in database design
◦ Represent conceptual level of a database system
◦ Describe things and their relationships in high level
Entity set – an abstraction of similar things, e.g. cars, students
◦ An entity set contains many entities
Attributes – common properties of the entities in a entity sets
Relationship – specify the relations among entities from two or more entity sets
Koushik De- - CSE, UEMK 45
E-R Diagram Notations
Koushik De- - CSE, UEMK 46
E-R Diagram Notations (contd..)
Koushik De- - CSE, UEMK 47
An Example
Koushik De- - CSE, UEMK 48
Attributes
Both entity sets and relationships can have attributes
Attributes may be
◦ Composite
◦ Multi-valued (double ellipse)
◦ Derived (dashed ellipse)
Koushik De- - CSE, UEMK 49
An Example
Koushik De- - CSE, UEMK 50
Relationship
The degree of a relationship = the number of entity sets that participate in the
relationship
◦ Mostly binary relationships
◦ Sometimes more
Mapping cardinality of a relationship
◦ 1 –1
◦ 1 – many
◦ many – 1
◦ Many-many
Koushik De- - CSE, UEMK 51
Relationship Example
Koushik De- - CSE, UEMK 52
Attribute of A Relationship Set
Koushik De- - CSE, UEMK 53
One-One and One-Many
Koushik De- - CSE, UEMK 54
Many-one and many-many
Koushik De- - CSE, UEMK 55
Peter Chen & Bachman Notations
Koushik De- - CSE, UEMK 56
Total Participation
Koushik De- - CSE, UEMK 57
When we require all entities to participate in the relationship (total
participation), we use double lines to specify
Every loan has to have at
least one customer
Alternative Cardinality Specification
Koushik De- - CSE, UEMK 58
• l..h - Minimum cardinality..maximum cardinality
• A minimum value of 1 indicates total participation of the entity set in the relationship
• A maximum value of 1 indicates that the entity participates in at most one
relationship, while a maximum value of * indicates no limit.
• A label 1..* indicates total participation.
Self Relationship
Sometimes entities in a entity set may relate to other entities in the same set.
Thus self relationship
Here employees mange some other employees
The labels “manager” and “worker” are called roles the self relationship
Koushik De- - CSE, UEMK 59
Weak Entity Set
Some entity sets in real world naturally depend on some other entity set.
They can be uniquely identified only if combined with another entity set
Koushik De- - CSE, UEMK 60
 Double rectangles
for weak entity set
 Double diamond
for weak entity
relationship
 Dashed underscore
for discriminator
Extended E-R Features
Koushik De- - CSE, UEMK 61
Generalization & Specialization
Shows inheritance of attributes.
A lower-level entity set inherits all the attributes and relationship participation of
the higher-level entity set to which it is linked.
A lower-level entity set may have additional attributes and participate in
additional relationships.
Also knows as Superclass-Subclass relationship.
Koushik De- - CSE, UEMK 62
Specialization
Generalization
Koushik De- - CSE, UEMK 63
Constraints
Domain Constraint –
Declaring an attribute to be of a particular domain acts as a constraint on the
values that it can take.
Participation Constraint –
The participation of an entity set in a relationship can be total or partial, thus
acting as a constraint on the values.
Cardinality Constraint –
The type of mapping – one-one, one-many, many-one and many-many acts as a
constraint on the values.
Koushik De- - CSE, UEMK 64
Constraints (contd..)
Constraints on Generalization –
Disjoint – A disjointness constraint requires that en enity belong to no more than one lower-level
entity set within a single generalization.
e.g. – An account entity can be either a savings account or a checking account, but not both.
Overlapping – In overlapping generalization, the same entity may belong to more than one lower-
level entity set within a single generalization.
e.g. – An employee may appear in more than one of the team entity sets that are lower-level entity
sets of employee. The same person can be both an officer and a secretary.
Koushik De- - CSE, UEMK 65
Cannot represent relationship among relationships.
Koushik De- - CSE, UEMK 66
 Some employee, branch, job combination may not have a manager.
 Since every employee, branch, job combination in manages is also in
works_on, there is redundant information.
Koushik De- - CSE, UEMK 67
Treats relationships as higher level entities.
More E-R Diagram Examples
Koushik De- - CSE, UEMK
Koushik De- - CSE, UEMK
Koushik De- - CSE, UEMK
Koushik De- - CSE, UEMK
Database Languages
Koushik De- - CSE, UEMK 72
Database Languages
Procedural Non-procedural
Determines WHAT & HOW a
process should be done.
e.g. – Relational Algebra
Is concerned with the WHAT not
the HOW
e.g. – Relational Calculus, SQL
Koushik De- - CSE, UEMK 73
Types of SQL Statements
 Data Definition Language (DDL) – specifies the database schema (CREATE, ALTER,
DROP)
 Data Manipulation Language (DML) – enables the user to access or manipulate data such
as insertion, deletion and modification or records (INSERT, DELETE, UPDATE)
 Data Query Language (DQL) – enables the user to query* on one or more tables to get the
required information they want (SELECT)
 Data Control Language (DCL) – using this, the access of users is controlled by the DBA
(GRANT, REVOKE)
 Transaction Control Language (TCL) – enables the user for transaction processing
(COMMIT, ROLLBACK, ROLLBACK TO)
Koushik De- - CSE, UEMK 74
* A query is a statement requesting the retrieval of information (e.g., select * from student where age > =18;)
Appendix
Koushik De- - CSE, UEMK 75
Codd’s 13 Golden Rules
Rule 0: The Foundation rule:
For any system that is advertised as, or claimed to be, a relational data base management system, that
system must be able to manage data bases entirely through its relational capabilities.
Rule 1: The information rule:
All information in a relational data base is represented explicitly at the logical level and in exactly one
way — by values in tables.
Rule 2: The guaranteed access rule:
Each and every datum (atomic value) in a relational data base is guaranteed to be logically accessible
by resorting to a combination of table name, primary key value and column name.
Rule 3: Systematic treatment of null values:
Null values (distinct from the empty character string or a string of blank characters and distinct from
zero or any other number) are supported in fully relational DBMS for representing missing
information and inapplicable information in a systematic way, independent of data type.
Rule 4: Dynamic online catalog based on the relational model:
The data base description is represented at the logical level in the same way as ordinary data, so that
authorized users can apply the same relational language to its interrogation as they apply to the regular
data.
Koushik De- - CSE, UEMK 76
Codd’s 13 Golden Rules (Contd..)
Rule 5: The comprehensive data sublanguage rule:
A relational system may support several languages and various modes of terminal use (for
example, the fill-in-the-blanks mode). However, there must be at least one language whose
statements are expressible, per some well-defined syntax, as character strings and that is
comprehensive in supporting all of the following items: Data definition.
View definition.
Data manipulation (interactive and by program).
Integrity constraints.
Authorization.
Transaction boundaries (begin, commit and rollback).
Rule 6: The view updating rule:
All views that are theoretically updatable are also updatable by the system.
Rule 7: High-level insert, update, and delete:
The capability of handling a base relation or a derived relation as a single operand applies not
only to the retrieval of data but also to the insertion, update and deletion of data.
Rule 8: Physical data independence:
Application programs and terminal activities remain logically unimpaired whenever any
changes are made in either storage representations or access methods.
Koushik De- - CSE, UEMK 77
Rule 9: Logical data independence:
Application programs and terminal activities remain logically unimpaired when information-
preserving changes of any kind that theoretically permit unimpairment are made to the base
tables.
Rule 10: Integrity independence:
Integrity constraints specific to a particular relational data base must be definable in the
relational data sublanguage and storable in the catalog, not in the application programs.
Rule 11: Distribution independence:
A relational DBMS has distribution independence.
Rule 12: The nonsubversion rule:
If a relational system has a low-level (single-record-at-a-time) language, that low level cannot
be used to subvert or bypass the integrity rules and constraints expressed in the higher level
relational language (multiple-records-at-a-time).
<< Back
Koushik De- - CSE, UEMK 78
Koushik De- - CSE, UEMK 79

More Related Content

Similar to Introduction to DBMS.pptx

Similar to Introduction to DBMS.pptx (20)

unit 1.pdf
unit 1.pdfunit 1.pdf
unit 1.pdf
 
Dbms models
Dbms modelsDbms models
Dbms models
 
Fundamentals of Database system - Databases and Database Users
Fundamentals of Database system - Databases and Database UsersFundamentals of Database system - Databases and Database Users
Fundamentals of Database system - Databases and Database Users
 
Database Management system
Database Management systemDatabase Management system
Database Management system
 
En ch01
En ch01En ch01
En ch01
 
DBMS Part1.pptx
DBMS Part1.pptxDBMS Part1.pptx
DBMS Part1.pptx
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
Db lecture 1
Db lecture 1Db lecture 1
Db lecture 1
 
1-introduction to DB.pdf
1-introduction to DB.pdf1-introduction to DB.pdf
1-introduction to DB.pdf
 
database introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdfdatabase introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdf
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Dbms unit01
Dbms unit01Dbms unit01
Dbms unit01
 
CP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementCP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implement
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
 
DBMS-INTRODUCTION.pptx
DBMS-INTRODUCTION.pptxDBMS-INTRODUCTION.pptx
DBMS-INTRODUCTION.pptx
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbms
 
Dbms
DbmsDbms
Dbms
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 

Recently uploaded

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 

Recently uploaded (20)

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 

Introduction to DBMS.pptx

  • 2. Objectives…. Introduction to Database Database Users Characteristics of the Database Approach Different people behind DBMS Implications of Database Approach Advantages of using DBMS, When not to use a DBMS. 2
  • 3. Objectives… Database System Concepts Data Base Architecture Data Models, Schemas, and Instances. DBMS Architecture and Data Independence Database languages and interfaces. The database system Environment Classification of DBMS. 3
  • 4. Introduction Data – Collection of facts and figures. e.g., - texts, numbers, alphanumeric, audio, video, image. Information- Meaningful data is called Information. (Processed data) Database – Collection of related information. ◦ Types of database – Traditional database Multimedia database Geographic Information System (GIS) Database Real-time database Data Warehouse (huge volume of historical data) DBMS – Collection of interrelated data and a set of programs to access the data. It helps us to store and retrieve database information in a convenient and efficient manner. 4 Database (DB) + Management System (MS) = Database Management System (DBMS)
  • 5. Introduction (contd..) DBMS Software – MS Access, Oracle, SQL Server, MySQL DB2, SYBASE, etc. MS Excel – Does possess data management capabilities, but not a pure DBMS. Languages used by DBMS Software – SQL, PL/SQL Applications – Banking, Airline, Retail, Manufacturing, Telecommunication, Universities, etc. Users of Database –  Naive Users – Who knows nothing about the database but interacts with the system by invoking one of the application programs that have been written earlier.  Sophisticated Users – performs the same task of data entry not by using any application program, but by means of query language like SQL. 5
  • 6. Introduction (contd..) Types of Users  Database Administrator (DBA)  Database Designer  Application Programmer  End User. 6
  • 7. Database Administrator (DBA): • Database Administrator (DBA) is the person which makes the strategic and policy decisions regarding the data of the enterprise, and who provide the necessary technical support for implementing these decisions. • DBA is responsible for overall control of the system at a technical level. • In database environment, the primary resource is the database itself and the secondary resource is the DBMS and related software administering these resources is the responsibility of the Database Administrator (DBA). 7
  • 8. Database Designer  Database designer determines the requirement of end users, and develops specifications for transactions that meet these requirements.  Database designer plays a major role in database design, its properties;  the structure prepares the system requirement statement, which involves the feasibility aspect, economic aspect, technical aspect etc. of the system 8
  • 9. Application programmers • These users write application programs to interact with the database. • Application programs can be written in some programming language such a COBOL, PL/I, C++, JAVA or some higher level fourth generation language. • Such programs access the database by issuing the appropriate request, typically a SQL statement to DBMS. 9
  • 10. End Users • End users are the users, who use the applications developed. • End users need not know about the working, database design, the access mechanism etc. They just use the system to get their task done. End users are of two types: Direct users Indirect users 10
  • 11. Types of End Users Direct users: Direct users are the users who use the computer, database system directly, by following instructions provided in the user interface. They interact using the application programs already developed, for getting the desired result. E.g. People at railway reservation counters, who directly interact with database. a) Indirect users: • Indirect users are those users, who desire benefit form the work of DBMS indirectly. • They use the outputs generated by the programs, for decision making or any other purpose. • They are just concerned with the output and are not bothered about the programming part. 11
  • 12. Data redundancy and inconsistency Difficulty in accessing data Data isolation – multiple files and formats Integrity problems (enforcing consistency constraints) Atomicity of updates Concurrent access by multiple users Security problems 12
  • 13. Implications of Using the Database Approach  Standards can be Enforced with Database Approach. ...  Quicker Application Development. ...  Flexibility of Altering Data Structures. ...  Readily Available Information Across Network. ...  Economical Scalability. 13
  • 14. Advantages of Data base approach Data Independence: The data is held in such a way that changes to the structure of the database do not effect any of the programs used to access the data. Consistency of Data: Each item of data is held only once therefore no danger of item being updated on one system and not on another. Control over Redundancy: In a non-database system, the same information may be held on several files. This wastes space and makes updating more time-consuming. A database system minimizes these effects. 14
  • 15. Advantages of Data base approach Integrity of Data: The DBMS provides users with the ability to specify constraints on data such as making a field entry essential or using a validation routine. Greater Security of Data: The DBMS can ensure only authorized users are allowed access to the data. Centralized Control of Data: The Database Administrator will control who has access to what and will structure the database with the needs of the database. 15
  • 16. More Information Available to Users: Users have access to a wider range of data that was previously held in separate departments and sometimes on incompatible systems. Increased Productivity: The DBMS provides an easy to use query language that allows users to get immediate response from their queries rather than having to use a specialist "programmer" to write queries for them. whole 16
  • 19. Views Part of the database that is visible to a particular user, for e.g., in a banking system, the person who checks the account debits and credits of a customer is not granted access to the payroll system. The account, depositor and borrower tables are his view. Differ from person to person. The authorization of access is granted by the DBA. 19
  • 20. Levels of Abstraction  User View level describes how users see the data.  Conceptual or Logical level defines logical structure  Physical level describes the files and indexes used. 20 Physical Schema Conceptual Schema View 1 View 2 View 3 DB Users also known as the ANSI/SPARC model
  • 21. Example: University Database Conceptual schema: ◦ Students (sid: string, name: string, age: integer, gpa:real) ◦ Courses (cid: string, cname:string, credits:integer) ◦ Enrolled (sid:string, cid:string, grade:string) External Schema (View Level): ◦ Course info (cid:string, enrollment:integer) Physical schema: ◦ Relations stored as unordered files. ◦ Index on first column of Students. 21 Physical Schema Conceptual Schema View 1 View 2 View 3 DB
  • 22. Data Independence Ability to modify a schema definition in one level without affecting a schema definition in the other levels. Logical data independence: Protection from changes in logical structure of data. Physical data independence: Protection from changes in physical structure of data. 22 Physical Schema Conceptual Schema View 1 View 2 View 3 DB
  • 23. Metadata & Data dictionary Metadata – Data about data It is the overall description of the database specified by a set of definitions and constraints, for e.g. – Means of creation of the data Purpose of the data Time and date of creation Creator or author of the data Location on a computer network where the data was created Standards used File size Data dictionary – Metadata repository It stores information about each data element in the database such as its name, data type, range of value, source, access authorization and indicates which application programs use this data item. 23
  • 25. Database Models  Record based  data model 25 Object based data model  Physical  data model Entity-Relationship (E-R) Network Relational Hiearchical Semantic Functional Object based Unifying Frame-memory
  • 30. Entity-Relationship (E-R) Model 30 customer account depositor social-security customer-street customer-name account-number balance customer-city
  • 31. E-R Model (Contd..) 31 student course enroll name dob roll cid cname age Attributes Entity Set Relationship
  • 33. RDBMS A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as invented by E. F. Codd He proposed thirteen golden rules to define what is required from a database management system in order for it to be considered relational, i.e., RDBMS See Codd’s 13 Golden Rules Basic Idea – to present the data to the user as relations (i.e. as a collection of tables with each table consisting of a set of rows and columns) to provide relational operators to manipulate the data in tabular form. 33
  • 34. Relational Schema 34 Student Roll Name DOB Age 1 Aamir Khan 14-03-1965 50 2 Shahrukh Khan 02-11-1965 50 3 Salman Khan 28-12-1965 50 Fields / Attributes Tuple / Record / Entity Entity Set Values Student Schema Degree C a r d i n a l i t y
  • 35. Few Terminologies Schema – the logical structure of the database (e.g., set of customers and accounts and the relationship between them). Instance – the actual content of the database at a particular point in time. Degree – the number of columns associated with a relation or table. Cardinality – the number of rows in a table. Domain – the range of possible values for an attribute. e.g. – the domain for the attribute gender may be {‘M’, ‘F’} the domain for the attribute title may be { ‘Mr.’, “Ms.’, ‘Mrs.’, ‘Dr.’} 35
  • 36. Few Terminologies (Contd..) Extension - The extension of a given relation is the set of tuples appearing in that relation at any given instance. The extension thus varies with time. It changes as tuples are created, destroyed, and updated. 36 EmpNo EmpName Dept 1001 Ramesh Marketing 1002 Suresh Finance EmpNo EmpName Dept 1001 Ramesh Marketing 1002 Suresh Finance 1003 Amar Sales 1004 Akbar HR 1005 Antony Finance at time t1 at time t2
  • 37. Intension - The intension of a given relation is independent of time. It is the permanent part of the relation. It corresponds to what is specified in the relational schema. It is a combination of two things : a structure and a set of integrity constraints. Example - Employee (EmpNo Number(4) Not NULL, EmpName Char(20), Dept Char(10) ) This is the intension of Employee relation. Control Redundancy – Read only data is repeated sometimes to increase availability. 37
  • 38. Simple attribute – attribute that consist of a single atomic value. e.g. – Roll, Marks, Salary, etc. Composite Attribute – attributes which can be decomposed further e.g. – Name (First Name, Middle Name, Last Name) Address (House No., Street, City, State) Single-valued atribute – attribute that hold a single value e.g. – City, EmpId, Salary, etc. Multi-valued attribute – attribute that hold multiple values e.g. – Phone no., EmailID Derived attribute – an attribute that can be calculated or derived from another attribute e.g. – Age (derived from DOB) Null attribute – an attribute whose value is missing for a record. e.g. - if a record does not contain an assignment for the Price attribute 38
  • 40. Super Key – An attribute or a group of attribute that can uniquely identify a tuple from a relational schema. Candidate Key – Minimal Super key. Prime attribute – Member of some candidate key Primary Key – One of the Candidate keys (usually the most powerful one, depends on the choice of the user) that can uniquely fetch a tuple from a relational schema. A primary key cannot accept NULL values. A composite primary key is a primary key comprising of more than one attributes. Alternate / Secondary Key – Rest all candidate keys. Unique Key – same as primary key, but can accept NULL values. 40
  • 41. Foreign Key – An attribute of an entity set E, which is dependant on the primary key of another entity set E1. The former table is called the referencing table and the latter is called the referenced or derived table. In such a case, E has to be constructed first and then E1. While deletion, E1 has to be deleted first and then E. e.g. – Consider the below relations: student = (roll, name, marks) course = (cid, cname) enroll = (roll, cid) roll, cid in the enroll relation are foreign keys and together form the composite primary key for the relation. Koushik De- - CSE, UEMK 41
  • 42. Strong entity set – An entity set that has a fixed entity set. Weak entity set – An entity set that does not have sufficient attributes to form a primary key. e.g. – loan = (loan_id, loan_name, borrower, amount) payment = (payment_id, payment_date, amount) The payment relation does not have a primary key (payment_id cannot uniquely identify tuples) and hence is a weak entity set. Discriminator/Partial Key – An attribute of a weak entity set which normally does not show uniqueness, but shows uniqueness when combined with a strong Entity set. e.g. – payment_id when combined with loan_id, can uniquely identify tuples. Koushik De- - CSE, UEMK 42
  • 43. Entity Integrity – If an attribute is a prime attribute, it cannot accept NULL values. In other words, no component of a primary key can be NULL. Extension to the above rule - No non-key attribute can be referenced. Referential Integrity – Ensures that a value that appears in one relation for a given set of attributes also appears for a certain set of attributes in another relation. In other words, it states that any foreign key value must match a primary key value (or the foreign key value can be NULL). e.g. –  Restrict – do not allow deletion of ‘parent’ side if related rows exist in ‘dependant’ side.  Cascade – automatically delete ‘dependant’ side rows that correspond to the ‘parent’ side row to be deleted. Koushik De- - CSE, UEMK 43
  • 45. E-R Model Proposed by Peter Chen in 1976 ER diagram is widely used in database design ◦ Represent conceptual level of a database system ◦ Describe things and their relationships in high level Entity set – an abstraction of similar things, e.g. cars, students ◦ An entity set contains many entities Attributes – common properties of the entities in a entity sets Relationship – specify the relations among entities from two or more entity sets Koushik De- - CSE, UEMK 45
  • 46. E-R Diagram Notations Koushik De- - CSE, UEMK 46
  • 47. E-R Diagram Notations (contd..) Koushik De- - CSE, UEMK 47
  • 48. An Example Koushik De- - CSE, UEMK 48
  • 49. Attributes Both entity sets and relationships can have attributes Attributes may be ◦ Composite ◦ Multi-valued (double ellipse) ◦ Derived (dashed ellipse) Koushik De- - CSE, UEMK 49
  • 50. An Example Koushik De- - CSE, UEMK 50
  • 51. Relationship The degree of a relationship = the number of entity sets that participate in the relationship ◦ Mostly binary relationships ◦ Sometimes more Mapping cardinality of a relationship ◦ 1 –1 ◦ 1 – many ◦ many – 1 ◦ Many-many Koushik De- - CSE, UEMK 51
  • 53. Attribute of A Relationship Set Koushik De- - CSE, UEMK 53
  • 54. One-One and One-Many Koushik De- - CSE, UEMK 54
  • 55. Many-one and many-many Koushik De- - CSE, UEMK 55
  • 56. Peter Chen & Bachman Notations Koushik De- - CSE, UEMK 56
  • 57. Total Participation Koushik De- - CSE, UEMK 57 When we require all entities to participate in the relationship (total participation), we use double lines to specify Every loan has to have at least one customer
  • 58. Alternative Cardinality Specification Koushik De- - CSE, UEMK 58 • l..h - Minimum cardinality..maximum cardinality • A minimum value of 1 indicates total participation of the entity set in the relationship • A maximum value of 1 indicates that the entity participates in at most one relationship, while a maximum value of * indicates no limit. • A label 1..* indicates total participation.
  • 59. Self Relationship Sometimes entities in a entity set may relate to other entities in the same set. Thus self relationship Here employees mange some other employees The labels “manager” and “worker” are called roles the self relationship Koushik De- - CSE, UEMK 59
  • 60. Weak Entity Set Some entity sets in real world naturally depend on some other entity set. They can be uniquely identified only if combined with another entity set Koushik De- - CSE, UEMK 60  Double rectangles for weak entity set  Double diamond for weak entity relationship  Dashed underscore for discriminator
  • 61. Extended E-R Features Koushik De- - CSE, UEMK 61
  • 62. Generalization & Specialization Shows inheritance of attributes. A lower-level entity set inherits all the attributes and relationship participation of the higher-level entity set to which it is linked. A lower-level entity set may have additional attributes and participate in additional relationships. Also knows as Superclass-Subclass relationship. Koushik De- - CSE, UEMK 62
  • 64. Constraints Domain Constraint – Declaring an attribute to be of a particular domain acts as a constraint on the values that it can take. Participation Constraint – The participation of an entity set in a relationship can be total or partial, thus acting as a constraint on the values. Cardinality Constraint – The type of mapping – one-one, one-many, many-one and many-many acts as a constraint on the values. Koushik De- - CSE, UEMK 64
  • 65. Constraints (contd..) Constraints on Generalization – Disjoint – A disjointness constraint requires that en enity belong to no more than one lower-level entity set within a single generalization. e.g. – An account entity can be either a savings account or a checking account, but not both. Overlapping – In overlapping generalization, the same entity may belong to more than one lower- level entity set within a single generalization. e.g. – An employee may appear in more than one of the team entity sets that are lower-level entity sets of employee. The same person can be both an officer and a secretary. Koushik De- - CSE, UEMK 65
  • 66. Cannot represent relationship among relationships. Koushik De- - CSE, UEMK 66  Some employee, branch, job combination may not have a manager.  Since every employee, branch, job combination in manages is also in works_on, there is redundant information.
  • 67. Koushik De- - CSE, UEMK 67 Treats relationships as higher level entities.
  • 68. More E-R Diagram Examples Koushik De- - CSE, UEMK
  • 69. Koushik De- - CSE, UEMK
  • 70. Koushik De- - CSE, UEMK
  • 71. Koushik De- - CSE, UEMK
  • 73. Database Languages Procedural Non-procedural Determines WHAT & HOW a process should be done. e.g. – Relational Algebra Is concerned with the WHAT not the HOW e.g. – Relational Calculus, SQL Koushik De- - CSE, UEMK 73
  • 74. Types of SQL Statements  Data Definition Language (DDL) – specifies the database schema (CREATE, ALTER, DROP)  Data Manipulation Language (DML) – enables the user to access or manipulate data such as insertion, deletion and modification or records (INSERT, DELETE, UPDATE)  Data Query Language (DQL) – enables the user to query* on one or more tables to get the required information they want (SELECT)  Data Control Language (DCL) – using this, the access of users is controlled by the DBA (GRANT, REVOKE)  Transaction Control Language (TCL) – enables the user for transaction processing (COMMIT, ROLLBACK, ROLLBACK TO) Koushik De- - CSE, UEMK 74 * A query is a statement requesting the retrieval of information (e.g., select * from student where age > =18;)
  • 75. Appendix Koushik De- - CSE, UEMK 75
  • 76. Codd’s 13 Golden Rules Rule 0: The Foundation rule: For any system that is advertised as, or claimed to be, a relational data base management system, that system must be able to manage data bases entirely through its relational capabilities. Rule 1: The information rule: All information in a relational data base is represented explicitly at the logical level and in exactly one way — by values in tables. Rule 2: The guaranteed access rule: Each and every datum (atomic value) in a relational data base is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name. Rule 3: Systematic treatment of null values: Null values (distinct from the empty character string or a string of blank characters and distinct from zero or any other number) are supported in fully relational DBMS for representing missing information and inapplicable information in a systematic way, independent of data type. Rule 4: Dynamic online catalog based on the relational model: The data base description is represented at the logical level in the same way as ordinary data, so that authorized users can apply the same relational language to its interrogation as they apply to the regular data. Koushik De- - CSE, UEMK 76
  • 77. Codd’s 13 Golden Rules (Contd..) Rule 5: The comprehensive data sublanguage rule: A relational system may support several languages and various modes of terminal use (for example, the fill-in-the-blanks mode). However, there must be at least one language whose statements are expressible, per some well-defined syntax, as character strings and that is comprehensive in supporting all of the following items: Data definition. View definition. Data manipulation (interactive and by program). Integrity constraints. Authorization. Transaction boundaries (begin, commit and rollback). Rule 6: The view updating rule: All views that are theoretically updatable are also updatable by the system. Rule 7: High-level insert, update, and delete: The capability of handling a base relation or a derived relation as a single operand applies not only to the retrieval of data but also to the insertion, update and deletion of data. Rule 8: Physical data independence: Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representations or access methods. Koushik De- - CSE, UEMK 77
  • 78. Rule 9: Logical data independence: Application programs and terminal activities remain logically unimpaired when information- preserving changes of any kind that theoretically permit unimpairment are made to the base tables. Rule 10: Integrity independence: Integrity constraints specific to a particular relational data base must be definable in the relational data sublanguage and storable in the catalog, not in the application programs. Rule 11: Distribution independence: A relational DBMS has distribution independence. Rule 12: The nonsubversion rule: If a relational system has a low-level (single-record-at-a-time) language, that low level cannot be used to subvert or bypass the integrity rules and constraints expressed in the higher level relational language (multiple-records-at-a-time). << Back Koushik De- - CSE, UEMK 78
  • 79. Koushik De- - CSE, UEMK 79