SlideShare a Scribd company logo
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
 
linked list
linked list linked list
linked list
Narendra Chauhan
 
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
Avjinder (Avi) Kaler
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using python
LavanyaJ28
 
Linked list
Linked listLinked list
Linked list
Priyanka Rana
 
Insertion into linked lists
Insertion into linked lists Insertion into linked lists
Insertion into linked lists
MrDavinderSingh
 
Data Structure (Circular Linked List)
Data Structure (Circular Linked List)Data Structure (Circular Linked List)
Data Structure (Circular Linked List)
Adam Mukharil Bachtiar
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
ManishPrajapati78
 
Ds important questions
Ds important questionsDs important questions
Ds important questions
LavanyaJ28
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
shameen khan
 
Unit 1 linked list
Unit 1 linked listUnit 1 linked list
Unit 1 linked list
LavanyaJ28
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
swajahatr
 
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
Estiak Khan
 
Data structure lecture 5
Data structure lecture 5Data structure lecture 5
Data structure lecture 5
Kumar
 
linked list
linked listlinked list
linked list
Shaista Qadir
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structures
DurgaDeviCbit
 
Java Linked List Tutorial | Edureka
Java Linked List Tutorial |  EdurekaJava Linked List Tutorial |  Edureka
Java Linked List Tutorial | Edureka
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
Avjinder (Avi) Kaler
 
Ds notes
Ds notesDs notes
Linked list
Linked listLinked list
Linked list
Shashank Shetty
 

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)

Relational data model
Relational data modelRelational data model
Relational data model
SURBHI SAROHA
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization
Hafiz faiz
 
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdfOracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
SkillCertProExams
 
Ms excel
Ms excelMs excel
Info_Management_report-1.pptx
Info_Management_report-1.pptxInfo_Management_report-1.pptx
Info_Management_report-1.pptx
ChingChingErm
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
Nishant Munjal
 
Modules Linear Algebra Drills
Modules Linear Algebra DrillsModules Linear Algebra Drills
Modules Linear Algebra Drills
Daniel Bragais
 
Normalization
NormalizationNormalization
Normalization
Mohd Mastana
 
UNIT 2 Structured query language commands
UNIT 2 Structured query language commandsUNIT 2 Structured query language commands
UNIT 2 Structured query language commands
Bhakti Pawar
 
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)
Raj vardhan
 
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
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
Mukund Trivedi
 
Module 2-2.ppt
Module 2-2.pptModule 2-2.ppt
Module 2-2.ppt
Shylaja40
 
relational algebra and it's implementation
relational algebra and it's implementationrelational algebra and it's implementation
relational algebra and it's implementation
dbmscse61
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
Vikas Gupta
 
ADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASADADVANCE ITT BY PRASAD
ADVANCE ITT BY PRASAD
PADYALAMAITHILINATHA
 
ch3
ch3ch3
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
VENNILAV6
 
R brownbag seminar 2.3
R brownbag seminar 2.3R brownbag seminar 2.3
R brownbag seminar 2.3
Muhammad Nabi Ahmad
 

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
 
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdfOracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
Oracle Database Administration I (1Z0-082) Exam Dumps 2024.pdf
 
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 (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)
 
E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2E212d9a797dbms chapter3 b.sc2
E212d9a797dbms chapter3 b.sc2
 
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
 

Recently uploaded

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 

Recently uploaded (20)

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 

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