SlideShare una empresa de Scribd logo
1 de 20
.
[object Object],[object Object],[object Object],[object Object],[object Object],BASICS OF RELATIONAL ALGEBRA
BASIC SET ORIENTED OPERATIONS NATIVE RELATIONAL OPERATIONS NAME SYMBOL SELECTION σ PROJECTION Π JOIN DIVISION ÷ RENAME ρ ASSIGNMENT 
UNION A B R=A U B ROLL.NO NAME 12505 SHARAN 12506 SANGEETA 12507 SHYNA ROLL.NO NAME 12502 PRABJOT 125O7 SHYNA 12520 POOJA 12521 RINKI ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12506 SANGEETA 12507 SHYNA 12520 POOJA 12521 RINKI
INTERSECTION A B R=A ∩ B ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12521 RINKI
DIFFERENCE B A R=A-B R=B-A ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA 12514 NEETU 12521 RINKI ROLL.NO NAME 12502 PRABJOT 12505 SHARAN ROLL.NO NAME 12519 POOJA 12514 NEETU
CARTESIAN PRODUCT A B R=A × B ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA ROLL.NO NAME ROLL.NO NAME 12502 PRABJOT 12507 SHYNA 12502 PRABJOT 12519 POOJA 12505 SHARAN 12507 SHYNA 12505 SHARAN 12519 POOJA 12507 SHYNA 12507 SHYNA 12507 SHYNA 12519 POOJA 12521 RINKI 12507 SHYNA 12521 RINKI 12521 POOJA
EMPLOYEE   SELECTION RESULTING TABLE σ AGE >32 (EMPLOYEE) ID NAME SALARY AGE 101 AMIT 4500 30 102 AJAY 5000 35 105 JOHN 5000 36 106 ABHI 4000 28 107 ALI 4800 31 108 SUNIL 3500 33 ID NAME SALARY AGE 102 AJAY 5000 35 105 JOHN 5000 36 108 SUNIL 3500 33
PROJECTION EMPLOYEE   RESULTING TABLES   A.  π   ID (EMPLOYEE)   B.  π   NAME,AGE (EMPLOYEE)   B   A   ID NAME SALARY AGE 101 AMIT 4500 30 102 AJAY 5000 35 105 JOHN 5000 36 106 ABHI 4000 28 107 ALI 4800 31 108 SUNIL 3500 33 109 JOHN 4600 29 NAME AGE AMIT 30 AJAY 35 JOHN 36 ABHI 28 ALI 31 SUNIL 33 JOHN 29 ID 101 102 105 106 107 108 109
COURSE(C)   S   JOIN   RESULTING TABLE( EQUI-JOIN ) COURSE=C_ID  (C)  STU(S)   ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-03 MSC(IT) 2 M-04 MCA 3 ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-04 MCA 3 M-03 MSC(IT) 2
COURSE(C)   NATURAL  JOIN  ON  S   AND  C NATURAL JOIN(INNER JOIN) STU(S)   ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_NAME C_DUR MBA(HR) 2 MSC(PHY) 2 MCA 3 MSC(IT) 2 ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-03 MSC(IT) 2 M-04 MCA 3
DIVISION   MAIN   R1   SUB2   SUB3 RESULTING TABLES  R3   R3  MAIN ÷ SUB3   R2 R1  MAIN ÷ SUB1 R2  MAIN ÷ SUB2   SUB1   ASSIGNMENT   A B A1 B1 A3 B2 A2 B3 A2 B1 A1 B3 A3 B3 A3 B1 B B1 B3 B B2 B B2 B3 A A1 A2 A3 A A3 A A3
ρ ,[object Object],RENAME   x (R) ρ x(A1,A2,A3…An) (R)
ADDITIONAL RELATIONAL OPERATORS   ,[object Object],[object Object],[object Object],[object Object],[object Object]
Aggregate functions and grouping (R) COUNT EMP_ID, SUM SALARY £   (R)  DEP_ID   £   COUNT EMP_ID, MAXIMUM SALARY (R)  EMP_ID NAME DEP_ID SALARY 250 RAVI 10 5600 251 ANUJ 11 4000 252 JOHN 13 10000 253 AJIT 10 4500 254 RAVI 13 9000 256 AJAY 11 5000 257 ANUJ 11 3000 258 JOHN 10 2000 DEP_ID COUNT EMP_ID SUM SALARY 10 3 12100 11 3 12000 13 2 19000 COUNT EMP_ID MAX SALARY 9 10000
In outer join ,the rows in one relation having no matching rows in the other Relation will also appear in the resulting table with nulls in other attributes positions instead of being ignored . OUTER JOIN ,[object Object],[object Object],[object Object],[object Object]
LEFT  OUTER JOIN EMP(E) DEPT(D) E   D   EMP_ID E_NAME AGE DEP_NO 101 AJAY 28 10 103 AMIT 33 11 104 PIYUSH 30 10 107 AJIT 23 NULL DEP_ID D_NAME 10 CREDIT 11 LOAN 12 CASH EMP_ID E_NAME AGE D_NAME 101 AJAY 28 CREDIT 103 AMIT 33 LOAN 104 PIYUSH 30 CREDIT 107 AJIT 23 NULL
RIGHT  OUTER JOIN EMP(E) DEPT(D) E   D   DEP_ID D_NAME 10 CREDIT 11 LOAN 12 CASH EMP_ID E_NAME AGE DEP_NO 101 AJAY 28 10 103 AMIT 33 11 104 PIYUSH 30 10 107 AJIT 23 NULL EMP_ID E_NAME AGE D_NAME 101 AJAY 28 CREDIT 103 AMIT 33 LOAN 104 PIYUSH 30 CREDIT NULL NULL NULL CASH
FULL  OUTER  JOIN EMP(E) DEPT(D) E   D   DEP_ID D_NAME 10 CREDIT 11 LOAN 12 CASH EMP_ID E_NAME AGE DEP_NO 101 AJAY 28 10 103 AMIT 33 11 104 PIYUSH 30 10 107 AJIT 23 NULL EMP_ID E_NAME AGE D_NAME 101 AJAY 28 CREDIT 103 AMIT 33 LOAN 104 PIYUSH 30 CREDIT 107 AJIT 23 NULL NULL NULL NULL CASH
Relational algebra

