SlideShare a Scribd company logo
1 of 55
Download to read offline
RDBMS Concepts – Part I
Khalidc2001@gmail.com
NIC Wayanad 2
We Discuss…
 What is a database
 RDBMS Concepts
 Relational Model
 Entity – Relationship Model
 Relationships
 Constraints
 Keys
 Normalization
 Transaction Control
NIC Wayanad 3
What is a database ?
 A database is an organized collection
of information
 To manage databases, you need
database management systems
(DBMS)
NIC Wayanad 4
DBMS
 A collection of programs that
enables you to store, modify, and
extract information from a database.
 A computer program designed for
the purpose of managing database
NIC Wayanad 5
Type of databases
 Four main types of databases
 Hierarchical
 Network
 Relational
 Object Relational
NIC Wayanad 6
Relational Database Concept
 Dr. E.F.Codd proposed the relational
model for database system in 1970.
 It is the basis for the relational
database management system
(RDBMS)
NIC Wayanad 7
Relational Database Model
 Uses tables to organize data
 Each table corresponds to an entity
 Each row represents the instance of
that entity
 Tables can be related each other
• Relation=Table
• Tuple=Row
• Attribute=Column
NIC Wayanad 8
RDBMS
 Fundamental Features
 ACID
 Referential Integrity
 Transactions
 Unicode
 other objects are supported
 Data Domain
 Cursor
 Trigger
 Function
 Procedure
 Database Capabilites
 Union
 Inner joins
 Outer joins
 Inner selects
 Merge
 Blobs
NIC Wayanad 9
Databases in marketRDBMS Maintainer   Software license  
4th Dimension 4D s.a.s Proprietary
Adabas Software AG ?
Adaptive Server
Enterprise Sybase Proprietary
Apache Derby Apache Apache License
DB2 IBM Proprietary
DBISAM Elevate Software Proprietary
ElevateDB Elevate Software Proprietary
Firebird Firebird project IPL and IDPL
Informix IBM Proprietary
HSQLDB HSQL Development Group BSD
H2 H2 Software Freeware
Ingres Ingres Corp. GPL and proprietary
InterBase CodeGear Proprietary
MaxDB MySQL AB, SAP AG GPL or proprietary
Microsoft SQL Server Microsoft Proprietary
MonetDB
The MonetDB Developer Team
MonetDB Public License
v1.1
MySQL MySQL AB GPL or proprietary
HP NonStop SQL Hewlett-Packard Proprietary
Oracle Oracle Corporation Proprietary
Oracle Rdb Oracle Corporation Proprietary
OpenEdge Progress Software Corporation Proprietary
OpenLink Virtuoso OpenLink Software GPL or proprietary
Pervasive PSQL Pervasive Software Proprietary
PostgreSQL
PostgreSQL Global Development
Group BSD
Pyrrho DBMS University of Paisley Proprietary
SmallSQL SmallSQL LGPL
SQL Anywhere Sybase Proprietary
SQLite D. Richard Hipp Public domain
Teradata Teradata Proprietary
Valentina Paradigma Software Proprietary
NIC Wayanad 10
Relational Model
Three key terms are used extensively in relational
models
 Relation
• relation is a table with columns and rows
 Attributes
• The named columns of the relation are
called attributes
 Domains
• set of values the attributes are allowed to
take
NIC Wayanad 11
Relational Model
ProducerID ProducerName Place Sex Caste DateBirth
1 BALAKRISHNAN.P.K VATTOLI BAZAR M GEN
2 VASUDEVAN NAMBIAR BALUSSERY M GEN 01/07/1948
3 HARIDASAN.M KARIYATHANKAVU M GEN 11/05/1962
4 ASIYA.N.K VATTOLI BAZAR F OBC
5 VELU VATTOLI BAZAR M OBC 02/10/1947
6 KELUKUTTI NAIR. P VATTOLI BAZAR M GEN
7 ROHINI. V.K VATTOLI BAZAR F GEN 01/07/1933
8 SURESH BABU.K.R KARIYATHANKAVU M ST
9 KUTTINARAYANAN NAIR VATTOLI BAZAR M GEN 07/10/1971 Tuple
10 LAKSHMI.T.P VATTOLI BAZAR F GEN
11 ABUBAKKAR. M KAPPURAM M OBC 22/04/1959
12 RAJAN NAIR.O.K KARIYATHANKAVU M GEN 15/11/1956
13 PRABAKARAN NAIR.K.K VATTOLI BAZAR M GEN
14 BALAN.K.P VATTOLI BAZAR M SC 25/09/1967
Domain
•A relation has a unique name and represents particular entity
•Each row of a relation referred to as a tuple
•A Key is a part of tuple that uniquely distinguishes from other tuples
•relation is a set of tuples
NIC Wayanad 12
Data Modelling
Database Server
Model of system in
clients’s mind
ER Model of Client’s
model
Table model of ER
model
Tables on disk
Analysis StageAnalysis Stage
 Identifies::
 entitiesentities - things of significance- things of significance
 relationshipsrelationships - associations between entities- associations between entities
 functionsfunctions - processes in the business- processes in the business
 businessbusiness rulesrules - restrictions or constraints- restrictions or constraints
 Does NOT identify tables, views, files, screens,
reports, or other computer-specific items...
NIC Wayanad 14
Entity – Relationship Model
 It facilitates communication between
the database designer and the end
user during the requirement
analysis.
 To facilitate such communication the designer
needs adequate communication tools
NIC Wayanad 15
Basic Elements of ER Model
 Entity
• An entity defines any person, place, thing
or concept
• Eg : (Producer, Taluk, Course)
 Attribute
• Characteristics (properties) of an entity
• Eg: (ProducerName, MemberID, HouseName)
 Relationship
• Logical linkage between two entities
NIC Wayanad 16
ER Diagram
NIC Wayanad 17
Let us model
 A Depot is a place where Producers pours their
cow milk
 A Producer is a person who belongs to a Depot
and regularly pours Milk to Society
 A Collection Agent, who procures Milk from
Producers through Depot.
 Procurement Register maintains by
Collection Agent with the details of Milk poured
by Producers
 A Member is a Producer, who gets Membership
through board resolution.
NIC Wayanad 18
ER Model - Entities
 The highlighted words becomes entity
 Entities are represented by rectangular box
DepotDepot
ProducersProducers
MembersMembers
Collection AgentCollection Agent
Procurement RegisterProcurement Register
NIC Wayanad 19
ER Model - Attributes
 Attributes are the properties of entities
 Provides additional information about entity
 Possible attributes for each entity
 Depot : DepotID, Name, DateStart
 Producers : Name, Address, DateofBirth, Sex, Caste and
MemberID etc
 Collection Agent : Name, Address
 Members: MemberID, Date of Admission, Share Value
 Procurement Register: ProducerID, Date, Time, MilkQty,
Milk Value
NIC Wayanad 20
Relationships
 A relationship is an association between
two or more entities
 Each entity in a relationship plays a role
 Examples:
 if we are identifying relationships between
