SlideShare a Scribd company logo
5
Most read
8
Most read
10
Most read
RDBMS
Relational Database Model
 E.F. Codd proposed the relational Model to model data in the form of relations or
tables
 Developed in 1970 by E.F. Codd, it became commercial
in the 80s.
 After designing the conceptual model of the Database using
ER diagram, we need to convert the conceptual model into a
relational model
 The relational data model is a foundational concept in
database management that organizes data into one or more
tables (or "relations") of rows and columns,
Cont..
 Data elements are stored in different tables made up of
rows and columns.
 A relational database consists of a collection of tables,
each of which is assigned a unique name. Consider a
relation STUDENT with attributes ROLL_NO, NAME,
ADDRESS, PHONE, and AGE
Cont..
Important Terminologies
 Attribute: Attributes are the properties that define an
entity.
 Relation Schema: A relation schema defines the structure of the
relation and represents the name of the relation with its attributes.
e.g.; STUDENT (ROLL_NO, NAME, ADDRESS, PHONE, and AGE) is the
relation schema for STUDENT. If a schema has more than 1 relation, it
is called Relational Schema.
 Tuple: Each row in the relation is known as a tuple.
 Relation Instance: The set of tuples of a relation at a particular
instance of time is called a relation instance.
 Degree: The number of attributes in the relation is known as the degree of
the relation. The STUDENT relation defined above has degree 5.
 Cardinality: The number of tuples in a relation is known as cardinality.
The STUDENT relation defined above has cardinality 4.
 Column: The column represents the set of values for a particular attribute.
The column ROLL_NO is extracted from the relation STUDENT.
 NULL Values: The value which is not known or unavailable is called a NULL
value. It is represented by blank space. e.g.; PHONE of STUDENT having
ROLL_NO 4 is NULL
Relation Key:
 These are basically the keys that are used to identify the rows uniquely or
also help in identifying tables. These are of the following types.
 Primary Key
 Candidate Key
 Super Key
 Foreign Key
 Alternate Key
 Composite Key
Candidate Key
 The minimal set of attributes that can uniquely identify a tuple is known as a
candidate key. For Example, STUD_NO in STUDENT relation.
 It is a minimal super key.
 It is a super key with no repeated data is called a candidate key.
 The minimal set of attributes that can uniquely identify a record.
 It must contain unique values.
 It can contain NULL values.
 Every table must have at least a single candidate key.
 A table can have multiple candidate keys but only one primary key.
 The value of the Candidate Key is unique and may be null for a tuple.
 There can be more than one candidate key in a relationship.
 The candidate key can be simple (having only one attribute) or composite as well.
student
Primary Key
 There can be more than one candidate key in relation out of which one can
be chosen as the primary key. For Example, STUD_NO, as well as
STUD_PHONE, are candidate keys for relation STUDENT but STUD_NO can be
chosen as the primary key(only one out of many candidate keys).
 It is a unique key.
 It can identify only one tuple (a record) at a time.
 It has no duplicate values, it has unique values.
 It cannot be NULL.
 Primary keys are not necessarily to be a single column; more than one column
can also be a primary key for a table.
 Ex-ROLL_NO is a primary key.
Rules For Defining the Primary Key
 Minimal: The primary key is composed of a minimum number of attributes
 Accessible: The primary key is used to check the ability to access and
interact with the database. The user must easily create, read or delete a
tuple using it.
syntax for creating the Primary Key
 CREATE TABLE EMPLOYEE (
 Employee_Id int NOT NULL PRIMARY KEY,
 Name varchar (200) NOT NULL,
 PAN_NO int NOT NULL
 Salary int NOT NULL
 Dept varchar (200) NOT NULL
 );
relational data model in DBMS AND KEYS.pptx
Super Key
 The set of attributes that can uniquely identify a tuple is known as
Super Key. For Example, STUD_NO, (STUD_NO, STUD_NAME), etc. A
super key is a group of single or multiple keys that identifies rows in a
table. It supports NULL values.
 Adding zero or more attributes to the candidate key generates the
super key.
 A candidate key is a super key but vice versa is not true.
 Super Key values may also be NULL.
relational data model in DBMS AND KEYS.pptx
Alternate Key
 The candidate key other than the primary key is called an alternate key
 All the keys which are not primary keys are called alternate keys.
 It is a secondary key.
 It contains two or more fields to identify two or more records.
