SlideShare a Scribd company logo
Oracle Database, SQL
Day 3
Trainers:
Gurpreet Singh
Oracle Database, SQL2
Day 3 Agenda
Oracle Database, SQL3
Joins
An SQL JOIN clause combines columns from one or more tables in a relational database. It creates a set that can
be saved as a table or used as it is. A JOIN is a means for combining columns from one (self-table) or more
tables by using values common to each.
Let’s say we have two sets of data in our relational database: table A and table B, with some sort of relation
specified by primary and foreign keys. The result of joining these tables together can be visually represented by
the following diagram:
Oracle Database, SQL4
Joins
The extent of the overlap, if any, is determined by how many records in Table A match the records in Table B.
Depending on what subset of data we would like to select from the two tables, the four join types can be
visualized by highlighting the corresponding sections of the Venn diagram:
Oracle Database, SQL5
Joins
The extent of the overlap, if any, is determined by how many records in Table A match the records in Table B.
Depending on what subset of data we would like to select from the two tables, the four join types can be
visualized by highlighting the corresponding sections of the Venn diagram:
Oracle Database, SQL6
JoinsImagine you’re running a store and would like to record information about your customers and their orders. By
using a relational database, you can save this information as two tables that represent two distinct entities:
customers and orders.
CUSTOMERS
ORDERS
Oracle Database, SQL7
Joins
Note that the orders table contains two keys: one for the order and one for the customer who placed that
order. In scenarios when there are multiple keys in a table, the key that refers to the entity being described
in that table is called the Primary Key (PK) and other key is called a Foreign Key (FK).
In our example, order_id is a primary key in the orders table, while customer_id is both a primary key in the
customers table, and a foreign key in the orders table. Primary and foreign keys are essential to describing
relations between the tables, and in performing SQL joins.
Oracle Database, SQL8
Oracle Database, SQL9
Oracle Database, SQL10
Oracle Database, SQL11
Oracle Database, SQL12
Sub Queries
A sub query is a SQL query nested inside a larger query.
A sub query may occur in :
- A SELECT clause
- A FROM clause
- A WHERE clause
The sub query can be nested inside a SELECT, INSERT, UPDATE, or DELETE statement or inside another sub
query.
A sub query is usually added within the WHERE Clause of another SQL SELECT statement.
You can use the comparison operators, such as >, <, or =. The comparison operator can also be a multiple-
row operator, such as IN, ANY, or ALL.
A sub query is also called an inner query or inner select, while the statement containing a sub query is also
called an outer query or outer select.
The inner query executes first before its parent query so that the results of an inner query can be passed to
the outer query.
You can use a sub query in a SELECT, INSERT, DELETE, or UPDATE statement to perform the following tasks:
 Compare an expression to the result of the query.
 Determine if an expression is included in the results of the query.
 Check whether the query selects any rows.
Oracle Database, SQL13
Sub Queries
• The sub query (inner query) executes once before the main query (outer query)
executes.
• The main query (outer query) use the sub query result.
Oracle Database, SQL14
Sub Queries
There are some guidelines to consider when using sub queries :
 A sub query must be enclosed in parentheses.
 A sub query must be placed on the right side of the comparison operator.
 Sub queries cannot manipulate their results internally, therefore ORDER BY
clause cannot be added into a sub query. You can use an ORDER BY clause in
the main SELECT statement (outer query) which will be the last clause.
 Use single-row operators with single-row sub queries.
 If a sub query (inner query) returns a null value to the outer query, the outer
query will not return any rows when using certain comparison operators in a
WHERE clause.
Oracle Database, SQL15
Sub Queries
Types of Sub Queries:
 Single row sub query : Returns zero or one row.
 Multiple row sub query : Returns one or more rows.
 Multiple column sub queries : Returns one or more columns.
 Correlated sub queries : Reference one or more columns in the outer SQL
statement. The sub query is known as a correlated sub query because the sub
query is related to the outer SQL statement.
 Nested sub queries : Sub queries are placed within another sub query.
