SlideShare a Scribd company logo
1 of 24
OPaper Name -- Database
System
OStaff -- Ms. D. Saritha M.C.A.,
M.phil.,
OClass -- II Year
OSemester -- IV
OUnit -- II
OTopic -- Relational Model
Relational Model
O Structure of Relational Database.
O Fundamental Relational Algebra
Operations.
O Additional Relational Algebra Operations.
O Extended Relational Algebra Operations.
O Null Values.
O Modification of the Database.
Structure of Relational
Database
O A relational database consists of a
collection of tables, each of which is
assigned a unique name.
O In a Relational Model the term:
1. Relation is refers to TABLE.
2. Row is refers to TUPLE.
3. Column is refers to ATTRIBUTE.
Example:
Fundamental Operations
O The basic fundamental relational algebra
operations are:
1. The Select Operations.
2. The Project Operations.
3. The Cartesian-Product
Operations.
4. The Rename Operations.
5. The Union Operations.
6. The Set Difference Operations.
1. The Select Operations
O Select operations select tuples (row) that
satisfy the given predicate (condition) from a
relation (table).
O Select operation is denote by Greek letter
Sigma (σ).
O For example:
σp(r)
Where,
σ stands for selection predicate
r stands for relation
p is prepositional logic formula
Example
ID NAME DEPT
20895 Venba English
49085 Nila Maths
38575 Iniya Computer science
σdept=“maths”(staff)
The Staff Relation
ID NAME DEPT
49085 Nila Maths
2. The Project Operations
O It projects column(s) that satisfy a given
predicate.
O It is denoted by π
O For example:
πreg-no, name (student).
3. The Cartesian-Product
Operations
O Combines information of two different
relations into one.
O It is denote by X.
O For example:
r X s
Where,
r and s are relations of this cartesian
product.
4. The Rename Operations
O The rename operation allows us to
rename the output relation.
O It is denoted by ρ
O For example:
ρ x (E)
Where,
The result of expression E is saved with
name of X.
5. The Union Operations
O It performs binary union between two
given relations.
O It is denoted by U.
O For example:
r U s
Where ,
r and s must have the same number of
attributes.
6. The Set Difference
Operations
O The result of set difference operation is
tuples, which are present in one relation
but are not in the second relation.
O It is denoted by –
O For example:
r – s.
Additional Operations
O Additional operations are defined in terms
of the fundamental operations.
O They do not add power to the algebra, but
are useful to simplify common queries.
O The additional operations are:
1. The Set Intersection Operation
2. The Natural Join Operation
3. The Division Operation
4.The Assignment Operation
The Set Intersection
O It is denoted by ∩, and returns a relation that
contains tuples that are in both of its argument
relations.
O For example
O r∩ s=r-(r-s)
The Natural Join
O The natural join is a binary operation that allows
us to combine certain selection and a cartesian
product into one operation.
The Division Operations:
O Division, denoted , is suited to queries that include
the phrase ``for all''.
The Assignment Operation:
O The assignment operation, denoted , works like
assignment in a programming language.
Extended Operations
O Extended operators are those operators
which can be derived from basic
operators.There are mainly three types of
extended operators in Relational Algebra:
O Join
O Intersection
O Divide
Modification of Database
O Modification statements make changes to
database data in tables and columns.
O There are 3 modification of database:
1) Insert – add rows to tables.
2) Update – modify columns in table
row
3) Delete – remove rows from tables
1) Insert
O The Insert statement adds one or more
rows to a table.
O Syntax :
insert into table_name (column-list) values
(values-list)
(OR)
insert into table_name (column-list)
(query-specification)
Example:
O insert into student (reg-no, name, dept)
values (103, ‘Riya’, ‘physics’)
REG-NO NAME DEPT
101 Thiya Maths
102 Malar English
REG-NO NAME DEPT
101 Thiya Maths
102 Malar English
103 Riya Physics
2) Update
O The Update statement modifies columns
in selected table rows.
O Syntax:
update table_name Set (set-list) [Where
predicate].
O The Set Clause expressions and Where
Clause predicate can contain subqueries.
O The set-list contains assignments of new
values for selected columns.
Example
O update student set dept = Info _Tech
where reg-no =102
REG-NO NAME DEPT
101 Vijay Computer science
102 Suriya Info_tech
REG-NO NAME DEPT
101 Vijay Computer science
102 Suriya Null
3) Delete
O The delete statement removes selected
rows from a table. We cannot delete
values on only particular attributes. We
can delete only whole tubles.
O Syntax:
delete from table_name [where
predicate]
Example
O delete from student where name =
‘Veera’
REG-NO NAME DEPT
306 Vijay Computer science
307 Veera Mechanical
308 Vishnu Info-tech
REG-NO NAME DEPT
306 Vijay Computer science
308 Vishnu Info-tech
Relational model (unit II)