Foreign Key
 If an attribute can only take the values which are present as values of some
other attribute, it will be a foreign key to the attribute to which it refers.
 It is a key it acts as a primary key in one table and it acts as
secondary key in another table.
 It combines two or more relations (tables) at a time.
 They act as a cross-reference between the tables.
 For example, DNO is a primary key in the DEPT table and a non-key in EMP
 It is maintaining refrential integrity.
 A foreign key is a column or a combination of columns in a table that
establishes a link between two tables in a relational database. It refers to the
primary key in another table
 The table with a foreign key is called a foreign table/child table/referencing
table
 The table with a primary key that is referenced by a foreign key is called
a primary table/parent table /referenced Table.
 A foreign key can be created during table creation using CREATE TABLE or it
can be added to a table later using ALTER TABLE statement
 The syntax to create a foreign key in CREATE TABLE statement is:
 CREATE TABLE table_name (
column1 datatype,
column2 datatype,
…,
CONSTRAINT fk_constraint_name FOREIGN KEY (column1, column2, …)
REFERENCES parent_table(column1, column2, …)
 );
Composite Key
 A table might not have a single column/attribute that uniquely identifies all
the records of a table. To uniquely identify rows of a table, a combination of
two or more columns/attributes can be used. It still can give duplicate values
in rare cases. So, we need to find the optimal set of attributes that can
uniquely identify rows in a table.
 It acts as a primary key if there is no primary key in a table
 Two or more attributes are used together to make a composite key .
 A composite key cannot be null.
SYNTAX
INSERT INTO TABLE
OUTPUT

More Related Content

What's hot (20)

PPTX
RDBMS
PriyangaRajaram
 
PDF
Database Indexes
Sperasoft
 
PDF
SQL Joins and Query Optimization
Brian Gallagher
 
PPTX
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
PPTX
Types of keys in database management system by Dr. Kamal Gulati
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
PPT
3. Relational Models in DBMS
koolkampus
 
PPTX
Integrity Constraints
madhav bansal
 
PPTX
Integrity Constraints
Megha yadav
 
PPTX
The Relational Database Model
Shishir Aryal
 
PPTX
DBMS Keys
Tarun Maheshwari
 
PPTX
Relational algebra ppt
GirdharRatne
 
PPT
20.SCHEDULES.ppt
AkhilNameirakpam
 
PPT
04 brute force
Hira Gul
 
PPT
DBMS Unit 2 ppt.ppt
PraveenS761061
 
PPTX
Introduction to database & sql
zahid6
 
PPT
3 Tier Architecture
Webx
 
PDF
NFA to DFA
Animesh Chaturvedi
 
PPTX
Graph representation
Tech_MX
 
PPTX
10 Ways To Abuse T-SQL
Tracy McKibben
 
Database Indexes
Sperasoft
 
SQL Joins and Query Optimization
Brian Gallagher
 
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
3. Relational Models in DBMS
koolkampus
 
Integrity Constraints
madhav bansal
 
Integrity Constraints
Megha yadav
 
The Relational Database Model
Shishir Aryal
 
DBMS Keys
Tarun Maheshwari
 
Relational algebra ppt
GirdharRatne
 
20.SCHEDULES.ppt
AkhilNameirakpam
 
04 brute force
Hira Gul
 
DBMS Unit 2 ppt.ppt
PraveenS761061
 
Introduction to database & sql
zahid6
 
3 Tier Architecture
Webx
 
NFA to DFA
Animesh Chaturvedi
 
Graph representation
Tech_MX
 
10 Ways To Abuse T-SQL
Tracy McKibben
 

Similar to relational data model in DBMS AND KEYS.pptx (20)

PPTX
RDBMS-1.pptx. best one this. Will help
ksrilakshmia8
 
PPTX
DBMS Structure of Relational Databases.pptx
ssuser19199c
 
PPTX
Relational database Management system.pptx
RevathiNCommerceCSCA
 
PDF
Advance database system (part 3)
Abdullah Khosa
 
PPTX
DBMS key topic Presentation slide 1.pptx
sonudhakad173
 
PPTX
The Relational Model
Bhandari Nawaraj
 