Más contenido relacionado

La actualidad más candente (20)

relational algebra
relational algebrarelational algebra
relational algebra
 
MYSQL join
MYSQL joinMYSQL join
MYSQL join
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
SQL
SQL SQL
SQL
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Sql commands
Sql commandsSql commands
Sql commands
 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
joins in database
 joins in database joins in database
joins in database
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
 
12 SQL
12 SQL12 SQL
12 SQL
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
SQL
SQLSQL
SQL
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Sql commands
Sql commandsSql commands
Sql commands
 

Destacado

Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbmsshekhar1991
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational Algebraguest20b0b3
 
Relational Algebra-Database Systems
Relational Algebra-Database SystemsRelational Algebra-Database Systems
Relational Algebra-Database Systemsjakodongo
 
Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...
Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...
Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...Beat Signer
 
Relational algebra-and-relational-calculus
Relational algebra-and-relational-calculusRelational algebra-and-relational-calculus
Relational algebra-and-relational-calculusSalman Vadsarya
 
Relational Algebra,Types of join
Relational Algebra,Types of joinRelational Algebra,Types of join
Relational Algebra,Types of joinraj upadhyay
 
Introduction to Relational Algebra
Introduction to Relational AlgebraIntroduction to Relational Algebra
Introduction to Relational AlgebraJames McMurray
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginnersRam Sagar Mourya
 
B2C Business models
B2C Business modelsB2C Business models
B2C Business modelsshynajain
 
Relational algebra
Relational algebraRelational algebra
Relational algebrarubab arzoo
 
Rrelational algebra in dbms overview
Rrelational algebra in dbms overviewRrelational algebra in dbms overview
Rrelational algebra in dbms overviewgourav kottawar
 
My slide relational algebra
My slide  relational algebraMy slide  relational algebra
My slide relational algebraRushdi Shams
 

Destacado (20)

Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational Algebra
 
Relational Algebra-Database Systems
Relational Algebra-Database SystemsRelational Algebra-Database Systems
Relational Algebra-Database Systems
 
Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...
Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...
Relational Model and Relational Algebra - Lecture 3 - Introduction to Databas...
 
Relational algebra-and-relational-calculus
Relational algebra-and-relational-calculusRelational algebra-and-relational-calculus
Relational algebra-and-relational-calculus
 
Lec02
Lec02Lec02
Lec02
 
Relational Algebra,Types of join
Relational Algebra,Types of joinRelational Algebra,Types of join
Relational Algebra,Types of join
 
Introduction to Relational Algebra
Introduction to Relational AlgebraIntroduction to Relational Algebra
Introduction to Relational Algebra
 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
 
Dbms slides
Dbms slidesDbms slides
Dbms slides
 
