SlideShare a Scribd company logo
1 of 33
DBDA
(Database Design and Applications)
CH3
By: Prof. Ganesh Ingle
Session objective
INTRODUCTION
Relational Query Languages
Formal Query Languages
Introduction to relational algebra
Set Operators Join operator
Aggregate functions,Grouping
Relational Calculus concepts
Introduction to Structured Query Language (SQL)
Features of SQL,DDL Statements
Relational Query Languages
Relational Algebra:
Relational algebra is a procedural query language, which takes instances
of relations as input and yields instances of relations as output. It uses
operators to perform queries. An operator can be either unary or binary.
They accept relations as their input and yield relations as their output.
Relational algebra is performed recursively on a relation and
intermediate results are also considered relations.
The fundamental operations of relational algebra are as follows −
Select
Project
Union
Set different
Cartesian product
Rename
Relational Query Languages
Relational Algebra:
In Non-procedural query language, user instructs the system to produce the desired result without telling the
step by step process. Here users tells what data to be retrieved from database but doesn't tell how to retrieve it.
In procedural query language, user instructs the system to perform a series of operations to produce the
desired results. Here users tells what data to be retrieved from database and how to retrieve it. ... then it is a
procedural language.
Relational Query Languages
Relational Model vs RDBMS:
Relation Model RDBMS
RA,RC SQL
Algo Code
Conceptual Real time
Theoretical Practical
Introduction to relational algebra
Relational algebra: Its formal query language associated with relational model
Introduction to relational algebra
Select:
SELECT (σ)
The SELECT operation is used for selecting a subset of the
tuples according to a given selection condition. Sigma(σ)Symbol
denotes it. It is used as an expression to choose tuples which
meet the selection condition. Select operator selects tuples that
satisfy a given predicate.
Introduction to relational algebra
Select:
Query1: Find the details of account having balance >=10000?
Query2: Find the details of Customer who lives in Pune?
Query3: Find the details of those loan having amount <=5000? and from Pimpri branch
Query4: Find the details of those branch details which are in Pune and having assets more than 10L
Introduction to relational algebra
Project:
Project(∏)
Introduction to relational algebra
Project:
Query1: Find all the Branch_Name of bank
Query2: Find all the account numbers wit its balance?
Query3: Find the names of all the customers who have loan?
Query1: Find all the details of branch?
Introduction to relational algebra
Project : Select combination
Query1: Find those account where balance is less than 1000?
Query2: Find those loan numbers which are from pune branch with amount >1000?
Query3: Find the branch name and branch city with assets more than 100000?
Introduction to relational algebra
Union (∪)/Intersection (∩)/ Difference (−)
Query1: Find names of those customer having account or loan or
both?
Query2: Find names of a branch who have account but not loan
Query3: Find the names of those customer who neither loan or an account?
Introduction to relational algebra
Cartesian Product
The Cartesian Product is also an operator which works on two
sets. It is sometimes called the CROSS PRODUCT or CROSS
JOIN.
It combines the tuples of one relation with all the tuples of the
other relation.
Account
AAN BNo Bal
101 x 50
102 y 70
103 z 100
Deposit
CN DAN
1 101
2 102
3 103
Account X Deposit
Account X Deposit
AAN BNo Bal CN DAN
101 x 50 1 101
101 x 50 2 102
101 x 50 3 103
102 y 70 1 101
102 y 70 2 102
102 y 70 3 103
103 z 100 1 101
103 z 100 2 102
103 z 100 3 103
Query: Find CustomerName having account balance<100
Introduction to relational algebra
Aggregate or Set Functions
• Aggregate or Set functions are introduced to relational
algebra to increase its expressive power.
• An aggregate function operates on a set of values (tuples)
and computes one single value as output.
•
• The Set Functions in Relational Algebra
 sum(): computes the sum of all values in the (numeric) set
 avg(): computes the average of all values in the (numeric) set
 max(): finds the maximum value of all values in the set
 min(): finds the minimum value of all values in the set
 any(): returns TRUE if set is not empty, otherwise (i.e., empty set), returns FALSE
 count(): returns the cardinaility (number of elements) in the set