Oracle Database, SQL16
Sub Queries
A single row sub query returns zero or one row to the outer SQL statement. You can place
a sub query in a WHERE clause, a HAVING clause, or a FROM clause of a SELECT
statement.
Oracle Database, SQL17
Sub Queries
Multiple row sub query returns one or more rows to the outer SQL statement. You may use
the IN, ANY, or ALL operator in outer query to handle a sub query that returns multiple
rows.
You can use the ANY operator to compare a value with any value in a list. You must place
an =, <>, >, <, <= or >= operator before ANY in your query. The following example uses
ANY to check if any of the agent who belongs to the country 'UK'.
Oracle Database, SQL18
Sub Queries
Multiple column sub query returns more than one columns to the outer SQL statement.
Oracle Database, SQL19
Sub Queries
SQL Correlated Sub queries are used to select data from a table referenced in the outer
query. The sub query is known as a correlated because the sub query is related to the outer
query. In this type of queries, a table alias (also called a correlation name) must be used to
specify which table reference is to be used.
The alias is the pet name of a table which is brought about by putting directly after the
table name in the FROM clause. This is suitable when anybody wants to obtain information
from two separate tables.
Oracle Database, SQL20
Sub Queries
A sub query can be nested inside other sub queries. SQL has an ability to nest queries
within one another. A sub query is a SELECT statement that is nested within another
SELECT statement and which return intermediate results. SQL executes innermost sub
query first, then next level.
CONTACTS
21
Gurpreet Singh
Senior Software Engineer
CUG. 2142
M. +91-9803723925
Gurpreet.singh2@soprasteria.com
Oracle Database, SQL
Oracle Database, SQL22

More Related Content

What's hot

Ch04
Ch04Ch04
Ch04
cs19club
 
Sql coding-standard-sqlserver
Sql coding-standard-sqlserverSql coding-standard-sqlserver
Sql coding-standard-sqlserver
lochaaaa
 
Oracle 11G Development Training noida Delhi NCR
Oracle 11G Development Training noida Delhi NCROracle 11G Development Training noida Delhi NCR
Oracle 11G Development Training noida Delhi NCR
Shri Prakash Pandey
 
Les05 (Displaying Data from Multiple Table)
Les05 (Displaying Data from Multiple Table)Les05 (Displaying Data from Multiple Table)
Les05 (Displaying Data from Multiple Table)
Achmad Solichin
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
Divyank Jindal
 
Etl2
Etl2Etl2
Sq lite
Sq liteSq lite
Internet Environment
Internet  EnvironmentInternet  Environment
Internet Environmentguest8fdbdd
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Amanda Lam
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
Swapnali Pawar
 
Oracle report from ppt
Oracle report from pptOracle report from ppt
Oracle report from ppt
kingshuk_goswami
 
10 sql tips
10 sql tips10 sql tips
10 sql tips
Yogui Osasuno
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
oracle documents
 
Oracle sql joins
Oracle sql joinsOracle sql joins
Oracle sql joins
redro
 
Oraclesql
OraclesqlOraclesql
Oraclesql
Priya Goyal
 

What's hot (20)

Ch04
Ch04Ch04
Ch04
 
Sql coding-standard-sqlserver
Sql coding-standard-sqlserverSql coding-standard-sqlserver
Sql coding-standard-sqlserver
 
Oracle 11G Development Training noida Delhi NCR
Oracle 11G Development Training noida Delhi NCROracle 11G Development Training noida Delhi NCR
Oracle 11G Development Training noida Delhi NCR
 
Les05 (Displaying Data from Multiple Table)
Les05 (Displaying Data from Multiple Table)Les05 (Displaying Data from Multiple Table)
Les05 (Displaying Data from Multiple Table)
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Etl2
Etl2Etl2
Etl2
 
Sq lite
Sq liteSq lite
Sq lite
 
Mysql cheatsheet
Mysql cheatsheetMysql cheatsheet
Mysql cheatsheet
 
Index Tuning
Index TuningIndex Tuning
Index Tuning
 
Internet Environment
Internet  EnvironmentInternet  Environment
Internet Environment
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Oracle report from ppt
Oracle report from pptOracle report from ppt
Oracle report from ppt
 