B2C Business models
B2C Business modelsB2C Business models
B2C Business models
 
ÁLGEBRA RELACIONAL
ÁLGEBRA RELACIONALÁLGEBRA RELACIONAL
ÁLGEBRA RELACIONAL
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational Algebra
 
Rrelational algebra in dbms overview
Rrelational algebra in dbms overviewRrelational algebra in dbms overview
Rrelational algebra in dbms overview
 
My slide relational algebra
My slide  relational algebraMy slide  relational algebra
My slide relational algebra
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Modelamiento de base de Datos - Algebra relacional
Modelamiento de base de Datos - Algebra relacionalModelamiento de base de Datos - Algebra relacional
Modelamiento de base de Datos - Algebra relacional
 

Similar a Relational algebra

Similar a Relational algebra (15)

Cs501 rel algebra
Cs501 rel algebraCs501 rel algebra
Cs501 rel algebra
 
Relational model
Relational modelRelational model
Relational model
 
ANSI vs Oracle language
ANSI vs Oracle languageANSI vs Oracle language
ANSI vs Oracle language
 
Cobrix – a COBOL Data Source for Spark
Cobrix – a COBOL Data Source for SparkCobrix – a COBOL Data Source for Spark
Cobrix – a COBOL Data Source for Spark
 
SQL WORKSHOP::Lecture 4
SQL WORKSHOP::Lecture 4SQL WORKSHOP::Lecture 4
SQL WORKSHOP::Lecture 4
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Relational_Algebra .ppt
Relational_Algebra .pptRelational_Algebra .ppt
Relational_Algebra .ppt
 
SQL Outer Joins for Fun and Profit
SQL Outer Joins for Fun and ProfitSQL Outer Joins for Fun and Profit
SQL Outer Joins for Fun and Profit
 
Les04 Displaying Data From Multiple Table
Les04 Displaying Data From Multiple TableLes04 Displaying Data From Multiple Table
Les04 Displaying Data From Multiple Table
 
Get your moneys worth out of your database
Get your moneys worth out of your databaseGet your moneys worth out of your database
Get your moneys worth out of your database
 
Barisan dan deret 1 bilingual
Barisan dan deret 1 bilingualBarisan dan deret 1 bilingual
Barisan dan deret 1 bilingual
 
Database managment System Relational Algebra
Database managment System  Relational AlgebraDatabase managment System  Relational Algebra
Database managment System Relational Algebra
 
Relational Algibra operation
Relational Algibra  operationRelational Algibra  operation
Relational Algibra operation
 
Query optimisation
Query optimisationQuery optimisation
Query optimisation
 
The Five Best Things To Happen To SQL
The Five Best Things To Happen To SQLThe Five Best Things To Happen To SQL
The Five Best Things To Happen To SQL
 

Último

Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 

Último (20)

Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 