PPTX
Relational Model
Er. Nawaraj Bhandari
 
PPTX
Relational model
Dabbal Singh Mahara
 
PPTX
Types of keys in dbms
darshhingu
 
PPTX
keys of data base like as Super keys and others.
sajidraza88875
 
PPTX
Dbms keys
RUpaliLohar
 
PPTX
DBMS-Unit-2.pptx
Abhinayacheekati
 
PDF
Relational Database Model Database Management system
soalteepaudel
 
PPTX
Chapter-5 The Relational Data Model
Kunal Anand
 
PDF
computer-210809080138.pdf
rahulsharma571283
 
PPTX
xi ip rdbms.pptxsieiw9wiejrnejow929wiejemm
mk1227103
 
PPTX
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
satish7588
 
PPTX
Presentation OF DBMS-2.pptx
ShumailaSajjad
 
PPT
The Relational Model represents data and their relationships through a collec...
i211415ZoyaAli
 
PPTX
Lecture 2 - Relational Model and Terminology.pptx
MohamedShamil11
 
RDBMS-1.pptx. best one this. Will help
ksrilakshmia8
 
DBMS Structure of Relational Databases.pptx
ssuser19199c
 
Relational database Management system.pptx
RevathiNCommerceCSCA
 
Advance database system (part 3)
Abdullah Khosa
 
DBMS key topic Presentation slide 1.pptx
sonudhakad173
 
The Relational Model
Bhandari Nawaraj
 
Relational Model
Er. Nawaraj Bhandari
 
Relational model
Dabbal Singh Mahara
 
Types of keys in dbms
darshhingu
 
keys of data base like as Super keys and others.
sajidraza88875
 
Dbms keys
RUpaliLohar
 
DBMS-Unit-2.pptx
Abhinayacheekati
 
Relational Database Model Database Management system
soalteepaudel
 
Chapter-5 The Relational Data Model
Kunal Anand
 
computer-210809080138.pdf
rahulsharma571283
 
xi ip rdbms.pptxsieiw9wiejrnejow929wiejemm
mk1227103
 
RELATIONALfsaaaaaaaaaaaakyagsgs MODEL.pptx
satish7588
 
Presentation OF DBMS-2.pptx
ShumailaSajjad
 
The Relational Model represents data and their relationships through a collec...
i211415ZoyaAli
 
Lecture 2 - Relational Model and Terminology.pptx
MohamedShamil11
 
Ad

More from urvashipundir04 (20)

PPTX
stack in python using different datatypes.pptx
urvashipundir04
 
PPTX
Game Playing in Artificial intelligence.pptx
urvashipundir04
 
PPTX
extended modelling in dbms using different.pptx
urvashipundir04
 
PPTX
PRODUCTION SYSTEM in data science .pptx
urvashipundir04
 
PPTX
Presentation1 in datamining using techn.pptx
urvashipundir04
 
PPTX
Dependency modelling in data mining.pptx
urvashipundir04
 
PPTX
INTRODUCTION to datawarehouse IN DATA.pptx
urvashipundir04
 
PPTX
SOCIAL NETWORK ANALYISI in engeenireg.pptx
urvashipundir04
 
PPTX
datamining in engerring using different techniques.pptx
urvashipundir04
 
PPTX
datamining IN Artificial intelligence.pptx
urvashipundir04
 
PPTX
Underfitting and Overfitting in Machine Learning.pptx
urvashipundir04
 
PPTX
introduction values and best practices in
urvashipundir04
 
PPTX
ppt on different topics of circular.pptx
urvashipundir04
 
PPTX
list in python and traversal of list.pptx
urvashipundir04
 
PPT
ermodelN in database management system.ppt
urvashipundir04
 
PPTX
libraries in python using different .pptx
urvashipundir04
 
PPTX
tuple in python is an impotant topic.pptx
urvashipundir04
 
PPTX
ANIMATION in computer graphics using 3 D.pptx
urvashipundir04
 
PPTX
dispaly subroutines in computer graphics .pptx
urvashipundir04
 
PPTX
loopin gstatement in python using .pptx
urvashipundir04
 
stack in python using different datatypes.pptx
urvashipundir04
 
Game Playing in Artificial intelligence.pptx
urvashipundir04
 
extended modelling in dbms using different.pptx
urvashipundir04
 