More Related Content

What's hot

Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queues
tech4us
 
Insertion into linked lists
Insertion into linked lists Insertion into linked lists
Insertion into linked lists
MrDavinderSingh
 
Data structure lecture 5
Data structure lecture 5Data structure lecture 5
Data structure lecture 5
Kumar
 

What's hot (20)

Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queues
 
linked list
linked list linked list
linked list
 
R code descriptive statistics of phenotypic data by Avjinder Kaler
R code descriptive statistics of phenotypic data by Avjinder KalerR code descriptive statistics of phenotypic data by Avjinder Kaler
R code descriptive statistics of phenotypic data by Avjinder Kaler
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using python
 
Linked list
Linked listLinked list
Linked list
 
Insertion into linked lists
Insertion into linked lists Insertion into linked lists
Insertion into linked lists
 
Data Structure (Circular Linked List)
Data Structure (Circular Linked List)Data Structure (Circular Linked List)
Data Structure (Circular Linked List)
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
 
Ds important questions
Ds important questionsDs important questions
Ds important questions
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Unit 1 linked list
Unit 1 linked listUnit 1 linked list
Unit 1 linked list
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
 
Deletion from single way linked list and search
Deletion from single way linked list and searchDeletion from single way linked list and search
Deletion from single way linked list and search
 
Data structure lecture 5
Data structure lecture 5Data structure lecture 5
Data structure lecture 5
 
linked list
linked listlinked list
linked list
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structures
 
Java Linked List Tutorial | Edureka
Java Linked List Tutorial |  EdurekaJava Linked List Tutorial |  Edureka
Java Linked List Tutorial | Edureka
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic Statistics
 
Ds notes
Ds notesDs notes
Ds notes
 
Linked list
Linked listLinked list
Linked list
 

Similar to Relational model (unit II)

E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
Mukund Trivedi
 
E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
Mukund Trivedi
 
E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)
Mukund Trivedi
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
Vikas Gupta
 
RelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdfRelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdf
10GUPTASOUMYARAMPRAK
 

Similar to Relational model (unit II) (20)

Relational data model
Relational data modelRelational data model
Relational data model
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization
 
Ms excel
Ms excelMs excel
Ms excel
 
Info_Management_report-1.pptx
Info_Management_report-1.pptxInfo_Management_report-1.pptx
Info_Management_report-1.pptx
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Modules Linear Algebra Drills
Modules Linear Algebra DrillsModules Linear Algebra Drills
Modules Linear Algebra Drills
 
Normalization
NormalizationNormalization
Normalization
 
UNIT 2 Structured query language commands
UNIT 2 Structured query language commandsUNIT 2 Structured query language commands
UNIT 2 Structured query language commands
 
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
 
E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
 
E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)E212d9a797dbms chapter3 b.sc2 (1)
E212d9a797dbms chapter3 b.sc2 (1)
 
Module 2-2.ppt
Module 2-2.pptModule 2-2.ppt
Module 2-2.ppt
 
relational algebra and it's implementation
relational algebra and it's implementationrelational algebra and it's implementation
relational algebra and it's implementation
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
ADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASADADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASAD
 
ch3
ch3ch3
ch3
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
R brownbag seminar 2.3
R brownbag seminar 2.3R brownbag seminar 2.3
R brownbag seminar 2.3
 
RelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdfRelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS Publications
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 