10 sql tips
10 sql tips10 sql tips
10 sql tips
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
 
Oracle sql joins
Oracle sql joinsOracle sql joins
Oracle sql joins
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Using T-SQL
Using T-SQL Using T-SQL
Using T-SQL
 
SQL Server Views
SQL Server ViewsSQL Server Views
SQL Server Views
 

Similar to Oracle SQL Part 3

Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server iiIblesoft
 
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQueryPPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
Abhishek590097
 
Assignment 3
Assignment 3Assignment 3
Assignment 3
SneaK3
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Training
bixxman
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
DraguClaudiu
 
SQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptxSQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptx
ssuser6bf2d1
 
MSSQL_Book.pdf
MSSQL_Book.pdfMSSQL_Book.pdf
MSSQL_Book.pdf
DubsmashTamizhan
 
SQL Query
SQL QuerySQL Query
SQL Query
Imam340267
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
Nalina Kumari
 
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
Edgar Alejandro Villegas
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
jainendraKUMAR55
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
Ahsan Kabir
 
Adbms
AdbmsAdbms
Adbms
jass12345
 
Structure Query Language (SQL).pptx
Structure Query Language (SQL).pptxStructure Query Language (SQL).pptx
Structure Query Language (SQL).pptx
NalinaKumari2
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuning
Anil Pandey
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
Dev Chauhan
 

Similar to Oracle SQL Part 3 (20)

Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server ii
 
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQueryPPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
 
Assignment 3
Assignment 3Assignment 3
Assignment 3
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Training
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
 
SQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptxSQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptx
 
MSSQL_Book.pdf
MSSQL_Book.pdfMSSQL_Book.pdf
MSSQL_Book.pdf
 
Hira
HiraHira
Hira
 
Query
QueryQuery
Query
 
Sql joins
Sql joinsSql joins
Sql joins
 
SQL Query
SQL QuerySQL Query
SQL Query
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
 
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
 
Adbms
AdbmsAdbms
Adbms
 
Structure Query Language (SQL).pptx
Structure Query Language (SQL).pptxStructure Query Language (SQL).pptx
Structure Query Language (SQL).pptx
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuning
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
 

More from Gurpreet singh

Creating ESS Jobs for Oracle Fusion BIP Reports
Creating ESS Jobs for Oracle Fusion BIP ReportsCreating ESS Jobs for Oracle Fusion BIP Reports
Creating ESS Jobs for Oracle Fusion BIP Reports
Gurpreet singh
 
Introduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingIntroduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP Reporting
Gurpreet singh
 
Why Messaging system?
Why Messaging system?Why Messaging system?
Why Messaging system?
Gurpreet singh
 
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
Gurpreet singh
 
Oracle Application Developmenr Framework
Oracle Application Developmenr FrameworkOracle Application Developmenr Framework
Oracle Application Developmenr Framework
Gurpreet singh
 
Java Servlet part 3
Java Servlet part 3Java Servlet part 3
Java Servlet part 3
Gurpreet singh
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in Java
Gurpreet singh
 
IO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxingIO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxing
Gurpreet singh
 
Java Servlets Part 2
Java Servlets Part 2Java Servlets Part 2
Java Servlets Part 2
Gurpreet singh
 
Creating business group in oracle apps
Creating business group in oracle appsCreating business group in oracle apps
Creating business group in oracle apps
Gurpreet singh
 
Defing locations in Oracle Apps
Defing locations in Oracle AppsDefing locations in Oracle Apps
Defing locations in Oracle Apps
Gurpreet singh
 
Assigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYSTAssigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYST
Gurpreet singh
 
PL/SQL Part 5
PL/SQL Part 5PL/SQL Part 5
PL/SQL Part 5
Gurpreet singh
 
PL/SQL Part 3
PL/SQL Part 3PL/SQL Part 3
PL/SQL Part 3
Gurpreet singh
 
PL/SQL Part 2
PL/SQL Part 2PL/SQL Part 2
PL/SQL Part 2
Gurpreet singh
 