PRODUCTION SYSTEM in data science .pptx
urvashipundir04
 
Presentation1 in datamining using techn.pptx
urvashipundir04
 
Dependency modelling in data mining.pptx
urvashipundir04
 
INTRODUCTION to datawarehouse IN DATA.pptx
urvashipundir04
 
SOCIAL NETWORK ANALYISI in engeenireg.pptx
urvashipundir04
 
datamining in engerring using different techniques.pptx
urvashipundir04
 
datamining IN Artificial intelligence.pptx
urvashipundir04
 
Underfitting and Overfitting in Machine Learning.pptx
urvashipundir04
 
introduction values and best practices in
urvashipundir04
 
ppt on different topics of circular.pptx
urvashipundir04
 
list in python and traversal of list.pptx
urvashipundir04
 
ermodelN in database management system.ppt
urvashipundir04
 
libraries in python using different .pptx
urvashipundir04
 
tuple in python is an impotant topic.pptx
urvashipundir04
 
ANIMATION in computer graphics using 3 D.pptx
urvashipundir04
 
dispaly subroutines in computer graphics .pptx
urvashipundir04
 
loopin gstatement in python using .pptx
urvashipundir04
 
Ad

Recently uploaded (20)

PDF
Module - 4 Machine Learning -22ISE62.pdf
Dr. Shivashankar
 
PDF
Clustering Algorithms - Kmeans,Min ALgorithm
Sharmila Chidaravalli
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PDF
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
PPTX
UNIT 1 - INTRODUCTION TO AI and AI tools and basic concept
gokuld13012005
 
PPTX
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
PPTX
Fundamentals of Quantitative Design and Analysis.pptx
aliali240367
 
PDF
Bachelor of information technology syll
SudarsanAssistantPro
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PDF
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
PDF
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
PDF
NTPC PATRATU Summer internship report.pdf
hemant03701
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PPTX
Basics of Electrical Engineering and electronics .pptx
PrabhuNarayan6
 
PPTX
Alan Turing - life and importance for all of us now
Pedro Concejero
 
Module - 4 Machine Learning -22ISE62.pdf
Dr. Shivashankar
 
Clustering Algorithms - Kmeans,Min ALgorithm
Sharmila Chidaravalli
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
Distribution reservoir and service storage pptx
dhanashree78
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
UNIT 1 - INTRODUCTION TO AI and AI tools and basic concept
gokuld13012005
 
Explore USA’s Best Structural And Non Structural Steel Detailing
Silicon Engineering Consultants LLC
 
Fundamentals of Quantitative Design and Analysis.pptx
aliali240367
 
Bachelor of information technology syll
SudarsanAssistantPro
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
NTPC PATRATU Summer internship report.pdf
hemant03701
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
Basics of Electrical Engineering and electronics .pptx
PrabhuNarayan6
 
Alan Turing - life and importance for all of us now
Pedro Concejero
 