Introduction to relational algebra
Aggregate or Set Functions
Query1: Find the sum of assets of all banches
Query2: Count distinct customer name having accounts
Query2: Find the branch city wise max assets?
Introduction to relational algebra
Joins
Joins :
Joins
Inner Join: o/p or result
contains matching tuples
Types:=
1.Theta Join
2.Equi-Join
3.Natural Join
Outer join : All the rows from
both or any relations
Types :=
1.Left outer
2.Right outer
3.Full outer
Introduction to relational algebra
Theta Joins
Introduction to relational algebra
Joins
Introduction to relational algebra
EQUI Joins
Introduction to relational algebra
Joins
Introduction to relational algebra
Outer Joins
Introduction to relational algebra
Left Outer Joins
Introduction to relational algebra
Right Outer Joins
Introduction to relational algebra
Full Outer Joins
Introduction to relational algebra
Joins
Introduction to relational algebra
Division
Introduction to relational algebra
Division
Introduction to relational algebra
Division
Introduction to relational algebra
Division
Introduction to SQL
Introduction to SQL
THANK YOU

More Related Content

What's hot

Main topic 3 problem solving and office automation
Main topic 3 problem solving and office automationMain topic 3 problem solving and office automation
Main topic 3 problem solving and office automationInfinity Tech Solutions
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
Introduction To Algorithm [2]
Introduction To Algorithm [2]Introduction To Algorithm [2]
Introduction To Algorithm [2]ecko_disasterz
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generationAkshaya Arunan
 
Syntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address CodeSyntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address Codesanchi29
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Saikrishna Tanguturu
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in PythonRaajendra M
 
Relational algebra calculus
Relational algebra  calculusRelational algebra  calculus
Relational algebra calculusVaibhav Kathuria
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
structure and union
structure and unionstructure and union
structure and unionstudent
 
Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete  Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete Adnan abid
 
C programming session 04
C programming session 04C programming session 04
C programming session 04Dushmanta Nath
 

What's hot (19)

Main topic 3 problem solving and office automation
Main topic 3 problem solving and office automationMain topic 3 problem solving and office automation
Main topic 3 problem solving and office automation
 
Pointers in C language
Pointers  in  C languagePointers  in  C language
Pointers in C language
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
 
Introduction To Algorithm [2]
Introduction To Algorithm [2]Introduction To Algorithm [2]
Introduction To Algorithm [2]
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Relational+algebra (1)
Relational+algebra (1)Relational+algebra (1)
Relational+algebra (1)
 
Syntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address CodeSyntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address Code
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
 
Back patching
Back patchingBack patching
Back patching
 
Compiler Design QA
Compiler Design QACompiler Design QA
Compiler Design QA
 
Input processing and output in Python
Input processing and output in PythonInput processing and output in Python
Input processing and output in Python
 
Relational algebra calculus
Relational algebra  calculusRelational algebra  calculus
Relational algebra calculus
 
Ch13
Ch13Ch13
Ch13
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
structure and union
structure and unionstructure and union
structure and union
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete  Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
 

Similar to Database Management System-session 3-4-5

4. SQL in DBMS
4. SQL in DBMS4. SQL in DBMS
4. SQL in DBMSkoolkampus
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introductionSmriti Jain
 
Relational Database and Relational Algebra
Relational Database and Relational AlgebraRelational Database and Relational Algebra
Relational Database and Relational AlgebraPyingkodi Maran
 
5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMSkoolkampus
 
Introduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculusIntroduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculusAjit Nayak
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computationsit20ad004
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptxkavitha623544
 
Database Assignment
Database AssignmentDatabase Assignment
Database AssignmentJayed Imran
 
Chapter-6 Relational Algebra
Chapter-6 Relational AlgebraChapter-6 Relational Algebra
Chapter-6 Relational AlgebraKunal Anand
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001Ralph Weber
 
Software System Engineering - Chapter 13
Software System Engineering - Chapter 13Software System Engineering - Chapter 13
Software System Engineering - Chapter 13Fadhil Ismail
 

Similar to Database Management System-session 3-4-5 (20)

SQL PPT.ppt
SQL PPT.pptSQL PPT.ppt
SQL PPT.ppt
 
4. SQL in DBMS
4. SQL in DBMS4. SQL in DBMS
4. SQL in DBMS
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Sql server select queries ppt 18
Sql server select queries ppt 18Sql server select queries ppt 18
Sql server select queries ppt 18
 
Relational Database and Relational Algebra
Relational Database and Relational AlgebraRelational Database and Relational Algebra
Relational Database and Relational Algebra
 
RDBMS
RDBMSRDBMS
RDBMS
 
Unit04 dbms
Unit04 dbmsUnit04 dbms
Unit04 dbms
 