DEPOT and PRODUCER, then we might define
the “pours”, “Belongs to”
NIC Wayanad 21
ER Model - Entities
DepotDepot
DepotIDDepotID
NameName
AddressAddress
ProducersProducers
ProducerNameProducerName
AddressAddress
SexSex
CasteCaste
PhonePhone
MemberIDMemberID
DateofJoinDateofJoin
MembersMembers
MemberIDMemberID
DateofAdmissionDateofAdmission
ShareNosShareNos
ShareValueShareValue
DateOfBirthDateOfBirth
IDCardNoIDCardNo
Proc_RegProc_Reg
ProducerIDProducerID
DateDate
TimeTime
MilkQtyMilkQty
CLRCLR
FATFAT
SNFSNF
MilkValueMilkValue
Collection_AgentCollection_Agent
AgentIDAgentID
NameName
AddressAddress
DepotDepot
DepotID
Name
Address
NIC Wayanad 22
ER Model - Relationships
 Logical linkage between two entities
 A relationship connects two or more entity sets
 Relationships are represented by diamond shape
box
NIC Wayanad 23
DepotDepot
DepotIDDepotID
NameName
AddressAddress
ProducersProducers
ProducerNameProducerName
AddressAddress
SexSex
CasteCaste
PhonePhone
MemberIDMemberID
DateofJoinDateofJoin
MembersMembers
MemberIDMemberID
DateofAdmissionDateofAdmission
ShareNosShareNos
ShareValueShareValue
DateOfBirthDateOfBirth
IDCardNoIDCardNo
Proc_RegProc_Reg
ProducerIDProducerID
DateDate
TimeTime
MilkQtyMilkQty
CLRCLR
FATFAT
SNFSNF
MilkValueMilkValue
Collection_AgentCollection_Agent
AgentIDAgentID
NameName
AddressAddress
Contains
Becomes
Pours Milk
handles
Managed by
NIC Wayanad 24
Constraints….
 are rules that describe what valid data
look like
 ensure the logical and semantic
consistency
 Rules used to ensure accuracy and
integrity of data
NIC Wayanad 25
Constraint Types
NIC Wayanad 26
PRIMARY KEY Constraints
 primary key is a candidate key to
uniquely identify each row in a table
.
PCODE PANCH_NAME
01 KANIAMBETTA
02 KOTTATHARA
03 MEPPADI
04 MUTTIL
05 PADINJARETHARA
NIC Wayanad 27
PRIMARY KEY Constraints
 Defining PRIMARY KEY
CREATE TABLE Depot (DepotID INT, DepotName
VARCHAR(20), CONSTRAINT dep_pk PRIMARY
KEY(DepotID))
 Add a PRIMARY KEY to an existing table
ALTER TABLE Depot ADD CONSTRAINT pk_dep
PRIMARY KEY (DepotID)
NIC Wayanad 28
FOREIGN KEY Constraints
 Foreign key: a field in a table that is a primary
key in another table
 Foreign key creates a relationship between the
two tables
 Enforces referential integrity
 Maps to the PRIMARY KEY in parent table
DepotID Name
1 OFFICE
2 VADUVANA
3 ANDOOR
4 PAMBALA
5 KADALMADU
6 MUNNOORE
ProducerID ProducerName DepotID
1 JOSEPH V.V 1
2 VELIYAN.V 3
3 JOHN.P.J 2
4 POULOSE. M M 2
5 JOSEPH.E.S 2
6 ACHANKUNHU N G 1
7 VARKY.M.M 1
8 MATHAI.M.M 5
9 APPACHAN.P.V 5
10 ISSAC.M.M 1
11 RAJU.P.T 2
Parent Table
(FK)
(PK)
NIC Wayanad 29
FOREIGN KEY Constraints..
 Defining a FOREIGN KEY
CREATE TABLE Depot(DepotID INT PRIMARY KEY,DepotName
VARCHAR(20) NOT NULL);
CREATE TABLE Producers(ProducerID INT,ProducerName
VARCHAR(50) NOT NULL,DepotID INT, CONSTRAINT
pk_Prod PRIMARY KEY(ProducerID),CONSTRAINT
fk_prod FOREIGN KEY(DepotID) REFERENCES
Depot(DepotID) );
 Add a FOREIGN KEY to an existing table
ALTER TABLE Producers ADD CONSTRAINT fk_Prod
FOREIGN KEY (DepotID) REFERENCES Depot(DepotID)
NIC Wayanad 30
UNIQUE KEY Constraints
 No duplicates allowed in referenced column
 NULL values are permitted
ProducerID ProducerName DepotID MemberID
1 JOSEPH V.V 1
2 VELIYAN.V 3 245
3 JOHN.P.J 2
4 POULOSE. M M 2
5 JOSEPH.E.S 2
6 ACHANKUNHU N G 1 154
7 VARKY.M.M 1
8 MATHAI.M.M 5 453
9 APPACHAN.P.V 5
10 ISSAC.M.M 1 12
11 RAJU.P.T 2
CREATE TABLE Producers(ProducerID INT PRIMARY KEY,ProducerName
VARCHAR(50) NOT NULL,DepotID INT,MemberID INT UNIQUE,CONSTRAINT
fk_prd1 FOREIGN KEY(DepotID) REFERENCES Depot(DepotID))
NIC Wayanad 31
CHECK Constraints
 ensure valid data when adding or updating an
entry in a table
ProducerID ProducerName Sex DateJoin DateBirth ShareValue
1 JOSEPH V.V M 01/04/2001 11/04/1965 10
2 VELIYAN.V M 15/06/2007 12/09/1954 10
3 JOHN.P.J M 19/04/2003 08/05/1946 10
4 POULOSE. M M M 24/03/1997 10/05/1964 10
5 ANNAMMA F 26/07/2004 17/08/1959 10
6 ACHANKUNHU N G M 04/09/1992 18/07/1961 10
7 VARKY.M.M M 08/07/1991 19/03/1942 20
8 MATHAI.M.M M 17/08/1987 22/05/1938 10
M or F
Date Join >
Date Birth
>0CHECK Constraints -->
CREATE TABLE Producers(ProducerID INT ……,CONSTRAINT
check_Sex CHECK(Sex=‘M’ OR ‘F’),CONSTRAINT chk_share
CHECK(ShareValue>0))
NIC Wayanad 32
NOT NULL Constraints
 Ensures that a specified column cannot contain a
Null Value
CREATE TABLE Depot(DepotID INT PRIMARY
KEY,DepotName VARCHAR(20) NOT NULL);
DepotID Name
1 OFFICE
2 VADUVANA
3 ANDOOR
4 PAMBALA
5 KADALMADU
6 MUNNOORE
DepotID Name
1 OFFICE
2 VADUVANA
3 ANDOOR
4 PAMBALA
5
6 MUNNOORE
Violation against NOT NULL
NIC Wayanad 33
Surrogate key
 A surrogate key in a database is a unique identifier
 surrogate key is not derived from application data
 A surrogate key may be used as the primary key
 some possible candidates for generating surrogates:
 Globally Unique Identifiers (GUIDs)
 Object Identifiers (OIDs)
 Sybase or SQL Server identity column
 Oracle SEQUENCE
 PostgreSQL serial
 MySQL AUTO_INCREMENT
 MS Access AUTONUMBER
NIC Wayanad 34
Relationships
The following relationships can be
included in an E-R Model:
 One-to-one
 One-to-many
 Many-to-many
NIC Wayanad 35
One-to-one Relationship
 Each occurrence (row) of data in one entity is related to