Relational algebra

  • 1. .
  • 2.
  • 3. BASIC SET ORIENTED OPERATIONS NATIVE RELATIONAL OPERATIONS NAME SYMBOL SELECTION σ PROJECTION Π JOIN DIVISION ÷ RENAME ρ ASSIGNMENT 
  • 4. UNION A B R=A U B ROLL.NO NAME 12505 SHARAN 12506 SANGEETA 12507 SHYNA ROLL.NO NAME 12502 PRABJOT 125O7 SHYNA 12520 POOJA 12521 RINKI ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12506 SANGEETA 12507 SHYNA 12520 POOJA 12521 RINKI
  • 5. INTERSECTION A B R=A ∩ B ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12521 RINKI
  • 6. DIFFERENCE B A R=A-B R=B-A ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA 12514 NEETU 12521 RINKI ROLL.NO NAME 12502 PRABJOT 12505 SHARAN ROLL.NO NAME 12519 POOJA 12514 NEETU
  • 7. CARTESIAN PRODUCT A B R=A × B ROLL.NO NAME 12502 PRABJOT 12505 SHARAN 12507 SHYNA 12521 RINKI ROLL.NO NAME 12507 SHYNA 12519 POOJA ROLL.NO NAME ROLL.NO NAME 12502 PRABJOT 12507 SHYNA 12502 PRABJOT 12519 POOJA 12505 SHARAN 12507 SHYNA 12505 SHARAN 12519 POOJA 12507 SHYNA 12507 SHYNA 12507 SHYNA 12519 POOJA 12521 RINKI 12507 SHYNA 12521 RINKI 12521 POOJA
  • 8. EMPLOYEE SELECTION RESULTING TABLE σ AGE >32 (EMPLOYEE) ID NAME SALARY AGE 101 AMIT 4500 30 102 AJAY 5000 35 105 JOHN 5000 36 106 ABHI 4000 28 107 ALI 4800 31 108 SUNIL 3500 33 ID NAME SALARY AGE 102 AJAY 5000 35 105 JOHN 5000 36 108 SUNIL 3500 33
  • 9. PROJECTION EMPLOYEE RESULTING TABLES A. π ID (EMPLOYEE) B. π NAME,AGE (EMPLOYEE) B A ID NAME SALARY AGE 101 AMIT 4500 30 102 AJAY 5000 35 105 JOHN 5000 36 106 ABHI 4000 28 107 ALI 4800 31 108 SUNIL 3500 33 109 JOHN 4600 29 NAME AGE AMIT 30 AJAY 35 JOHN 36 ABHI 28 ALI 31 SUNIL 33 JOHN 29 ID 101 102 105 106 107 108 109
  • 10. COURSE(C) S JOIN RESULTING TABLE( EQUI-JOIN ) COURSE=C_ID (C) STU(S) ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-03 MSC(IT) 2 M-04 MCA 3 ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-04 MCA 3 M-03 MSC(IT) 2
  • 11. COURSE(C) NATURAL JOIN ON S AND C NATURAL JOIN(INNER JOIN) STU(S) ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_NAME C_DUR MBA(HR) 2 MSC(PHY) 2 MCA 3 MSC(IT) 2 ROLL.NO NAME COURSE 101 PIYUSH M-01 102 SUMIT M-02 103 SHEENA M-04 104 RITU M-03 C_ID C_NAME C_DUR M-01 MBA(HR) 2 M-02 MSC(PHY) 2 M-03 MSC(IT) 2 M-04 MCA 3
  • 12. DIVISION MAIN R1 SUB2 SUB3 RESULTING TABLES R3 R3  MAIN ÷ SUB3 R2 R1  MAIN ÷ SUB1 R2  MAIN ÷ SUB2 SUB1 ASSIGNMENT A B A1 B1 A3 B2 A2 B3 A2 B1 A1 B3 A3 B3 A3 B1 B B1 B3 B B2 B B2 B3 A A1 A2 A3 A A3 A A3
  • 13.
  • 14.
  • 15. Aggregate functions and grouping (R) COUNT EMP_ID, SUM SALARY £ (R) DEP_ID £ COUNT EMP_ID, MAXIMUM SALARY (R) EMP_ID NAME DEP_ID SALARY 250 RAVI 10 5600 251 ANUJ 11 4000 252 JOHN 13 10000 253 AJIT 10 4500 254 RAVI 13 9000 256 AJAY 11 5000 257 ANUJ 11 3000 258 JOHN 10 2000 DEP_ID COUNT EMP_ID SUM SALARY 10 3 12100 11 3 12000 13 2 19000 COUNT EMP_ID MAX SALARY 9 10000
  • 16.
  • 17. LEFT OUTER JOIN EMP(E) DEPT(D) E D EMP_ID E_NAME AGE DEP_NO 101 AJAY 28 10 103 AMIT 33 11 104 PIYUSH 30 10 107 AJIT 23 NULL DEP_ID D_NAME 10 CREDIT 11 LOAN 12 CASH EMP_ID E_NAME AGE D_NAME 101 AJAY 28 CREDIT 103 AMIT 33 LOAN 104 PIYUSH 30 CREDIT 107 AJIT 23 NULL
  • 18. RIGHT OUTER JOIN EMP(E) DEPT(D) E D DEP_ID D_NAME 10 CREDIT 11 LOAN 12 CASH EMP_ID E_NAME AGE DEP_NO 101 AJAY 28 10 103 AMIT 33 11 104 PIYUSH 30 10 107 AJIT 23 NULL EMP_ID E_NAME AGE D_NAME 101 AJAY 28 CREDIT 103 AMIT 33 LOAN 104 PIYUSH 30 CREDIT NULL NULL NULL CASH
  • 19. FULL OUTER JOIN EMP(E) DEPT(D) E D DEP_ID D_NAME 10 CREDIT 11 LOAN 12 CASH EMP_ID E_NAME AGE DEP_NO 101 AJAY 28 10 103 AMIT 33 11 104 PIYUSH 30 10 107 AJIT 23 NULL EMP_ID E_NAME AGE D_NAME 101 AJAY 28 CREDIT 103 AMIT 33 LOAN 104 PIYUSH 30 CREDIT 107 AJIT 23 NULL NULL NULL NULL CASH