Linq
LinqLinq
Linq
 
5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS
 
Introduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculusIntroduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculus
 
Ch4
Ch4Ch4
Ch4
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computation
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx
 
Database Assignment
Database AssignmentDatabase Assignment
Database Assignment
 
Dbms module ii
Dbms module iiDbms module ii
Dbms module ii
 
Chapter-6 Relational Algebra
Chapter-6 Relational AlgebraChapter-6 Relational Algebra
Chapter-6 Relational Algebra
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001
 
dbms first unit
dbms first unitdbms first unit
dbms first unit
 
Software System Engineering - Chapter 13
Software System Engineering - Chapter 13Software System Engineering - Chapter 13
Software System Engineering - Chapter 13
 
Relation Algebra
Relation AlgebraRelation Algebra
Relation Algebra
 

More from Infinity Tech Solutions

Computer memory, Types of programming languages
Computer memory, Types of programming languagesComputer memory, Types of programming languages
Computer memory, Types of programming languagesInfinity Tech Solutions
 
AI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime SectorAI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime SectorInfinity Tech Solutions
 
Programming with matlab session 5 looping
Programming with matlab session 5 loopingProgramming with matlab session 5 looping
Programming with matlab session 5 loopingInfinity Tech Solutions
 
COMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMING
COMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMINGCOMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMING
COMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMINGInfinity Tech Solutions
 

More from Infinity Tech Solutions (20)

Database management system session 6
Database management system session 6Database management system session 6
Database management system session 6
 
Database Management System-session1-2
Database Management System-session1-2Database Management System-session1-2
Database Management System-session1-2
 
E commerce
E commerce E commerce
E commerce
 
E commerce
E commerceE commerce
E commerce
 
Bds session 13 14
Bds session 13 14Bds session 13 14
Bds session 13 14
 
Computer memory, Types of programming languages
Computer memory, Types of programming languagesComputer memory, Types of programming languages
Computer memory, Types of programming languages
 
Basic hardware familiarization
Basic hardware familiarizationBasic hardware familiarization
Basic hardware familiarization
 
Programming with matlab session 6
Programming with matlab session 6Programming with matlab session 6
Programming with matlab session 6
 
AI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime SectorAI/ML/DL/BCT A Revolution in Maritime Sector
AI/ML/DL/BCT A Revolution in Maritime Sector
 
Programming with matlab session 5 looping
Programming with matlab session 5 loopingProgramming with matlab session 5 looping
Programming with matlab session 5 looping
 
BIG DATA Session 7 8
BIG DATA Session 7 8BIG DATA Session 7 8
BIG DATA Session 7 8
 
BIG DATA Session 6
BIG DATA Session 6BIG DATA Session 6
BIG DATA Session 6
 
MS word
MS word MS word
MS word
 
DBMS CS 4-5
DBMS CS 4-5DBMS CS 4-5
DBMS CS 4-5
 
DBMS CS1-2
DBMS  CS1-2DBMS  CS1-2
DBMS CS1-2
 
Programming with matlab session 2
Programming with matlab session 2Programming with matlab session 2
Programming with matlab session 2
 
Programming with matlab session 1
Programming with matlab session 1Programming with matlab session 1
Programming with matlab session 1
 
COMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMING
COMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMINGCOMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMING
COMPUTER CONCEPTS AND FUNDAMENTALS OF PROGRAMMING
 
Network Security CS2
Network Security CS2Network Security CS2
Network Security CS2
 
Ntewrok secuirty cs1
Ntewrok secuirty cs1Ntewrok secuirty cs1
Ntewrok secuirty cs1
 

Recently uploaded

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 

Recently uploaded (20)

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 