only one occurrence of data in the other entity
 Example: Each Producer has just one MemberID and each
MemberID is assigned to just one Producer
ProducerID ProducerName DepotID MemberID
1 JOSEPH V.V 1 5
2 VELIYAN.V 3 26
3 JOHN.P.J 2
4 POULOSE. M M 2 125
5 JOSEPH.E.S 2 110
6 ACHANKUNHU N G 1 12
7 VARKY.M.M 1 35
8 MATHAI.M.M 5
9 APPACHAN.P.V 5
10 ISSAC.M.M 1
11 RAJU.P.T 2 2
MemberID DateAdmit ShareValue
2 12/04/1987 10.00
5 12/04/1987 10.00
12 25/07/1988 10.00
26 25/09/1988 20.00
35 12/08/1997 10.00
110 02/12/2000 10.00
125 16/08/1998 10.00
PRODUCERS
MEMBERS
NIC Wayanad 36
One-to-many Relationship
 Each occurrence of data in one entity can be
represented by many occurrences of the data in
the other entity
 Example: each Depot carries many producers
PRODUCERS
DEPOT
DepotID Name
1 OFFICE
2 VADUVANA
3 ANDOOR
4 PAMBALA
5 KADALMADU
6 MUNNOORE
ProducerID ProducerName DepotID
1 JOSEPH V.V 1
2 VELIYAN.V 3
3 JOHN.P.J 2
4 POULOSE. M M 2
5 JOSEPH.E.S 2
6 ACHANKUNHU N G 1
7 VARKY.M.M 1
8 MATHAI.M.M 5
9 APPACHAN.P.V 5
10 ISSAC.M.M 1
11 RAJU.P.T 2
NIC Wayanad 37
Many-to-many Relationship
 Data can have multiple occurrences in
both entities
 In a proper design, this can’t be included
in the physical database
NIC Wayanad 38
ER Diagram of
NIC Wayanad 39
DepotDepot
DepotIDDepotID
NameName
AddressAddress
ProducersProducers
ProducerNameProducerName
AddressAddress
SexSex
CasteCaste
PhonePhone
MemberIDMemberID
DateofJoinDateofJoin
MembersMembers
MemberIDMemberID
DateofAdmissionDateofAdmission
ShareNosShareNos
ShareValueShareValue
DateOfBirthDateOfBirth
IDCardNoIDCardNo
Proc_RegProc_Reg
ProducerIDProducerID
DateDate
TimeTime
MilkQtyMilkQty
CLRCLR
FATFAT
SNFSNF
MilkValueMilkValue
Collection_AgentCollection_Agent
AgentIDAgentID
NameName
AddressAddress
Contains
Becomes
Pours Milk
handles
Managed by
NIC Wayanad 40
Normalization
 ..is a process you can use to split out
non-relational tables into relational tables.
 ..is a technique for designing relational
database tables to minimize duplication of
information
 .. is to safeguard the database against
data anomalies
NIC Wayanad 41
Bad Design
 Update anomaly
Employee 519 is shown as having different addresses on
different records.
NIC Wayanad 42
Bad Design
 Insertion anomaly
Until the new faculty member is assigned to teach at least
one course, his details cannot be recorded.
NIC Wayanad 43
Bad Design
 Deletion anomaly
All information about Dr. Giddens is lost when he
temporarily ceases to be assigned to any courses.
NIC Wayanad 44
First Normal Form (1NF)
Remove repeating columns by creating new table moving the
columns into the new table, and linking back to the old table in a
on-to-many relationship.
ProducerID ProducerName Address Day1Qty Day1Value Day2Qty Day2Value Day3Qty Day3Value
1 JOSEPH V.V KALPETTA 1.2 15.25 1.9 22.5
2 VELIYAN.V MEPPADI 2.4 36.3 2.9 39.5 3.5 49.5
3 JOHN.P.J KALPETTA 5.4 68.5
4 POULOSE. M M BATHERY 6.4 79.8 7.1 89.9 6.5 78.5
5 JOSEPH.E.S PULPALLY . 2.9 34.35
PRODUCERS_PROCUREMENT
•To Eliminate repeating groups
NIC Wayanad 45
First Normal Form (1NF)
ProducerID ProducerName Address Day1Qty Day1Value Day2Qty Day2Value Day3Qty Day3Value
1 JOSEPH V.V KALPETTA 1.2 15.25 1.9 22.5
2 VELIYAN.V MEPPADI 2.4 36.3 2.9 39.5 3.5 49.5
3 JOHN.P.J KALPETTA 5.4 68.5
4 POULOSE. MM BATHERY 6.4 79.8 7.1 89.9 6.5 78.5
5 JOSEPH.E.S PULPALLY . 2.9 34.35
Before
After
ProducerID ProducerName Address
1 JOSEPH V.V KALPETTA
2 VELIYAN.V MEPPADI
3 JOHN.P.J KALPETTA
4 POULOSE. M M BATHERY
5 JOSEPH.E.S PULPALLY
ProducerID Day Qty Value
1 1 1.2 15.25
1 3 1.9 22.5
2 1 2.4 36.3
2 2 2.9 39.5
2 3 3.5 49.5
3 3 5.4 68.5
4 1 6.4 79.8
4 2 7.1 89.9
4 3 6.5 78.5
5 2 2.9 34.35
PRODUCERS
PROCUREMENT
PRODUCERS_PROCUREMENT
NIC Wayanad 46
Second Normal Form (2NF)
Move repeating fields into a new table that contains a primary key
and relate it back to the old table using a foreign key
PRODUCERS
•The table must be in 1NF
•Creates many-to-one relationship,
separating static from dynamic information
ProducerID ProducerName Place
1 JOSEPH V.V KALPETTA
2 VELIYAN.V MEPPADI
3 JOHN.P.J KALPETA
4 POULOSE. M M BATHERY
5 JOSEPH.E.S PULPALLY
NIC Wayanad 47
Second Normal Form (2NF)
ProducerID Day Qty Value
1 1 1.2 15.25
1 3 1.9 22.5
2 1 2.4 36.3
2 2 2.9 39.5
2 3 3.5 49.5
3 3 5.4 68.5
4 1 6.4 79.8
4 2 7.1 89.9
4 3 6.5 78.5
5 2 2.9 34.35
PlaceID Place
1 MEPPADI
2 VYTHIRI
3 BATHERY
4 KALPETTA
5 PULPALLY
ProducerID ProducerName Placeid
1 JOSEPH V.V 4
2 VELIYAN.V 1
3 JOHN.P.J 4
4 POULOSE. M M 3
5 JOSEPH.E.S 5
ProducerID ProducerNamePlace
1 JOSEPH V.V KALPETTA
2 VELIYAN.V MEPPADI
3 JOHN.P.J KALPETTA
4 POULOSE. M MBATHERY
5 JOSEPH.E.S PULPALLY
Before
After
ProducerID Day Qty Value
1 1 1.2 15.25
1 3 1.9 22.5
2 1 2.4 36.3
2 2 2.9 39.5
2 3 3.5 49.5
3 3 5.4 68.5
4 1 6.4 79.8
4 2 7.1 89.9
4 3 6.5 78.5
5 2 2.9 34.35
NIC Wayanad 48
Third Normal form (3NF)
PRODUCERS
DEPOT
DepotID Name
1 OFFICE
2 VADUVANA
3 ANDOOR
4 PAMBALA
5 KADALMADU
6 MUNNOORE
ProducerID ProducerName DepotID
1 JOSEPH V.V 1
2 VELIYAN.V 3
3 JOHN.P.J 2
4 POULOSE. M M 2
5 JOSEPH.E.S 2
6 ACHANKUNHU N G 1
7 VARKY.M.M 1
8 MATHAI.M.M 5
9 APPACHAN.P.V 5
10 ISSAC.M.M 1
11 RAJU.P.T 2
Before
After
ProducerIDProducerName
1 JOSEPH V.V
2 VELIYAN.V
3 JOHN.P.J
4 POULOSE. M M
5 JOSEPH.E.S
6 ACHANKUNHU N G
DepotID Name
1 OFFICE
2 VADUVANA
3 ANDOOR
4 PAMBALA
5 KADALMADU
6 MUNNOORE
DEPOTPRODUCERS
ProducerID DepotID
1 2
2 3
3 1
4 1
5 4
6 1
7 2
PROD_DEPOT
NIC Wayanad 49
Why Denormalization.,,,
 Higher degrees on normalization….
 involve more tables
 need for a larger number of joins
 can reduce performance
