SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Displaying Data  from Multiple Tables
Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object]
Obtaining Data from Multiple Tables EMPLOYEES   DEPARTMENTS  … …
Cartesian Products ,[object Object],[object Object],[object Object],[object Object],[object Object]
Generating a Cartesian Product EMPLOYEES   (20 rows) DEPARTMENTS   (8 rows) … … Cartesian product:  20x8=160 rows
[object Object],[object Object],[object Object],[object Object],Types of Joins ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Joining Tables Using Oracle Syntax ,[object Object],[object Object],[object Object],SELECT table1.column, table2.column FROM table1, table2 WHERE table1.column1  =  table2.column2;
What is an Equijoin? EMPLOYEES   DEPARTMENTS  … … Foreign key Primary key
Retrieving Records  with Equijoins SELECT employees.employee_id, employees.last_name,  employees.department_id, departments.department_id, departments.location_id FROM  employees, departments WHERE  employees.department_id = departments.department_id; …
Additional Search Conditions Using the  AND  Operator  EMPLOYEES   DEPARTMENTS   … …
Qualifying Ambiguous  Column Names ,[object Object],[object Object],[object Object]
Using Table Aliases ,[object Object],[object Object],SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id FROM  employees e , departments d WHERE  e.department_id = d.department_id;
Joining More than Two Tables ,[object Object],EMPLOYEES   LOCATIONS   DEPARTMENTS   …
Non-Equijoins EMPLOYEES JOB_GRADES … Salary in the  EMPLOYEES   table must be between  lowest salary and highest  salary in the  JOB_GRADES table.
Retrieving Records  with Non-Equijoins SELECT e.last_name, e.salary, j.grade_level FROM  employees e, job_grades j WHERE  e.salary  BETWEEN j.lowest_sal AND j.highest_sal; …
Outer Joins EMPLOYEES DEPARTMENTS … There are no employees in department 190.
Outer Joins Syntax ,[object Object],[object Object],SELECT table1.column, table2.column FROM table1, table2 WHERE table1.column (+)   =  table2.column; SELECT table1.column, table2.column FROM table1, table2 WHERE table1.column  =  table2.column (+) ;
Using Outer Joins SELECT e.last_name, e.department_id, d.department_name FROM  employees e, departments d WHERE  e.department_id(+) = d.department_id ;   …
Self Joins EMPLOYEES (WORKER) EMPLOYEES (MANAGER) … … MANAGER_ID  in the  WORKER  table is equal to  EMPLOYEE_ID  in the  MANAGER  table.
Joining a Table to Itself SELECT worker.last_name || ' works for '  || manager.last_name FROM  employees worker, employees manager WHERE  worker.manager_id = manager.employee_id ; …
Practice 4, Part One: Overview ,[object Object],[object Object]
Joining Tables Using SQL: 1999 Syntax ,[object Object],SELECT table1.column, table2.column FROM table1 [CROSS JOIN  table2 ] | [NATURAL JOIN  table2 ] | [JOIN  table2  USING ( column_name )] | [JOIN  table2   ON( table1.column_name  =  table2.column_name )] | [LEFT|RIGHT|FULL OUTER JOIN  table2   ON ( table1.column_name  =  table2.column_name )];
Creating Cross Joins ,[object Object],[object Object],SELECT last_name, department_name FROM  employees CROSS JOIN departments ; …
Creating Natural Joins ,[object Object],[object Object],[object Object]
Retrieving Records with Natural Joins SELECT department_id, department_name, location_id, city FROM  departments NATURAL JOIN locations ;
Creating Joins with the  USING  Clause ,[object Object],[object Object],[object Object],[object Object]
Retrieving Records with the  USING  Clause SELECT e.employee_id, e.last_name, d.location_id FROM  employees e JOIN departments d USING (department_id) ; …
Creating Joins with the  ON  Clause ,[object Object],[object Object],[object Object],[object Object]
Retrieving Records with the  ON  Clause SELECT e.employee_id, e.last_name, e.department_id,  d.department_id, d.location_id FROM  employees e JOIN departments d ON  (e.department_id = d.department_id); …
Creating Three-Way Joins with  the  ON  Clause SELECT employee_id, city, department_name FROM  employees e  JOIN  departments d ON  d.department_id = e.department_id  JOIN  locations l ON  d.location_id = l.location_id; …
INNER  Versus  OUTER  Joins ,[object Object],[object Object],[object Object]
LEFT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM  employees e LEFT OUTER JOIN departments d ON  (e.department_id = d.department_id) ; …
RIGHT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM  employees e RIGHT OUTER JOIN departments d ON  (e.department_id = d.department_id) ; …
FULL OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM  employees e FULL OUTER JOIN departments d ON  (e.department_id = d.department_id) ; …
Additional Conditions SELECT e.employee_id, e.last_name, e.department_id,  d.department_id, d.location_id FROM  employees e JOIN departments d ON  (e.department_id = d.department_id) AND  e.manager_id = 149 ;
Summary ,[object Object],[object Object],[object Object],[object Object]
Practice 4, Part Two: Overview ,[object Object],[object Object],[object Object],[object Object]
 
 
 
 
 
 
 