Database Management System-session 3-4-5

  • 1. DBDA (Database Design and Applications) CH3 By: Prof. Ganesh Ingle
  • 2. Session objective INTRODUCTION Relational Query Languages Formal Query Languages Introduction to relational algebra Set Operators Join operator Aggregate functions,Grouping Relational Calculus concepts Introduction to Structured Query Language (SQL) Features of SQL,DDL Statements
  • 3. Relational Query Languages Relational Algebra: Relational algebra is a procedural query language, which takes instances of relations as input and yields instances of relations as output. It uses operators to perform queries. An operator can be either unary or binary. They accept relations as their input and yield relations as their output. Relational algebra is performed recursively on a relation and intermediate results are also considered relations. The fundamental operations of relational algebra are as follows − Select Project Union Set different Cartesian product Rename
  • 4. Relational Query Languages Relational Algebra: In Non-procedural query language, user instructs the system to produce the desired result without telling the step by step process. Here users tells what data to be retrieved from database but doesn't tell how to retrieve it. In procedural query language, user instructs the system to perform a series of operations to produce the desired results. Here users tells what data to be retrieved from database and how to retrieve it. ... then it is a procedural language.
  • 5. Relational Query Languages Relational Model vs RDBMS: Relation Model RDBMS RA,RC SQL Algo Code Conceptual Real time Theoretical Practical
  • 6. Introduction to relational algebra Relational algebra: Its formal query language associated with relational model
  • 7. Introduction to relational algebra Select: SELECT (σ) The SELECT operation is used for selecting a subset of the tuples according to a given selection condition. Sigma(σ)Symbol denotes it. It is used as an expression to choose tuples which meet the selection condition. Select operator selects tuples that satisfy a given predicate.
  • 8. Introduction to relational algebra Select: Query1: Find the details of account having balance >=10000? Query2: Find the details of Customer who lives in Pune? Query3: Find the details of those loan having amount <=5000? and from Pimpri branch Query4: Find the details of those branch details which are in Pune and having assets more than 10L
  • 9. Introduction to relational algebra Project: Project(∏)
  • 10. Introduction to relational algebra Project: Query1: Find all the Branch_Name of bank Query2: Find all the account numbers wit its balance? Query3: Find the names of all the customers who have loan? Query1: Find all the details of branch?
  • 11. Introduction to relational algebra Project : Select combination Query1: Find those account where balance is less than 1000? Query2: Find those loan numbers which are from pune branch with amount >1000? Query3: Find the branch name and branch city with assets more than 100000?
  • 12. Introduction to relational algebra Union (∪)/Intersection (∩)/ Difference (−) Query1: Find names of those customer having account or loan or both? Query2: Find names of a branch who have account but not loan Query3: Find the names of those customer who neither loan or an account?
  • 13. Introduction to relational algebra Cartesian Product The Cartesian Product is also an operator which works on two sets. It is sometimes called the CROSS PRODUCT or CROSS JOIN. It combines the tuples of one relation with all the tuples of the other relation. Account AAN BNo Bal 101 x 50 102 y 70 103 z 100 Deposit CN DAN 1 101 2 102 3 103 Account X Deposit Account X Deposit AAN BNo Bal CN DAN 101 x 50 1 101 101 x 50 2 102 101 x 50 3 103 102 y 70 1 101 102 y 70 2 102 102 y 70 3 103 103 z 100 1 101 103 z 100 2 102 103 z 100 3 103 Query: Find CustomerName having account balance<100
  • 14. Introduction to relational algebra Aggregate or Set Functions • Aggregate or Set functions are introduced to relational algebra to increase its expressive power. • An aggregate function operates on a set of values (tuples) and computes one single value as output. • • The Set Functions in Relational Algebra  sum(): computes the sum of all values in the (numeric) set  avg(): computes the average of all values in the (numeric) set  max(): finds the maximum value of all values in the set  min(): finds the minimum value of all values in the set  any(): returns TRUE if set is not empty, otherwise (i.e., empty set), returns FALSE  count(): returns the cardinaility (number of elements) in the set
  • 15. Introduction to relational algebra Aggregate or Set Functions Query1: Find the sum of assets of all banches Query2: Count distinct customer name having accounts Query2: Find the branch city wise max assets?
  • 16. Introduction to relational algebra Joins
  • 17. Joins : Joins Inner Join: o/p or result contains matching tuples Types:= 1.Theta Join 2.Equi-Join 3.Natural Join Outer join : All the rows from both or any relations Types := 1.Left outer 2.Right outer 3.Full outer
  • 18. Introduction to relational algebra Theta Joins
  • 19. Introduction to relational algebra Joins
  • 20. Introduction to relational algebra EQUI Joins
  • 21. Introduction to relational algebra Joins
  • 22. Introduction to relational algebra Outer Joins
  • 23. Introduction to relational algebra Left Outer Joins
  • 24. Introduction to relational algebra Right Outer Joins
  • 25. Introduction to relational algebra Full Outer Joins
  • 26. Introduction to relational algebra Joins
  • 27. Introduction to relational algebra Division
  • 28. Introduction to relational algebra Division
  • 29. Introduction to relational algebra Division
  • 30. Introduction to relational algebra Division