NIC Wayanad 50
Database transaction
 is a unit of interaction with a DBMS
 is a series of database operations which either
all occur, or all do not occur (Atomic)
 are also called Logical Units of Work.
 a database system will guarantee the
properties of ACID for each transaction.
NIC Wayanad 51
ACID
 Atomicity:
 Either all the tasks in a transaction
must be done, or none of them.
 The transaction must be completed, or
else it must be undone (rolled back).
 Consistency:
 Every transaction must preserve the
integrity constraints — the declared
consistency rules — of the database.
NIC Wayanad 52
ACID
 Isolation:
 Two simultaneous transactions cannot
interfere with one another.
 Intermediate results within a
transaction are not visible to other
transactions.
 Durability:
 Completed transactions cannot be
aborted later or their results discarded.
NIC Wayanad 53
Operating system support
RDBMS
Windows
  
Mac OS 
X  
Linux   BSD   UNIX  
4th Dimension Yes Yes No No No
Adabas Yes No Yes No Yes
Adaptive Server
Enterprise Yes Yes Yes Yes Yes
Apache Derby 2
Yes Yes Yes Yes Yes
DB2 Yes No Yes No Yes
Firebird Yes Yes Yes Yes Yes
HSQLDB 2
Yes Yes Yes Yes Yes
H2 2
Yes Yes Yes Yes Yes
Informix Yes Yes Yes Yes Yes
Ingres Yes No Yes Yes Yes
InterBase
Yes No Yes No
Yes
(Solaris)
MaxDB Yes No Yes No Yes
Microsoft SQL Server Yes No No No No
MonetDB Yes Yes Yes No Yes
MySQL Yes Yes Yes Yes Yes
Oracle Yes Yes Yes No Yes
OpenEdge Yes No Yes No Yes
OpenLink Virtuoso Yes Yes Yes Yes Yes
PostgreSQL Yes Yes Yes Yes Yes
Pyrrho DBMS
Yes
(.NET) No
Yes
(Mono) No No
SmallSQL 2
Yes Yes Yes Yes Yes
SQL Anywhere Yes Yes Yes No Yes
SQLite Yes Yes Yes Yes Yes
Teradata Yes No Yes No Yes
Valentina Yes Yes Yes No No
NIC Wayanad 54
To Be Discussed
 SQL in detail…
 Security
 User Accounts
 Backup / replication
 Data warehousing
 Data mining
NIC Wayanad 55
END

More Related Content

What's hot

Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization emailharmeet
 
Dbms classification according to data models
Dbms classification according to data modelsDbms classification according to data models
Dbms classification according to data modelsABDUL KHALIQ
 
Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1Junaid Nadeem
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management SystemAjay Jha
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
Codd's rules
Codd's rulesCodd's rules
Codd's rulesMohd Arif
 
Database Keys & Relationship
Database Keys & RelationshipDatabase Keys & Relationship
Database Keys & RelationshipBellal Hossain
 
Database systems
Database systemsDatabase systems
Database systemsDhani Ahmad
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sqlzahid6
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modelingoudesign
 

What's hot (20)

Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Dbms classification according to data models
Dbms classification according to data modelsDbms classification according to data models
Dbms classification according to data models
 
Different data models
Different data modelsDifferent data models
Different data models
 
Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
 
Dimensional Modelling
Dimensional ModellingDimensional Modelling
Dimensional Modelling
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Dbms and sqlpptx
Dbms and sqlpptxDbms and sqlpptx
Dbms and sqlpptx
 
Data models
Data modelsData models
Data models
 
Codd's rules
Codd's rulesCodd's rules
Codd's rules
 
Database Keys & Relationship
Database Keys & RelationshipDatabase Keys & Relationship
Database Keys & Relationship
 
Types of keys dbms
Types of keys dbmsTypes of keys dbms
Types of keys dbms
 
Sql Server Basics
Sql Server BasicsSql Server Basics
Sql Server Basics
 
RDBMS
RDBMSRDBMS
RDBMS
 
Database Chapter 1
Database Chapter 1Database Chapter 1
Database Chapter 1
 
Database systems
Database systemsDatabase systems
Database systems
 
Data warehousing
Data warehousingData warehousing
Data warehousing
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modeling
 
Dbms models
Dbms modelsDbms models
Dbms models
 

Viewers also liked

Normalization i i
Normalization   i iNormalization   i i
Normalization i iGagan Deep
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- FundamentalsMohammed El Hedhly
 
Sql server ___________session_1-intro
Sql server  ___________session_1-introSql server  ___________session_1-intro
Sql server ___________session_1-introEhtisham Ali
 
Application development with Oracle NoSQL Database 3.0
Application development with Oracle NoSQL Database 3.0Application development with Oracle NoSQL Database 3.0
Application development with Oracle NoSQL Database 3.0Anuj Sahni
 
Database Concurrency
Database ConcurrencyDatabase Concurrency
Database Concurrencyndndsk
 
Bsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalizationBsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalizationRai University
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalizationdaxesh chauhan
 
protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency controlMOHIT DADU
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesJafar Nesargi
 
Er diagram practical examples
Er diagram practical examplesEr diagram practical examples
Er diagram practical examplesRahul Khanwani
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFOum Saokosal
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency controlDhani Ahmad
 
Chapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementChapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementEddyzulham Mahluzydde
 

Viewers also liked (20)

Normalization i i
Normalization   i iNormalization   i i
Normalization i i
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- Fundamentals
 
Rdbms concepts
Rdbms conceptsRdbms concepts
Rdbms concepts
 
Sql server ___________session_1-intro
Sql server  ___________session_1-introSql server  ___________session_1-intro
Sql server ___________session_1-intro
 
Application development with Oracle NoSQL Database 3.0
Application development with Oracle NoSQL Database 3.0Application development with Oracle NoSQL Database 3.0
Application development with Oracle NoSQL Database 3.0
 
RDBMS concepts
RDBMS conceptsRDBMS concepts
RDBMS concepts
 
Dbms new manual
Dbms new manualDbms new manual
Dbms new manual
 