Relational model (unit II)

  • 1. OPaper Name -- Database System OStaff -- Ms. D. Saritha M.C.A., M.phil., OClass -- II Year OSemester -- IV OUnit -- II OTopic -- Relational Model
  • 2.
  • 3. Relational Model O Structure of Relational Database. O Fundamental Relational Algebra Operations. O Additional Relational Algebra Operations. O Extended Relational Algebra Operations. O Null Values. O Modification of the Database.
  • 4. Structure of Relational Database O A relational database consists of a collection of tables, each of which is assigned a unique name. O In a Relational Model the term: 1. Relation is refers to TABLE. 2. Row is refers to TUPLE. 3. Column is refers to ATTRIBUTE.
  • 6. Fundamental Operations O The basic fundamental relational algebra operations are: 1. The Select Operations. 2. The Project Operations. 3. The Cartesian-Product Operations. 4. The Rename Operations. 5. The Union Operations. 6. The Set Difference Operations.
  • 7. 1. The Select Operations O Select operations select tuples (row) that satisfy the given predicate (condition) from a relation (table). O Select operation is denote by Greek letter Sigma (σ). O For example: σp(r) Where, σ stands for selection predicate r stands for relation p is prepositional logic formula
  • 8. Example ID NAME DEPT 20895 Venba English 49085 Nila Maths 38575 Iniya Computer science σdept=“maths”(staff) The Staff Relation ID NAME DEPT 49085 Nila Maths
  • 9. 2. The Project Operations O It projects column(s) that satisfy a given predicate. O It is denoted by π O For example: πreg-no, name (student).
  • 10. 3. The Cartesian-Product Operations O Combines information of two different relations into one. O It is denote by X. O For example: r X s Where, r and s are relations of this cartesian product.
  • 11. 4. The Rename Operations O The rename operation allows us to rename the output relation. O It is denoted by ρ O For example: ρ x (E) Where, The result of expression E is saved with name of X.
  • 12. 5. The Union Operations O It performs binary union between two given relations. O It is denoted by U. O For example: r U s Where , r and s must have the same number of attributes.
  • 13. 6. The Set Difference Operations O The result of set difference operation is tuples, which are present in one relation but are not in the second relation. O It is denoted by – O For example: r – s.
  • 14. Additional Operations O Additional operations are defined in terms of the fundamental operations. O They do not add power to the algebra, but are useful to simplify common queries. O The additional operations are: 1. The Set Intersection Operation 2. The Natural Join Operation 3. The Division Operation 4.The Assignment Operation
  • 15. The Set Intersection O It is denoted by ∩, and returns a relation that contains tuples that are in both of its argument relations. O For example O r∩ s=r-(r-s) The Natural Join O The natural join is a binary operation that allows us to combine certain selection and a cartesian product into one operation. The Division Operations: O Division, denoted , is suited to queries that include the phrase ``for all''. The Assignment Operation: O The assignment operation, denoted , works like assignment in a programming language.
  • 16. Extended Operations O Extended operators are those operators which can be derived from basic operators.There are mainly three types of extended operators in Relational Algebra: O Join O Intersection O Divide
  • 17. Modification of Database O Modification statements make changes to database data in tables and columns. O There are 3 modification of database: 1) Insert – add rows to tables. 2) Update – modify columns in table row 3) Delete – remove rows from tables
  • 18. 1) Insert O The Insert statement adds one or more rows to a table. O Syntax : insert into table_name (column-list) values (values-list) (OR) insert into table_name (column-list) (query-specification)
  • 19. Example: O insert into student (reg-no, name, dept) values (103, ‘Riya’, ‘physics’) REG-NO NAME DEPT 101 Thiya Maths 102 Malar English REG-NO NAME DEPT 101 Thiya Maths 102 Malar English 103 Riya Physics
  • 20. 2) Update O The Update statement modifies columns in selected table rows. O Syntax: update table_name Set (set-list) [Where predicate]. O The Set Clause expressions and Where Clause predicate can contain subqueries. O The set-list contains assignments of new values for selected columns.
  • 21. Example O update student set dept = Info _Tech where reg-no =102 REG-NO NAME DEPT 101 Vijay Computer science 102 Suriya Info_tech REG-NO NAME DEPT 101 Vijay Computer science 102 Suriya Null
  • 22. 3) Delete O The delete statement removes selected rows from a table. We cannot delete values on only particular attributes. We can delete only whole tubles. O Syntax: delete from table_name [where predicate]
  • 23. Example O delete from student where name = ‘Veera’ REG-NO NAME DEPT 306 Vijay Computer science 307 Veera Mechanical 308 Vishnu Info-tech REG-NO NAME DEPT 306 Vijay Computer science 308 Vishnu Info-tech