relational data model in DBMS AND KEYS.pptx

  • 2. Relational Database Model  E.F. Codd proposed the relational Model to model data in the form of relations or tables  Developed in 1970 by E.F. Codd, it became commercial in the 80s.  After designing the conceptual model of the Database using ER diagram, we need to convert the conceptual model into a relational model  The relational data model is a foundational concept in database management that organizes data into one or more tables (or "relations") of rows and columns,
  • 3. Cont..  Data elements are stored in different tables made up of rows and columns.  A relational database consists of a collection of tables, each of which is assigned a unique name. Consider a relation STUDENT with attributes ROLL_NO, NAME, ADDRESS, PHONE, and AGE
  • 5. Important Terminologies  Attribute: Attributes are the properties that define an entity.  Relation Schema: A relation schema defines the structure of the relation and represents the name of the relation with its attributes. e.g.; STUDENT (ROLL_NO, NAME, ADDRESS, PHONE, and AGE) is the relation schema for STUDENT. If a schema has more than 1 relation, it is called Relational Schema.  Tuple: Each row in the relation is known as a tuple.  Relation Instance: The set of tuples of a relation at a particular instance of time is called a relation instance.
  • 6.  Degree: The number of attributes in the relation is known as the degree of the relation. The STUDENT relation defined above has degree 5.  Cardinality: The number of tuples in a relation is known as cardinality. The STUDENT relation defined above has cardinality 4.  Column: The column represents the set of values for a particular attribute. The column ROLL_NO is extracted from the relation STUDENT.  NULL Values: The value which is not known or unavailable is called a NULL value. It is represented by blank space. e.g.; PHONE of STUDENT having ROLL_NO 4 is NULL
  • 7. Relation Key:  These are basically the keys that are used to identify the rows uniquely or also help in identifying tables. These are of the following types.  Primary Key  Candidate Key  Super Key  Foreign Key  Alternate Key  Composite Key
  • 8. Candidate Key  The minimal set of attributes that can uniquely identify a tuple is known as a candidate key. For Example, STUD_NO in STUDENT relation.  It is a minimal super key.  It is a super key with no repeated data is called a candidate key.  The minimal set of attributes that can uniquely identify a record.  It must contain unique values.  It can contain NULL values.  Every table must have at least a single candidate key.  A table can have multiple candidate keys but only one primary key.  The value of the Candidate Key is unique and may be null for a tuple.  There can be more than one candidate key in a relationship.  The candidate key can be simple (having only one attribute) or composite as well.
  • 10. Primary Key  There can be more than one candidate key in relation out of which one can be chosen as the primary key. For Example, STUD_NO, as well as STUD_PHONE, are candidate keys for relation STUDENT but STUD_NO can be chosen as the primary key(only one out of many candidate keys).  It is a unique key.  It can identify only one tuple (a record) at a time.  It has no duplicate values, it has unique values.  It cannot be NULL.  Primary keys are not necessarily to be a single column; more than one column can also be a primary key for a table.  Ex-ROLL_NO is a primary key.
  • 11. Rules For Defining the Primary Key  Minimal: The primary key is composed of a minimum number of attributes  Accessible: The primary key is used to check the ability to access and interact with the database. The user must easily create, read or delete a tuple using it.
  • 12. syntax for creating the Primary Key  CREATE TABLE EMPLOYEE (  Employee_Id int NOT NULL PRIMARY KEY,  Name varchar (200) NOT NULL,  PAN_NO int NOT NULL  Salary int NOT NULL  Dept varchar (200) NOT NULL  );
  • 14. Super Key  The set of attributes that can uniquely identify a tuple is known as Super Key. For Example, STUD_NO, (STUD_NO, STUD_NAME), etc. A super key is a group of single or multiple keys that identifies rows in a table. It supports NULL values.  Adding zero or more attributes to the candidate key generates the super key.  A candidate key is a super key but vice versa is not true.  Super Key values may also be NULL.
  • 16. Alternate Key  The candidate key other than the primary key is called an alternate key  All the keys which are not primary keys are called alternate keys.  It is a secondary key.  It contains two or more fields to identify two or more records.
  • 17. Foreign Key  If an attribute can only take the values which are present as values of some other attribute, it will be a foreign key to the attribute to which it refers.  It is a key it acts as a primary key in one table and it acts as secondary key in another table.  It combines two or more relations (tables) at a time.  They act as a cross-reference between the tables.  For example, DNO is a primary key in the DEPT table and a non-key in EMP  It is maintaining refrential integrity.
  • 18.  A foreign key is a column or a combination of columns in a table that establishes a link between two tables in a relational database. It refers to the primary key in another table  The table with a foreign key is called a foreign table/child table/referencing table  The table with a primary key that is referenced by a foreign key is called a primary table/parent table /referenced Table.  A foreign key can be created during table creation using CREATE TABLE or it can be added to a table later using ALTER TABLE statement
  • 19.  The syntax to create a foreign key in CREATE TABLE statement is:  CREATE TABLE table_name ( column1 datatype, column2 datatype, …, CONSTRAINT fk_constraint_name FOREIGN KEY (column1, column2, …) REFERENCES parent_table(column1, column2, …)  );
  • 20. Composite Key  A table might not have a single column/attribute that uniquely identifies all the records of a table. To uniquely identify rows of a table, a combination of two or more columns/attributes can be used. It still can give duplicate values in rare cases. So, we need to find the optimal set of attributes that can uniquely identify rows in a table.  It acts as a primary key if there is no primary key in a table  Two or more attributes are used together to make a composite key .  A composite key cannot be null.