Database Concurrency
Database ConcurrencyDatabase Concurrency
Database Concurrency
 
Bsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalizationBsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalization
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
 
protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency control
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
 
Normalization
NormalizationNormalization
Normalization
 
Er diagram practical examples
Er diagram practical examplesEr diagram practical examples
Er diagram practical examples
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency control
 
Chapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementChapter 5 Database Transaction Management
Chapter 5 Database Transaction Management
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 

Similar to Relational Database Fundamentals

MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresSteven Johnson
 
Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22Martin Bém
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Modeloudesign
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational modelChirag vasava
 
LSC - Synchronizing identities @ Loadays 2010
LSC - Synchronizing identities @ Loadays 2010LSC - Synchronizing identities @ Loadays 2010
LSC - Synchronizing identities @ Loadays 2010Jonathan Clarke
 
LSC - Synchronizing identities @ Loadays 2010
 LSC - Synchronizing identities @ Loadays 2010 LSC - Synchronizing identities @ Loadays 2010
LSC - Synchronizing identities @ Loadays 2010RUDDER
 
Database Introduction by Luke Lonergan
Database Introduction by Luke LonerganDatabase Introduction by Luke Lonergan
Database Introduction by Luke LonerganLuke Lonergan
 
Sustainable queryable access to Linked Data
Sustainable queryable access to Linked DataSustainable queryable access to Linked Data
Sustainable queryable access to Linked DataRuben Verborgh
 

Similar to Relational Database Fundamentals (20)

Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Intro
IntroIntro
Intro
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome Measures
 
Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
 
DISE - Database Concepts
DISE - Database ConceptsDISE - Database Concepts
DISE - Database Concepts
 
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTSThe Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
 
Graph db
Graph dbGraph db
Graph db
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
Rdbms
RdbmsRdbms
Rdbms
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
E-R diagram & SQL
E-R diagram & SQLE-R diagram & SQL
E-R diagram & SQL
 
RDBMS_Concept.ppt
RDBMS_Concept.pptRDBMS_Concept.ppt
RDBMS_Concept.ppt
 
LSC - Synchronizing identities @ Loadays 2010
LSC - Synchronizing identities @ Loadays 2010LSC - Synchronizing identities @ Loadays 2010
LSC - Synchronizing identities @ Loadays 2010
 
LSC - Synchronizing identities @ Loadays 2010
 LSC - Synchronizing identities @ Loadays 2010 LSC - Synchronizing identities @ Loadays 2010
LSC - Synchronizing identities @ Loadays 2010
 
Database Introduction by Luke Lonergan
Database Introduction by Luke LonerganDatabase Introduction by Luke Lonergan
Database Introduction by Luke Lonergan
 
Sustainable queryable access to Linked Data
Sustainable queryable access to Linked DataSustainable queryable access to Linked Data
Sustainable queryable access to Linked Data
 
ch2
ch2ch2
ch2
 
Database 2018
Database 2018Database 2018
Database 2018
 

Recently uploaded

DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etclalithasri22
 
prediction of default payment next month using a logistic approach
prediction of default payment next month using a logistic approachprediction of default payment next month using a logistic approach
prediction of default payment next month using a logistic approachAdekunleJoseph4
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfnikeshsingh56
 
Data Discovery With Power Query in excel
Data Discovery With Power Query in excelData Discovery With Power Query in excel
Data Discovery With Power Query in excelKapilSidhpuria3
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...Dr Arash Najmaei ( Phd., MBA, BSc)
 
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...ThinkInnovation
 
Adobe Scan 06-Mar-2024 (1).pdfwvsbbsbsba
Adobe Scan 06-Mar-2024 (1).pdfwvsbbsbsbaAdobe Scan 06-Mar-2024 (1).pdfwvsbbsbsba
Adobe Scan 06-Mar-2024 (1).pdfwvsbbsbsbas73678sri
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...Jack Cole
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfNicoChristianSunaryo
 
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j
 
testingsdadadadaaddadadadadadadadaad.pdf
testingsdadadadaaddadadadadadadadaad.pdftestingsdadadadaaddadadadadadadadaad.pdf
testingsdadadadaaddadadadadadadadaad.pdfDSP Mutual Fund
 
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfRabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j
 
Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformationAnnie Melnic
 
Inference rules in artificial intelligence
Inference rules in artificial intelligenceInference rules in artificial intelligence
Inference rules in artificial intelligencePriyadharshiniG41
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Boston Institute of Analytics
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaManalVerma4
 

Recently uploaded (20)

DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etc
 
prediction of default payment next month using a logistic approach
prediction of default payment next month using a logistic approachprediction of default payment next month using a logistic approach
prediction of default payment next month using a logistic approach
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdf
 
Data Discovery With Power Query in excel
Data Discovery With Power Query in excelData Discovery With Power Query in excel
Data Discovery With Power Query in excel
 
Insurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis ProjectInsurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis Project
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
 
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
 
Adobe Scan 06-Mar-2024 (1).pdfwvsbbsbsba
Adobe Scan 06-Mar-2024 (1).pdfwvsbbsbsbaAdobe Scan 06-Mar-2024 (1).pdfwvsbbsbsba
Adobe Scan 06-Mar-2024 (1).pdfwvsbbsbsba
 
Data Analysis Project: Stroke Prediction
Data Analysis Project: Stroke PredictionData Analysis Project: Stroke Prediction
Data Analysis Project: Stroke Prediction
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdf
 
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
 
testingsdadadadaaddadadadadadadadaad.pdf
testingsdadadadaaddadadadadadadadaad.pdftestingsdadadadaaddadadadadadadadaad.pdf
testingsdadadadaaddadadadadadadadaad.pdf
 
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfRabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
 
Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformation
 
2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use
 
Inference rules in artificial intelligence
Inference rules in artificial intelligenceInference rules in artificial intelligence
Inference rules in artificial intelligence
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in India
 