PL/SQL Part 1
PL/SQL Part 1PL/SQL Part 1
PL/SQL Part 1
Gurpreet singh
 
Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)
Gurpreet singh
 
Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)
Gurpreet singh
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
Gurpreet singh
 
Learn Java Part 11
Learn Java Part 11Learn Java Part 11
Learn Java Part 11
Gurpreet singh
 

More from Gurpreet singh (20)

Creating ESS Jobs for Oracle Fusion BIP Reports
Creating ESS Jobs for Oracle Fusion BIP ReportsCreating ESS Jobs for Oracle Fusion BIP Reports
Creating ESS Jobs for Oracle Fusion BIP Reports
 
Introduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingIntroduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP Reporting
 
Why Messaging system?
Why Messaging system?Why Messaging system?
Why Messaging system?
 
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...Understanding Flex Fields with  Accounting Flexfields(Chart of Accounts) in O...
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...
 
Oracle Application Developmenr Framework
Oracle Application Developmenr FrameworkOracle Application Developmenr Framework
Oracle Application Developmenr Framework
 
Java Servlet part 3
Java Servlet part 3Java Servlet part 3
Java Servlet part 3
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in Java
 
IO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxingIO Streams, Serialization, de-serialization, autoboxing
IO Streams, Serialization, de-serialization, autoboxing
 
Java Servlets Part 2
Java Servlets Part 2Java Servlets Part 2
Java Servlets Part 2
 
Creating business group in oracle apps
Creating business group in oracle appsCreating business group in oracle apps
Creating business group in oracle apps
 
Defing locations in Oracle Apps
Defing locations in Oracle AppsDefing locations in Oracle Apps
Defing locations in Oracle Apps
 
Assigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYSTAssigning role AME_BUS_ANALYST
Assigning role AME_BUS_ANALYST
 
PL/SQL Part 5
PL/SQL Part 5PL/SQL Part 5
PL/SQL Part 5
 
PL/SQL Part 3
PL/SQL Part 3PL/SQL Part 3
PL/SQL Part 3
 
PL/SQL Part 2
PL/SQL Part 2PL/SQL Part 2
PL/SQL Part 2
 
PL/SQL Part 1
PL/SQL Part 1PL/SQL Part 1
PL/SQL Part 1
 
Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)Introduction to Data Flow Diagram (DFD)
Introduction to Data Flow Diagram (DFD)
 
Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)Ingenium test(Exam Management System) Project Presentation (Full)
Ingenium test(Exam Management System) Project Presentation (Full)
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
 