Weitere ähnliche Inhalte

Was ist angesagt? (18)

e computer notes - Using set operator
e computer notes - Using set operatore computer notes - Using set operator
e computer notes - Using set operator
 
MULTIPLE TABLES
MULTIPLE TABLES MULTIPLE TABLES
MULTIPLE TABLES
 
SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables
 
Oracle sql joins
Oracle sql joinsOracle sql joins
Oracle sql joins
 
e computer notes - Advanced subqueries
e computer notes - Advanced subqueriese computer notes - Advanced subqueries
e computer notes - Advanced subqueries
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
Database Joins
Database JoinsDatabase Joins
Database Joins
 
Dump Answers
Dump AnswersDump Answers
Dump Answers
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
Restricting and sorting data
Restricting and sorting dataRestricting and sorting data
Restricting and sorting data
 
1 z0 047
1 z0 0471 z0 047
1 z0 047
 
Les18
Les18Les18
Les18
 
SQL(database)
SQL(database)SQL(database)
SQL(database)
 
Les04
Les04Les04
Les04
 
Les04
Les04Les04
Les04
 
Les02
Les02Les02
Les02
 
Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库
 

Andere mochten auch

Andere mochten auch (8)

Les19
Les19Les19
Les19
 
Les03
Les03Les03
Les03
 
Les06
Les06Les06
Les06
 
Les05
Les05Les05
Les05
 
Les08
Les08Les08
Les08
 
Les20
Les20Les20
Les20
 
Advanced functions in PL SQL
Advanced functions in PL SQLAdvanced functions in PL SQL
Advanced functions in PL SQL
 
Oracle sql developer_slides
Oracle sql developer_slidesOracle sql developer_slides
Oracle sql developer_slides
 

Ähnlich wie Les04

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
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tablesSyed Zaid Irshad
 
e computer notes - From multiple tables
e computer notes - From multiple tablese computer notes - From multiple tables
e computer notes - From multiple tablesecomputernotes
 
Day-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptxDay-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptxuzmasulthana3
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive TechandMate
 
Displaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data BaseDisplaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data BaseSalman Memon
 
SQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptxSQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptxssuser6bf2d1
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle DatabaseChhom Karath
 
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) .pptxjainendraKUMAR55
 
Join in SQL - Inner, Self, Outer Join
Join in SQL - Inner, Self, Outer JoinJoin in SQL - Inner, Self, Outer Join
Join in SQL - Inner, Self, Outer JoinSouma Maiti
 

Ähnlich wie Les04 (20)

Les05 (Displaying Data from Multiple Table)
Les05 (Displaying Data from Multiple Table)Les05 (Displaying Data from Multiple Table)
Les05 (Displaying Data from Multiple Table)
 
App C
App CApp C
App C
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables
 
e computer notes - From multiple tables
e computer notes - From multiple tablese computer notes - From multiple tables
e computer notes - From multiple tables
 
Day-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptxDay-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptx
 
Join sql
Join sqlJoin sql
Join sql
 
Sql join
Sql  joinSql  join
Sql join
 
SQL Server Learning Drive
SQL Server Learning Drive SQL Server Learning Drive
SQL Server Learning Drive
 
Joins.ppt
Joins.pptJoins.ppt
Joins.ppt
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
Lab4 join - all types listed
Lab4   join - all types listedLab4   join - all types listed
Lab4 join - all types listed
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Module03
Module03Module03
Module03
 
Displaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data BaseDisplaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data Base
 
SQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptxSQLSERVERQUERIES.pptx
SQLSERVERQUERIES.pptx
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle Database
 
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
 
SQL report
SQL reportSQL report
SQL report
 
Join in SQL - Inner, Self, Outer Join
Join in SQL - Inner, Self, Outer JoinJoin in SQL - Inner, Self, Outer Join
Join in SQL - Inner, Self, Outer Join
 

Mehr von Vijay Kumar (9)

Les17
Les17Les17
Les17
 
Les16
Les16Les16
Les16
 
Les14
Les14Les14
Les14
 
Les13
Les13Les13
Les13
 
Les12
Les12Les12
Les12
 
Les10
Les10Les10
Les10
 
Les11
Les11Les11
Les11
 
Les07
Les07Les07
Les07
 
Les09
Les09Les09
Les09
 

Kürzlich hochgeladen

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Les04

  • 1. Displaying Data from Multiple Tables
  • 2.
  • 3. Obtaining Data from Multiple Tables EMPLOYEES DEPARTMENTS … …
  • 4.
  • 5. Generating a Cartesian Product EMPLOYEES (20 rows) DEPARTMENTS (8 rows) … … Cartesian product: 20x8=160 rows
  • 6.
  • 7.
  • 8. What is an Equijoin? EMPLOYEES DEPARTMENTS … … Foreign key Primary key
  • 9. Retrieving Records with Equijoins SELECT employees.employee_id, employees.last_name, employees.department_id, departments.department_id, departments.location_id FROM employees, departments WHERE employees.department_id = departments.department_id; …
  • 10. Additional Search Conditions Using the AND Operator EMPLOYEES DEPARTMENTS … …
  • 11.
  • 12.
  • 13.
  • 14. Non-Equijoins EMPLOYEES JOB_GRADES … Salary in the EMPLOYEES table must be between lowest salary and highest salary in the JOB_GRADES table.
  • 15. Retrieving Records with Non-Equijoins SELECT e.last_name, e.salary, j.grade_level FROM employees e, job_grades j WHERE e.salary BETWEEN j.lowest_sal AND j.highest_sal; …
  • 16. Outer Joins EMPLOYEES DEPARTMENTS … There are no employees in department 190.
  • 17.
  • 18. Using Outer Joins SELECT e.last_name, e.department_id, d.department_name FROM employees e, departments d WHERE e.department_id(+) = d.department_id ; …
  • 19. Self Joins EMPLOYEES (WORKER) EMPLOYEES (MANAGER) … … MANAGER_ID in the WORKER table is equal to EMPLOYEE_ID in the MANAGER table.
  • 20. Joining a Table to Itself SELECT worker.last_name || ' works for ' || manager.last_name FROM employees worker, employees manager WHERE worker.manager_id = manager.employee_id ; …
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Retrieving Records with Natural Joins SELECT department_id, department_name, location_id, city FROM departments NATURAL JOIN locations ;
  • 26.
  • 27. Retrieving Records with the USING Clause SELECT e.employee_id, e.last_name, d.location_id FROM employees e JOIN departments d USING (department_id) ; …
  • 28.
  • 29. Retrieving Records with the ON Clause SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id FROM employees e JOIN departments d ON (e.department_id = d.department_id); …
  • 30. Creating Three-Way Joins with the ON Clause SELECT employee_id, city, department_name FROM employees e JOIN departments d ON d.department_id = e.department_id JOIN locations l ON d.location_id = l.location_id; …
  • 31.
  • 32. LEFT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id) ; …
  • 33. RIGHT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id) ; …
  • 34. FULL OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM employees e FULL OUTER JOIN departments d ON (e.department_id = d.department_id) ; …
  • 35. Additional Conditions SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id FROM employees e JOIN departments d ON (e.department_id = d.department_id) AND e.manager_id = 149 ;
  • 36.
  • 37.
  • 38.  
  • 39.  
  • 40.  
  • 41.  
  • 42.  
  • 43.  
  • 44.  

Hinweis der Redaktion

  1. Schedule: Timing Topic 55 minutes Lecture 55 minutes Practice 110 minutes Total