Relational Database Fundamentals

  • 1. RDBMS Concepts – Part I Khalidc2001@gmail.com
  • 2. NIC Wayanad 2 We Discuss…  What is a database  RDBMS Concepts  Relational Model  Entity – Relationship Model  Relationships  Constraints  Keys  Normalization  Transaction Control
  • 3. NIC Wayanad 3 What is a database ?  A database is an organized collection of information  To manage databases, you need database management systems (DBMS)
  • 4. NIC Wayanad 4 DBMS  A collection of programs that enables you to store, modify, and extract information from a database.  A computer program designed for the purpose of managing database
  • 5. NIC Wayanad 5 Type of databases  Four main types of databases  Hierarchical  Network  Relational  Object Relational
  • 6. NIC Wayanad 6 Relational Database Concept  Dr. E.F.Codd proposed the relational model for database system in 1970.  It is the basis for the relational database management system (RDBMS)
  • 7. NIC Wayanad 7 Relational Database Model  Uses tables to organize data  Each table corresponds to an entity  Each row represents the instance of that entity  Tables can be related each other • Relation=Table • Tuple=Row • Attribute=Column
  • 8. NIC Wayanad 8 RDBMS  Fundamental Features  ACID  Referential Integrity  Transactions  Unicode  other objects are supported  Data Domain  Cursor  Trigger  Function  Procedure  Database Capabilites  Union  Inner joins  Outer joins  Inner selects  Merge  Blobs
  • 9. NIC Wayanad 9 Databases in marketRDBMS Maintainer   Software license   4th Dimension 4D s.a.s Proprietary Adabas Software AG ? Adaptive Server Enterprise Sybase Proprietary Apache Derby Apache Apache License DB2 IBM Proprietary DBISAM Elevate Software Proprietary ElevateDB Elevate Software Proprietary Firebird Firebird project IPL and IDPL Informix IBM Proprietary HSQLDB HSQL Development Group BSD H2 H2 Software Freeware Ingres Ingres Corp. GPL and proprietary InterBase CodeGear Proprietary MaxDB MySQL AB, SAP AG GPL or proprietary Microsoft SQL Server Microsoft Proprietary MonetDB The MonetDB Developer Team MonetDB Public License v1.1 MySQL MySQL AB GPL or proprietary HP NonStop SQL Hewlett-Packard Proprietary Oracle Oracle Corporation Proprietary Oracle Rdb Oracle Corporation Proprietary OpenEdge Progress Software Corporation Proprietary OpenLink Virtuoso OpenLink Software GPL or proprietary Pervasive PSQL Pervasive Software Proprietary PostgreSQL PostgreSQL Global Development Group BSD Pyrrho DBMS University of Paisley Proprietary SmallSQL SmallSQL LGPL SQL Anywhere Sybase Proprietary SQLite D. Richard Hipp Public domain Teradata Teradata Proprietary Valentina Paradigma Software Proprietary
  • 10. NIC Wayanad 10 Relational Model Three key terms are used extensively in relational models  Relation • relation is a table with columns and rows  Attributes • The named columns of the relation are called attributes  Domains • set of values the attributes are allowed to take
  • 11. NIC Wayanad 11 Relational Model ProducerID ProducerName Place Sex Caste DateBirth 1 BALAKRISHNAN.P.K VATTOLI BAZAR M GEN 2 VASUDEVAN NAMBIAR BALUSSERY M GEN 01/07/1948 3 HARIDASAN.M KARIYATHANKAVU M GEN 11/05/1962 4 ASIYA.N.K VATTOLI BAZAR F OBC 5 VELU VATTOLI BAZAR M OBC 02/10/1947 6 KELUKUTTI NAIR. P VATTOLI BAZAR M GEN 7 ROHINI. V.K VATTOLI BAZAR F GEN 01/07/1933 8 SURESH BABU.K.R KARIYATHANKAVU M ST 9 KUTTINARAYANAN NAIR VATTOLI BAZAR M GEN 07/10/1971 Tuple 10 LAKSHMI.T.P VATTOLI BAZAR F GEN 11 ABUBAKKAR. M KAPPURAM M OBC 22/04/1959 12 RAJAN NAIR.O.K KARIYATHANKAVU M GEN 15/11/1956 13 PRABAKARAN NAIR.K.K VATTOLI BAZAR M GEN 14 BALAN.K.P VATTOLI BAZAR M SC 25/09/1967 Domain •A relation has a unique name and represents particular entity •Each row of a relation referred to as a tuple •A Key is a part of tuple that uniquely distinguishes from other tuples •relation is a set of tuples
  • 12. NIC Wayanad 12 Data Modelling Database Server Model of system in clients’s mind ER Model of Client’s model Table model of ER model Tables on disk
  • 13. Analysis StageAnalysis Stage  Identifies::  entitiesentities - things of significance- things of significance  relationshipsrelationships - associations between entities- associations between entities  functionsfunctions - processes in the business- processes in the business  businessbusiness rulesrules - restrictions or constraints- restrictions or constraints  Does NOT identify tables, views, files, screens, reports, or other computer-specific items...
  • 14. NIC Wayanad 14 Entity – Relationship Model  It facilitates communication between the database designer and the end user during the requirement analysis.  To facilitate such communication the designer needs adequate communication tools
  • 15. NIC Wayanad 15 Basic Elements of ER Model  Entity • An entity defines any person, place, thing or concept • Eg : (Producer, Taluk, Course)  Attribute • Characteristics (properties) of an entity • Eg: (ProducerName, MemberID, HouseName)  Relationship • Logical linkage between two entities
  • 16. NIC Wayanad 16 ER Diagram
  • 17. NIC Wayanad 17 Let us model  A Depot is a place where Producers pours their cow milk  A Producer is a person who belongs to a Depot and regularly pours Milk to Society  A Collection Agent, who procures Milk from Producers through Depot.  Procurement Register maintains by Collection Agent with the details of Milk poured by Producers  A Member is a Producer, who gets Membership through board resolution.
  • 18. NIC Wayanad 18 ER Model - Entities  The highlighted words becomes entity  Entities are represented by rectangular box DepotDepot ProducersProducers MembersMembers Collection AgentCollection Agent Procurement RegisterProcurement Register
  • 19. NIC Wayanad 19 ER Model - Attributes  Attributes are the properties of entities  Provides additional information about entity  Possible attributes for each entity  Depot : DepotID, Name, DateStart  Producers : Name, Address, DateofBirth, Sex, Caste and MemberID etc  Collection Agent : Name, Address  Members: MemberID, Date of Admission, Share Value  Procurement Register: ProducerID, Date, Time, MilkQty, Milk Value
  • 20. NIC Wayanad 20 Relationships  A relationship is an association between two or more entities  Each entity in a relationship plays a role  Examples:  if we are identifying relationships between DEPOT and PRODUCER, then we might define the “pours”, “Belongs to”
  • 21. NIC Wayanad 21 ER Model - Entities DepotDepot DepotIDDepotID NameName AddressAddress ProducersProducers ProducerNameProducerName AddressAddress SexSex CasteCaste PhonePhone MemberIDMemberID DateofJoinDateofJoin MembersMembers MemberIDMemberID DateofAdmissionDateofAdmission ShareNosShareNos ShareValueShareValue DateOfBirthDateOfBirth IDCardNoIDCardNo Proc_RegProc_Reg ProducerIDProducerID DateDate TimeTime MilkQtyMilkQty CLRCLR FATFAT SNFSNF MilkValueMilkValue Collection_AgentCollection_Agent AgentIDAgentID NameName AddressAddress DepotDepot DepotID Name Address
  • 22. NIC Wayanad 22 ER Model - Relationships  Logical linkage between two entities  A relationship connects two or more entity sets  Relationships are represented by diamond shape box
  • 24. NIC Wayanad 24 Constraints….  are rules that describe what valid data look like  ensure the logical and semantic consistency  Rules used to ensure accuracy and integrity of data
  • 26. NIC Wayanad 26 PRIMARY KEY Constraints  primary key is a candidate key to uniquely identify each row in a table . PCODE PANCH_NAME 01 KANIAMBETTA 02 KOTTATHARA 03 MEPPADI 04 MUTTIL 05 PADINJARETHARA
  • 27. NIC Wayanad 27 PRIMARY KEY Constraints  Defining PRIMARY KEY CREATE TABLE Depot (DepotID INT, DepotName VARCHAR(20), CONSTRAINT dep_pk PRIMARY KEY(DepotID))  Add a PRIMARY KEY to an existing table ALTER TABLE Depot ADD CONSTRAINT pk_dep PRIMARY KEY (DepotID)
  • 28. NIC Wayanad 28 FOREIGN KEY Constraints  Foreign key: a field in a table that is a primary key in another table  Foreign key creates a relationship between the two tables  Enforces referential integrity  Maps to the PRIMARY KEY in parent table DepotID Name 1 OFFICE 2 VADUVANA 3 ANDOOR 4 PAMBALA 5 KADALMADU 6 MUNNOORE ProducerID ProducerName DepotID 1 JOSEPH V.V 1 2 VELIYAN.V 3 3 JOHN.P.J 2 4 POULOSE. M M 2 5 JOSEPH.E.S 2 6 ACHANKUNHU N G 1 7 VARKY.M.M 1 8 MATHAI.M.M 5 9 APPACHAN.P.V 5 10 ISSAC.M.M 1 11 RAJU.P.T 2 Parent Table (FK) (PK)
  • 29. NIC Wayanad 29 FOREIGN KEY Constraints..  Defining a FOREIGN KEY CREATE TABLE Depot(DepotID INT PRIMARY KEY,DepotName VARCHAR(20) NOT NULL); CREATE TABLE Producers(ProducerID INT,ProducerName VARCHAR(50) NOT NULL,DepotID INT, CONSTRAINT pk_Prod PRIMARY KEY(ProducerID),CONSTRAINT fk_prod FOREIGN KEY(DepotID) REFERENCES Depot(DepotID) );  Add a FOREIGN KEY to an existing table ALTER TABLE Producers ADD CONSTRAINT fk_Prod FOREIGN KEY (DepotID) REFERENCES Depot(DepotID)
  • 30. NIC Wayanad 30 UNIQUE KEY Constraints  No duplicates allowed in referenced column  NULL values are permitted ProducerID ProducerName DepotID MemberID 1 JOSEPH V.V 1 2 VELIYAN.V 3 245 3 JOHN.P.J 2 4 POULOSE. M M 2 5 JOSEPH.E.S 2 6 ACHANKUNHU N G 1 154 7 VARKY.M.M 1 8 MATHAI.M.M 5 453 9 APPACHAN.P.V 5 10 ISSAC.M.M 1 12 11 RAJU.P.T 2 CREATE TABLE Producers(ProducerID INT PRIMARY KEY,ProducerName VARCHAR(50) NOT NULL,DepotID INT,MemberID INT UNIQUE,CONSTRAINT fk_prd1 FOREIGN KEY(DepotID) REFERENCES Depot(DepotID))
  • 31. NIC Wayanad 31 CHECK Constraints  ensure valid data when adding or updating an entry in a table ProducerID ProducerName Sex DateJoin DateBirth ShareValue 1 JOSEPH V.V M 01/04/2001 11/04/1965 10 2 VELIYAN.V M 15/06/2007 12/09/1954 10 3 JOHN.P.J M 19/04/2003 08/05/1946 10 4 POULOSE. M M M 24/03/1997 10/05/1964 10 5 ANNAMMA F 26/07/2004 17/08/1959 10 6 ACHANKUNHU N G M 04/09/1992 18/07/1961 10 7 VARKY.M.M M 08/07/1991 19/03/1942 20 8 MATHAI.M.M M 17/08/1987 22/05/1938 10 M or F Date Join > Date Birth >0CHECK Constraints --> CREATE TABLE Producers(ProducerID INT ……,CONSTRAINT check_Sex CHECK(Sex=‘M’ OR ‘F’),CONSTRAINT chk_share CHECK(ShareValue>0))
  • 32. NIC Wayanad 32 NOT NULL Constraints  Ensures that a specified column cannot contain a Null Value CREATE TABLE Depot(DepotID INT PRIMARY KEY,DepotName VARCHAR(20) NOT NULL); DepotID Name 1 OFFICE 2 VADUVANA 3 ANDOOR 4 PAMBALA 5 KADALMADU 6 MUNNOORE DepotID Name 1 OFFICE 2 VADUVANA 3 ANDOOR 4 PAMBALA 5 6 MUNNOORE Violation against NOT NULL
  • 33. NIC Wayanad 33 Surrogate key  A surrogate key in a database is a unique identifier  surrogate key is not derived from application data  A surrogate key may be used as the primary key  some possible candidates for generating surrogates:  Globally Unique Identifiers (GUIDs)  Object Identifiers (OIDs)  Sybase or SQL Server identity column  Oracle SEQUENCE  PostgreSQL serial  MySQL AUTO_INCREMENT  MS Access AUTONUMBER
  • 34. NIC Wayanad 34 Relationships The following relationships can be included in an E-R Model:  One-to-one  One-to-many  Many-to-many
  • 35. NIC Wayanad 35 One-to-one Relationship  Each occurrence (row) of data in one entity is related to only one occurrence of data in the other entity  Example: Each Producer has just one MemberID and each MemberID is assigned to just one Producer ProducerID ProducerName DepotID MemberID 1 JOSEPH V.V 1 5 2 VELIYAN.V 3 26 3 JOHN.P.J 2 4 POULOSE. M M 2 125 5 JOSEPH.E.S 2 110 6 ACHANKUNHU N G 1 12 7 VARKY.M.M 1 35 8 MATHAI.M.M 5 9 APPACHAN.P.V 5 10 ISSAC.M.M 1 11 RAJU.P.T 2 2 MemberID DateAdmit ShareValue 2 12/04/1987 10.00 5 12/04/1987 10.00 12 25/07/1988 10.00 26 25/09/1988 20.00 35 12/08/1997 10.00 110 02/12/2000 10.00 125 16/08/1998 10.00 PRODUCERS MEMBERS
  • 36. NIC Wayanad 36 One-to-many Relationship  Each occurrence of data in one entity can be represented by many occurrences of the data in the other entity  Example: each Depot carries many producers PRODUCERS DEPOT DepotID Name 1 OFFICE 2 VADUVANA 3 ANDOOR 4 PAMBALA 5 KADALMADU 6 MUNNOORE ProducerID ProducerName DepotID 1 JOSEPH V.V 1 2 VELIYAN.V 3 3 JOHN.P.J 2 4 POULOSE. M M 2 5 JOSEPH.E.S 2 6 ACHANKUNHU N G 1 7 VARKY.M.M 1 8 MATHAI.M.M 5 9 APPACHAN.P.V 5 10 ISSAC.M.M 1 11 RAJU.P.T 2
  • 37. NIC Wayanad 37 Many-to-many Relationship  Data can have multiple occurrences in both entities  In a proper design, this can’t be included in the physical database
  • 38. NIC Wayanad 38 ER Diagram of
  • 40. NIC Wayanad 40 Normalization  ..is a process you can use to split out non-relational tables into relational tables.  ..is a technique for designing relational database tables to minimize duplication of information  .. is to safeguard the database against data anomalies
  • 41. NIC Wayanad 41 Bad Design  Update anomaly Employee 519 is shown as having different addresses on different records.
  • 42. NIC Wayanad 42 Bad Design  Insertion anomaly Until the new faculty member is assigned to teach at least one course, his details cannot be recorded.
  • 43. NIC Wayanad 43 Bad Design  Deletion anomaly All information about Dr. Giddens is lost when he temporarily ceases to be assigned to any courses.
  • 44. NIC Wayanad 44 First Normal Form (1NF) Remove repeating columns by creating new table moving the columns into the new table, and linking back to the old table in a on-to-many relationship. ProducerID ProducerName Address Day1Qty Day1Value Day2Qty Day2Value Day3Qty Day3Value 1 JOSEPH V.V KALPETTA 1.2 15.25 1.9 22.5 2 VELIYAN.V MEPPADI 2.4 36.3 2.9 39.5 3.5 49.5 3 JOHN.P.J KALPETTA 5.4 68.5 4 POULOSE. M M BATHERY 6.4 79.8 7.1 89.9 6.5 78.5 5 JOSEPH.E.S PULPALLY . 2.9 34.35 PRODUCERS_PROCUREMENT •To Eliminate repeating groups
  • 45. NIC Wayanad 45 First Normal Form (1NF) ProducerID ProducerName Address Day1Qty Day1Value Day2Qty Day2Value Day3Qty Day3Value 1 JOSEPH V.V KALPETTA 1.2 15.25 1.9 22.5 2 VELIYAN.V MEPPADI 2.4 36.3 2.9 39.5 3.5 49.5 3 JOHN.P.J KALPETTA 5.4 68.5 4 POULOSE. MM BATHERY 6.4 79.8 7.1 89.9 6.5 78.5 5 JOSEPH.E.S PULPALLY . 2.9 34.35 Before After ProducerID ProducerName Address 1 JOSEPH V.V KALPETTA 2 VELIYAN.V MEPPADI 3 JOHN.P.J KALPETTA 4 POULOSE. M M BATHERY 5 JOSEPH.E.S PULPALLY ProducerID Day Qty Value 1 1 1.2 15.25 1 3 1.9 22.5 2 1 2.4 36.3 2 2 2.9 39.5 2 3 3.5 49.5 3 3 5.4 68.5 4 1 6.4 79.8 4 2 7.1 89.9 4 3 6.5 78.5 5 2 2.9 34.35 PRODUCERS PROCUREMENT PRODUCERS_PROCUREMENT
  • 46. NIC Wayanad 46 Second Normal Form (2NF) Move repeating fields into a new table that contains a primary key and relate it back to the old table using a foreign key PRODUCERS •The table must be in 1NF •Creates many-to-one relationship, separating static from dynamic information ProducerID ProducerName Place 1 JOSEPH V.V KALPETTA 2 VELIYAN.V MEPPADI 3 JOHN.P.J KALPETA 4 POULOSE. M M BATHERY 5 JOSEPH.E.S PULPALLY
  • 47. NIC Wayanad 47 Second Normal Form (2NF) ProducerID Day Qty Value 1 1 1.2 15.25 1 3 1.9 22.5 2 1 2.4 36.3 2 2 2.9 39.5 2 3 3.5 49.5 3 3 5.4 68.5 4 1 6.4 79.8 4 2 7.1 89.9 4 3 6.5 78.5 5 2 2.9 34.35 PlaceID Place 1 MEPPADI 2 VYTHIRI 3 BATHERY 4 KALPETTA 5 PULPALLY ProducerID ProducerName Placeid 1 JOSEPH V.V 4 2 VELIYAN.V 1 3 JOHN.P.J 4 4 POULOSE. M M 3 5 JOSEPH.E.S 5 ProducerID ProducerNamePlace 1 JOSEPH V.V KALPETTA 2 VELIYAN.V MEPPADI 3 JOHN.P.J KALPETTA 4 POULOSE. M MBATHERY 5 JOSEPH.E.S PULPALLY Before After ProducerID Day Qty Value 1 1 1.2 15.25 1 3 1.9 22.5 2 1 2.4 36.3 2 2 2.9 39.5 2 3 3.5 49.5 3 3 5.4 68.5 4 1 6.4 79.8 4 2 7.1 89.9 4 3 6.5 78.5 5 2 2.9 34.35
  • 48. NIC Wayanad 48 Third Normal form (3NF) PRODUCERS DEPOT DepotID Name 1 OFFICE 2 VADUVANA 3 ANDOOR 4 PAMBALA 5 KADALMADU 6 MUNNOORE ProducerID ProducerName DepotID 1 JOSEPH V.V 1 2 VELIYAN.V 3 3 JOHN.P.J 2 4 POULOSE. M M 2 5 JOSEPH.E.S 2 6 ACHANKUNHU N G 1 7 VARKY.M.M 1 8 MATHAI.M.M 5 9 APPACHAN.P.V 5 10 ISSAC.M.M 1 11 RAJU.P.T 2 Before After ProducerIDProducerName 1 JOSEPH V.V 2 VELIYAN.V 3 JOHN.P.J 4 POULOSE. M M 5 JOSEPH.E.S 6 ACHANKUNHU N G DepotID Name 1 OFFICE 2 VADUVANA 3 ANDOOR 4 PAMBALA 5 KADALMADU 6 MUNNOORE DEPOTPRODUCERS ProducerID DepotID 1 2 2 3 3 1 4 1 5 4 6 1 7 2 PROD_DEPOT
  • 49. NIC Wayanad 49 Why Denormalization.,,,  Higher degrees on normalization….  involve more tables  need for a larger number of joins  can reduce performance
  • 50. NIC Wayanad 50 Database transaction  is a unit of interaction with a DBMS  is a series of database operations which either all occur, or all do not occur (Atomic)  are also called Logical Units of Work.  a database system will guarantee the properties of ACID for each transaction.
  • 51. NIC Wayanad 51 ACID  Atomicity:  Either all the tasks in a transaction must be done, or none of them.  The transaction must be completed, or else it must be undone (rolled back).  Consistency:  Every transaction must preserve the integrity constraints — the declared consistency rules — of the database.
  • 52. NIC Wayanad 52 ACID  Isolation:  Two simultaneous transactions cannot interfere with one another.  Intermediate results within a transaction are not visible to other transactions.  Durability:  Completed transactions cannot be aborted later or their results discarded.
  • 53. NIC Wayanad 53 Operating system support RDBMS Windows    Mac OS  X   Linux   BSD   UNIX   4th Dimension Yes Yes No No No Adabas Yes No Yes No Yes Adaptive Server Enterprise Yes Yes Yes Yes Yes Apache Derby 2 Yes Yes Yes Yes Yes DB2 Yes No Yes No Yes Firebird Yes Yes Yes Yes Yes HSQLDB 2 Yes Yes Yes Yes Yes H2 2 Yes Yes Yes Yes Yes Informix Yes Yes Yes Yes Yes Ingres Yes No Yes Yes Yes InterBase Yes No Yes No Yes (Solaris) MaxDB Yes No Yes No Yes Microsoft SQL Server Yes No No No No MonetDB Yes Yes Yes No Yes MySQL Yes Yes Yes Yes Yes Oracle Yes Yes Yes No Yes OpenEdge Yes No Yes No Yes OpenLink Virtuoso Yes Yes Yes Yes Yes PostgreSQL Yes Yes Yes Yes Yes Pyrrho DBMS Yes (.NET) No Yes (Mono) No No SmallSQL 2 Yes Yes Yes Yes Yes SQL Anywhere Yes Yes Yes No Yes SQLite Yes Yes Yes Yes Yes Teradata Yes No Yes No Yes Valentina Yes Yes Yes No No
  • 54. NIC Wayanad 54 To Be Discussed  SQL in detail…  Security  User Accounts  Backup / replication  Data warehousing  Data mining