Learn Java Part 11
Learn Java Part 11Learn Java Part 11
Learn Java Part 11
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Oracle SQL Part 3

  • 1. Oracle Database, SQL Day 3 Trainers: Gurpreet Singh
  • 3. Oracle Database, SQL3 Joins An SQL JOIN clause combines columns from one or more tables in a relational database. It creates a set that can be saved as a table or used as it is. A JOIN is a means for combining columns from one (self-table) or more tables by using values common to each. Let’s say we have two sets of data in our relational database: table A and table B, with some sort of relation specified by primary and foreign keys. The result of joining these tables together can be visually represented by the following diagram:
  • 4. Oracle Database, SQL4 Joins The extent of the overlap, if any, is determined by how many records in Table A match the records in Table B. Depending on what subset of data we would like to select from the two tables, the four join types can be visualized by highlighting the corresponding sections of the Venn diagram:
  • 5. Oracle Database, SQL5 Joins The extent of the overlap, if any, is determined by how many records in Table A match the records in Table B. Depending on what subset of data we would like to select from the two tables, the four join types can be visualized by highlighting the corresponding sections of the Venn diagram:
  • 6. Oracle Database, SQL6 JoinsImagine you’re running a store and would like to record information about your customers and their orders. By using a relational database, you can save this information as two tables that represent two distinct entities: customers and orders. CUSTOMERS ORDERS
  • 7. Oracle Database, SQL7 Joins Note that the orders table contains two keys: one for the order and one for the customer who placed that order. In scenarios when there are multiple keys in a table, the key that refers to the entity being described in that table is called the Primary Key (PK) and other key is called a Foreign Key (FK). In our example, order_id is a primary key in the orders table, while customer_id is both a primary key in the customers table, and a foreign key in the orders table. Primary and foreign keys are essential to describing relations between the tables, and in performing SQL joins.
  • 12. Oracle Database, SQL12 Sub Queries A sub query is a SQL query nested inside a larger query. A sub query may occur in : - A SELECT clause - A FROM clause - A WHERE clause The sub query can be nested inside a SELECT, INSERT, UPDATE, or DELETE statement or inside another sub query. A sub query is usually added within the WHERE Clause of another SQL SELECT statement. You can use the comparison operators, such as >, <, or =. The comparison operator can also be a multiple- row operator, such as IN, ANY, or ALL. A sub query is also called an inner query or inner select, while the statement containing a sub query is also called an outer query or outer select. The inner query executes first before its parent query so that the results of an inner query can be passed to the outer query. You can use a sub query in a SELECT, INSERT, DELETE, or UPDATE statement to perform the following tasks:  Compare an expression to the result of the query.  Determine if an expression is included in the results of the query.  Check whether the query selects any rows.
  • 13. Oracle Database, SQL13 Sub Queries • The sub query (inner query) executes once before the main query (outer query) executes. • The main query (outer query) use the sub query result.
  • 14. Oracle Database, SQL14 Sub Queries There are some guidelines to consider when using sub queries :  A sub query must be enclosed in parentheses.  A sub query must be placed on the right side of the comparison operator.  Sub queries cannot manipulate their results internally, therefore ORDER BY clause cannot be added into a sub query. You can use an ORDER BY clause in the main SELECT statement (outer query) which will be the last clause.  Use single-row operators with single-row sub queries.  If a sub query (inner query) returns a null value to the outer query, the outer query will not return any rows when using certain comparison operators in a WHERE clause.
  • 15. Oracle Database, SQL15 Sub Queries Types of Sub Queries:  Single row sub query : Returns zero or one row.  Multiple row sub query : Returns one or more rows.  Multiple column sub queries : Returns one or more columns.  Correlated sub queries : Reference one or more columns in the outer SQL statement. The sub query is known as a correlated sub query because the sub query is related to the outer SQL statement.  Nested sub queries : Sub queries are placed within another sub query.
  • 16. Oracle Database, SQL16 Sub Queries A single row sub query returns zero or one row to the outer SQL statement. You can place a sub query in a WHERE clause, a HAVING clause, or a FROM clause of a SELECT statement.
  • 17. Oracle Database, SQL17 Sub Queries Multiple row sub query returns one or more rows to the outer SQL statement. You may use the IN, ANY, or ALL operator in outer query to handle a sub query that returns multiple rows. You can use the ANY operator to compare a value with any value in a list. You must place an =, <>, >, <, <= or >= operator before ANY in your query. The following example uses ANY to check if any of the agent who belongs to the country 'UK'.
  • 18. Oracle Database, SQL18 Sub Queries Multiple column sub query returns more than one columns to the outer SQL statement.
  • 19. Oracle Database, SQL19 Sub Queries SQL Correlated Sub queries are used to select data from a table referenced in the outer query. The sub query is known as a correlated because the sub query is related to the outer query. In this type of queries, a table alias (also called a correlation name) must be used to specify which table reference is to be used. The alias is the pet name of a table which is brought about by putting directly after the table name in the FROM clause. This is suitable when anybody wants to obtain information from two separate tables.
  • 20. Oracle Database, SQL20 Sub Queries A sub query can be nested inside other sub queries. SQL has an ability to nest queries within one another. A sub query is a SELECT statement that is nested within another SELECT statement and which return intermediate results. SQL executes innermost sub query first, then next level.
  • 21. CONTACTS 21 Gurpreet Singh Senior Software Engineer CUG. 2142 M. +91-9803723925 Gurpreet.singh2@soprasteria.com Oracle Database, SQL