1 Copyright © 2009, Oracle. All rights reserved. B Table Descriptions.

Slides:



Advertisements
Similar presentations
Sometimes you need to use data from more than one table. In example1, the report displays data from two separate tables. Employee IDs exist in the EMPLOYEES.
Advertisements

Displaying Data from Multiple Tables
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
ORACLE Lecture 1: Oracle 11g Introduction & Installation.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
5 Copyright © 2004, Oracle. All rights reserved. Displaying Data from Multiple Tables.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
4 Copyright © Oracle Corporation, All rights reserved. Displaying Data from Multiple Tables.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Displaying Data from Multiple Tables. Obtaining Data from Multiple Tables Sometimes you need to use data from more than one table. In the example, the.
Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data from more than one table using.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
XP New Perspectives on Introducing Microsoft Office XP Tutorial 1 1 Introducing Microsoft Office XP Tutorial 1.
ASP.NET Programming with C# and SQL Server First Edition
4 Copyright © Oracle Corporation, All rights reserved. Displaying Data from Multiple Tables.
1 Copyright © 2006, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
4 Copyright © Oracle Corporation, All rights reserved. Displaying Data from Multiple Tables.
4 Copyright © Oracle Corporation, All rights reserved. Displaying Data from Multiple Tables.
Copyright © 2004, Oracle. All rights reserved. Lecture 6 Displaying Data from Multiple Tables ORACLE.
Basisdata Pertanian. After completing this lesson, you should be able to do the following:  Write SELECT statements to access data from more than one.
Database control Introduction. The Database control is a tool that used by the database administrator to control the database. To enter to Database control.
Join, Subqueries and set operators. Obtaining Data from Multiple Tables EMPLOYEES DEPARTMENTS … …
4 Copyright © Oracle Corporation, All rights reserved. Displaying Data from Multiple Tables.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
Copyright © 2004, Oracle. All rights reserved. D ISPLAYING D ATA FROM M ULTIPLE T ABLES.
5 Copyright © 2004, Oracle. All rights reserved. Displaying Data from Multiple Tables.
5 Copyright © 2004, Oracle. All rights reserved. Displaying Data from Multiple Tables.
Intermediate SQL: Aggregated Data, Joins and Set Operators.
1 SQL SQL (Structured Query Language) : is a database language that is used to create, modify and update database design and data. Good Example of DBMS’s.
Database Programming Section 15 – Oracle Proprietary Join Syntax and Review 1.
4 Copyright © Oracle Corporation, All rights reserved. Displaying Data from Multiple Tables.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
CSED421 Database Systems Lab Join. Human Resources (HR) schema.
Database Programming Sections 3 – Oracle Joins. Marge Hohly2 Obtaining Data from Multiple Tables: Using Joins.
1 Copyright © Oracle Corporation, All rights reserved. Writing Basic SQL SELECT Statements.
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
I Copyright © 2007, Oracle. All rights reserved. Introduction.
Installation Oracle 11g Express 2 double click the "setup" button to install the Oracle.
I Copyright © 2007, Oracle. All rights reserved. Introduction.
E Copyright © 2006, Oracle. All rights reserved. Using SQL Developer.
4 Copyright © 2004, Oracle. All rights reserved. Displaying Data from Multiple Tables.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Copyright س Oracle Corporation, All rights reserved. 1 Writing Basic SQL Statements.
1 Copyright © 2004, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
4 Copyright © Oracle Corporation, All rights reserved. Displaying Data from Multiple Tables.
D Copyright © 2009, Oracle. All rights reserved. Using SQL*Plus.
Working in the Forms Developer Environment
SQL and SQL*Plus Interaction
Database Management System 1 (ITED123A)
Using SQL*Plus.
Displaying Data from Multiple Tables
Oracle Join Syntax.
Displaying Data from Multiple Tables
Displaying Data from Multiple Tables
Displaying Data from Multiple Tables
Using SQL Developer.
Using SQL*Plus.
ORACLE SQL Developer & SQLPLUS Statements
Displaying Data from Multiple Tables Using Joins
Using JDeveloper.
Oracle Join Syntax.
Using SQL*Plus.
Oracle Join Syntax.
Displaying Data from Multiple Tables
Displaying Data from Multiple Tables
Displaying Data from Multiple Tables
Presentation transcript:

1 Copyright © 2009, Oracle. All rights reserved. B Table Descriptions

Copyright © 2009, Oracle. All rights reserved. B - 2

Copyright © 2009, Oracle. All rights reserved. B - 3

Copyright © 2009, Oracle. All rights reserved. B - 4

Copyright © 2009, Oracle. All rights reserved. B - 5

Copyright © 2009, Oracle. All rights reserved. B - 6

Copyright © 2009, Oracle. All rights reserved. B - 7

Copyright © 2009, Oracle. All rights reserved. B - 8

Copyright © 2009, Oracle. All rights reserved. B - 9

Copyright © 2009, Oracle. All rights reserved. B - 10

C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer

Copyright © 2009, Oracle. All rights reserved. C - 12 Objectives After completing this appendix, you should be able to do the following: List the key features of Oracle SQL Developer Identify the menu items of Oracle SQL Developer Create a database connection Manage database objects Use SQL Worksheet Save and run SQL scripts Create and save reports

Copyright © 2009, Oracle. All rights reserved. C - 13 What Is Oracle SQL Developer? Oracle SQL Developer is a graphical tool that enhances productivity and simplifies database development tasks. You can connect to any target Oracle database schema by using standard Oracle database authentication. SQL Developer

Copyright © 2009, Oracle. All rights reserved. C - 14 Specifications of SQL Developer Shipped along with Oracle Database 11g Release 2 Developed in Java Supports Windows, Linux, and Mac OS X platforms Enables default connectivity using the JDBC Thin driver Connects to Oracle Database version and later Freely downloadable from the following link: – sql_developer/index.html

Copyright © 2009, Oracle. All rights reserved. C - 15 SQL Developer 1.5 Interface You must define a connection to start using SQL Developer for running SQL queries on a database schema.

Copyright © 2009, Oracle. All rights reserved. C - 16

Copyright © 2009, Oracle. All rights reserved. C - 17 Creating a Database Connection You must have at least one database connection to use SQL Developer. You can create and test connections for: –Multiple databases –Multiple schemas SQL Developer automatically imports any connections defined in the tnsnames.ora file on your system. You can export connections to an Extensible Markup Language (XML) file. Each additional database connection created is listed in the Connections Navigator hierarchy.

Copyright © 2009, Oracle. All rights reserved. C - 18 Creating a Database Connection 1 2 3

Copyright © 2009, Oracle. All rights reserved. C - 19

Copyright © 2009, Oracle. All rights reserved. C - 20 Browsing Database Objects Use the Connections Navigator to: Browse through many objects in a database schema Review the definitions of objects at a glance

Copyright © 2009, Oracle. All rights reserved. C - 21 Displaying the Table Structure Use the DESCRIBE command to display the structure of a table:

Copyright © 2009, Oracle. All rights reserved. C - 22 Browsing Files Use the File Navigator to explore the file system and open system files.

Copyright © 2009, Oracle. All rights reserved. C - 23 Creating a Schema Object SQL Developer supports the creation of any schema object by: –Executing a SQL statement in SQL Worksheet –Using the context menu Edit the objects by using an edit dialog box or one of the many context-sensitive menus. View the data definition language (DDL) for adjustments such as creating a new object or editing an existing schema object.

Copyright © 2009, Oracle. All rights reserved. C - 24 Creating a New Table: Example

Copyright © 2009, Oracle. All rights reserved. C - 25 Using the SQL Worksheet Use the SQL Worksheet to enter and execute SQL, PL/SQL, and SQL *Plus statements. Specify any actions that can be processed by the database connection associated with the worksheet. Or, click the Open SQL Worksheet icon. Select SQL Worksheet from the Tools menu.

Copyright © 2009, Oracle. All rights reserved. C - 26 Using the SQL Worksheet

Copyright © 2009, Oracle. All rights reserved. C - 27 Using the SQL Worksheet Enter SQL statements. Results are shown here.

Copyright © 2009, Oracle. All rights reserved. C - 28 Executing SQL Statements Use the Enter SQL Statement box to enter single or multiple SQL statements. F9F5 F9 F5

Copyright © 2009, Oracle. All rights reserved. C - 29 Saving SQL Scripts Click the Save icon to save your SQL statement to a file. The contents of the saved file are visible and editable in your SQL Worksheet window. Identify a location, enter a file name, and click Save

Copyright © 2009, Oracle. All rights reserved. C Use the Files tab to locate the script file that you want to open. 2.Double-click the script to display the code in the SQL Worksheet. Executing Saved Script Files: Method 1 To run the code, click either: Execute Script (F9), or Run Script (F5) 1 3 Select a connection from the drop-down list. 2

Copyright © 2009, Oracle. All rights reserved. C - 31 Executing Saved Script Files: Method 2 Use command followed by the location and name of the file that you want to execute, and click the Run Script icon. The output from the script is displayed on the Script Output tabbed page.

Copyright © 2009, Oracle. All rights reserved. C - 32 Formatting the SQL Code Before formatting After formatting

Copyright © 2009, Oracle. All rights reserved. C - 33 Using Snippets Snippets are code fragments that may be just syntax or examples. When you place your cursor here, it shows the Snippets window. From the drop-down list, you can select the functions category that you want.

Copyright © 2009, Oracle. All rights reserved. C - 34 Using Snippets: Example Inserting a snippet Editing the snippet

Copyright © 2009, Oracle. All rights reserved. C - 35 Debugging Procedures and Functions Use SQL Developer to debug PL/SQL functions and procedures. Use the Compile for Debug option to perform a PL/SQL compilation so that the procedure can be debugged. Use the Debug menu options to set breakpoints, and to perform step into, step over tasks.

Copyright © 2009, Oracle. All rights reserved. C - 36 Database Reporting SQL Developer provides a number of predefined reports about the database and its objects.

Copyright © 2009, Oracle. All rights reserved. C - 37 Creating a User-Defined Report Create and save user-defined reports for repeated use. Organize reports in folders.

Copyright © 2009, Oracle. All rights reserved. C - 38 Search Engines and External Tools Links to popular search engines and discussion forums Shortcuts to frequently used tools 1 2

Copyright © 2009, Oracle. All rights reserved. C - 39 Setting Preferences Customize the SQL Developer interface and environment. In the Tools menu, select Preferences.

Copyright © 2009, Oracle. All rights reserved. C - 40 Resetting the SQL Developer Layout

Copyright © 2009, Oracle. All rights reserved. C - 41 Summary In this appendix, you should have learned how to use SQL Developer to do the following: Browse, create, and edit database objects Execute SQL statements and scripts in SQL Worksheet Create and save custom reports

Copyright © 2009, Oracle. All rights reserved. C - 42

D Copyright © 2009, Oracle. All rights reserved. Using SQL*Plus

Copyright © 2009, Oracle. All rights reserved. D - 44 Objectives After completing this appendix, you should be able to do the following: Log in to SQL*Plus Edit SQL commands Format the output using SQL*Plus commands Interact with script files

Copyright © 2009, Oracle. All rights reserved. D - 45 SQL and SQL*Plus Interaction Buffer Server SQL statements Query results SQL scripts SQL*Plus

Copyright © 2009, Oracle. All rights reserved. D - 46 SQL Statements Versus SQL*Plus Commands SQL A language ANSI-standard Keywords cannot be abbreviated. Statements manipulate data and table definitions in the database. SQL statements SQL buffer SQL*Plus commands SQL*Plus buffer SQL*Plus An environment Oracle-proprietary Keywords can be abbreviated. Commands do not allow manipulation of values in the database.

Copyright © 2009, Oracle. All rights reserved. D - 47 Overview of SQL*Plus Log in to SQL*Plus. Describe the table structure. Edit your SQL statement. Execute SQL from SQL*Plus. Save SQL statements to files and append SQL statements to files. Execute saved files. Load commands from the file to buffer to edit.

Copyright © 2009, Oracle. All rights reserved. D - 48 sqlplus Logging In to SQL*Plus 1 2

Copyright © 2009, Oracle. All rights reserved. D - 49 Displaying the Table Structure Use the SQL*Plus DESCRIBE command to display the structure of a table: DESC[RIBE] tablename

Copyright © 2009, Oracle. All rights reserved. D - 50 Displaying the Table Structure Name Null? Type DEPARTMENT_ID NOT NULL NUMBER(4) DEPARTMENT_NAME NOT NULL VARCHAR2(30) MANAGER_ID NUMBER(6) LOCATION_ID NUMBER(4) DESCRIBE departments

Copyright © 2009, Oracle. All rights reserved. D - 51 SQL*Plus Editing Commands A[PPEND] text C[HANGE] / old / new C[HANGE] / text / CL[EAR] BUFF[ER] DEL DEL n DEL m n

Copyright © 2009, Oracle. All rights reserved. D - 52 SQL*Plus Editing Commands I[NPUT] I[NPUT] text L[IST] L[IST] n L[IST] m n R[UN] n n text 0 text

Copyright © 2009, Oracle. All rights reserved. D - 53 Using LIST, n, and APPEND LIST 1 SELECT last_name 2* FROM employees 1 1* SELECT last_name A, job_id 1* SELECT last_name, job_id LIST 1 SELECT last_name, job_id 2* FROM employees

Copyright © 2009, Oracle. All rights reserved. D - 54 Using the CHANGE Command LIST 1* SELECT * from employees c/employees/departments 1* SELECT * from departments LIST 1* SELECT * from departments

Copyright © 2009, Oracle. All rights reserved. D - 55 SQL*Plus File Commands SAVE filename GET filename START filename EDIT filename SPOOL filename EXIT

Copyright © 2009, Oracle. All rights reserved. D - 56 Using the SAVE, START Commands LIST 1 SELECT last_name, manager_id, department_id 2* FROM employees SAVE my_query Created file my_query START my_query LAST_NAME MANAGER_ID DEPARTMENT_ID King 90 Kochhar rows selected.

Copyright © 2009, Oracle. All rights reserved. D - 57 SERVEROUTPUT Command Use the SET SERVEROUT[PUT] command to control whether to display the output of stored procedures or PL/SQL blocks in SQL*Plus. The DBMS_OUTPUT line length limit is increased from 255 bytes to bytes. The default size is now unlimited. Resources are not preallocated when SERVEROUTPUT is set. Because there is no performance penalty, use UNLIMITED unless you want to conserve physical memory. SET SERVEROUT[PUT] {ON | OFF} [SIZE {n | UNL[IMITED]}] [FOR[MAT] {WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED]}]

Copyright © 2009, Oracle. All rights reserved. D - 58 Using the SQL*Plus SPOOL Command SPO[OL] [file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]] | OFF | OUT] OptionDescription file_name[.ext] Spools output to the specified file name CRE[ATE] Creates a new file with the name specified REP[LACE] Replaces the contents of an existing file. If the file does not exist, REPLACE creates the file. APP[END] Adds the contents of the buffer to the end of the file you specify OFF Stops spooling OUT Stops spooling and sends the file to your computer’s standard (default) printer

Copyright © 2009, Oracle. All rights reserved. D - 59 Using the AUTOTRACE Command It displays a report after the successful execution of SQL DML statements such as SELECT, INSERT, UPDATE, or DELETE. The report can now include execution statistics and the query execution path. SET AUTOT[RACE] {ON | OFF | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]] SET AUTOTRACE ON -- The AUTOTRACE report includes both the optimizer -- execution path and the SQL statement execution -- statistics

Copyright © 2009, Oracle. All rights reserved. D - 60 Summary In this appendix, you should have learned how to use SQL*Plus as an environment to do the following: Execute SQL statements Edit SQL statements Format the output Interact with script files

1 Copyright © 2009, Oracle. All rights reserved. E Using JDeveloper

Copyright © 2009, Oracle. All rights reserved. E - 62 Objectives After completing this appendix, you should be able to do the following: List the key features of Oracle JDeveloper Create a database connection in JDeveloper Manage database objects in JDeveloper Use JDeveloper to execute SQL Commands Create and run PL/SQL Program Units

Copyright © 2009, Oracle. All rights reserved. E - 63 Oracle JDeveloper

Copyright © 2009, Oracle. All rights reserved. E - 64 Database Navigator

Copyright © 2009, Oracle. All rights reserved. E - 65 Creating Connection Click the New Connection icon in the Database Navigator. In the Create Database Connection window, enter the Username, Password, and the SID. Click Test Connection. Click OK

Copyright © 2009, Oracle. All rights reserved. E - 66 Browsing Database Objects Use the Database Navigator to: Browse through many objects in a database schema Review the definitions of objects at a glance

Copyright © 2009, Oracle. All rights reserved. E - 67 Executing SQL Statements 1 2 3

Copyright © 2009, Oracle. All rights reserved. E - 68 Creating Program Units Skeleton of the function 1 2 3

Copyright © 2009, Oracle. All rights reserved. E - 69 Compiling Compilation with errors Compilation without errors

Copyright © 2009, Oracle. All rights reserved. E - 70 Running a Program Unit

Copyright © 2009, Oracle. All rights reserved. E - 71 Dropping a Program Unit 1 2

Copyright © 2009, Oracle. All rights reserved. E - 72 Structure Window

Copyright © 2009, Oracle. All rights reserved. E - 73 Editor Window

Copyright © 2009, Oracle. All rights reserved. E - 74 Application Navigator

Copyright © 2009, Oracle. All rights reserved. E - 75 Deploying Java Stored Procedures Before deploying Java stored procedures, perform the following steps: 1.Create a database connection. 2.Create a deployment profile. 3.Deploy the objects

Copyright © 2009, Oracle. All rights reserved. E - 76 Publishing Java to PL/SQL 1 2

Copyright © 2009, Oracle. All rights reserved. E - 77 TopicWebsite Oracle JDeveloper Product Page html Oracle JDeveloper 11g Tutorials dex.html Oracle JDeveloper 11g Product Documentation html Oracle JDeveloper 11g Discussion Forum 3 How Can I Learn More About JDeveloper 11g?

Copyright © 2009, Oracle. All rights reserved. E - 78 Summary In this appendix, you should have learned to do the following: List the key features of Oracle JDeveloper Create a database connection in JDeveloper Manage database objects in JDeveloper Use JDeveloper to execute SQL Commands Create and run PL/SQL Program Units

F Copyright © 2009, Oracle. All rights reserved. Oracle Join Syntax

Copyright © 2009, Oracle. All rights reserved. F - 80 Objectives After completing this appendix, you should be able to do the following: Write SELECT statements to access data from more than one table using equijoins and nonequijoins Join a table to itself by using a self-join View data that generally does not meet a join condition by using outer joins Generate a Cartesian product of all rows from two or more tables

Copyright © 2009, Oracle. All rights reserved. F - 81 Obtaining Data from Multiple Tables EMPLOYEES DEPARTMENTS … …

Copyright © 2009, Oracle. All rights reserved. F - 82 Cartesian Products A Cartesian product is formed when: –A join condition is omitted –A join condition is invalid –All rows in the first table are joined to all rows in the second table To avoid a Cartesian product, always include a valid join condition in a WHERE clause.

Copyright © 2009, Oracle. All rights reserved. F - 83 Generating a Cartesian Product Cartesian product: 20 x 8 = 160 rows EMPLOYEES (20 rows) DEPARTMENTS (8 rows) … … …

Copyright © 2009, Oracle. All rights reserved. F - 84 Types of Oracle-Proprietary Joins Equijoin Nonequijoin Outer join Self-join

Copyright © 2009, Oracle. All rights reserved. F - 85 Joining Tables Using Oracle Syntax Use a join to query data from more than one table: Write the join condition in the WHERE clause. Prefix the column name with the table name when the same column name appears in more than one table. SELECTtable1.column, table2.column FROMtable1, table2 WHEREtable1.column1 = table2.column2;

Copyright © 2009, Oracle. All rights reserved. F - 86 Qualifying Ambiguous Column Names Use table prefixes to qualify column names that are in multiple tables. Use table prefixes to improve performance. Use table aliases, instead of full table name prefixes. Table aliases give a table a shorter name. –Keeps SQL code smaller, uses less memory Use column aliases to distinguish columns that have identical names, but reside in different tables.

Copyright © 2009, Oracle. All rights reserved. F - 87 Equijoins EMPLOYEESDEPARTMENTS Foreign key Primary key …

Copyright © 2009, Oracle. All rights reserved. F - 88 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; Retrieving Records with Equijoins …

Copyright © 2009, Oracle. All rights reserved. F - 89 SELECT d.department_id, d.department_name, d.location_id, l.city FROM departments d, locations l WHERE d.location_id = l.location_id; Retrieving Records with Equijoins: Example

Copyright © 2009, Oracle. All rights reserved. F - 90 Additional Search Conditions Using the AND Operator SELECT d.department_id, d.department_name, l.city FROM departments d, locations l WHERE d.location_id = l.location_id AND d.department_id IN (20, 50);

Copyright © 2009, Oracle. All rights reserved. F - 91 Joining More than Two Tables To join n tables together, you need a minimum of n–1 join conditions. For example, to join three tables, a minimum of two joins is required. EMPLOYEESLOCATIONSDEPARTMENTS …

Copyright © 2009, Oracle. All rights reserved. F - 92 Nonequijoins EMPLOYEES JOB_GRADES JOB_GRADES table defines LOWEST_SAL and HIGHEST_SAL range of values for each GRADE_LEVEL. Therefore, the GRADE_LEVEL column can be used to assign grades to each employee. …

Copyright © 2009, Oracle. All rights reserved. F - 93 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; Retrieving Records with Nonequijoins …

Copyright © 2009, Oracle. All rights reserved. F - 94 Returning Records with No Direct Match with Outer Joins EMPLOYEESDEPARTMENTS There are no employees in department 190. …

Copyright © 2009, Oracle. All rights reserved. F - 95 Outer Joins: Syntax You use an outer join to see rows that do not meet the join condition. The outer join operator is the plus sign (+). SELECTtable1.column, table2.column FROMtable1, table2 WHEREtable1.column(+) = table2.column; SELECTtable1.column, table2.column FROMtable1, table2 WHEREtable1.column = table2.column(+);

Copyright © 2009, Oracle. All rights reserved. F - 96 SELECT e.last_name, e.department_id, d.department_name FROM employees e, departments d WHERE e.department_id(+) = d.department_id ; Using Outer Joins …

Copyright © 2009, Oracle. All rights reserved. F - 97 SELECT e.last_name, e.department_id, d.department_name FROM employees e, departments d WHERE e.department_id = d.department_id(+) ; Outer Join: Another Example …

Copyright © 2009, Oracle. All rights reserved. F - 98 Joining a Table to Itself MANAGER_ID in the WORKER table is equal to EMPLOYEE_ID in the MANAGER table. EMPLOYEES (WORKER)EMPLOYEES (MANAGER) … …

Copyright © 2009, Oracle. All rights reserved. F - 99 Self-Join: Example SELECT worker.last_name || ' works for ' || manager.last_name FROM employees worker, employees manager WHERE worker.manager_id = manager.employee_id ; …

Copyright © 2009, Oracle. All rights reserved. F Summary In this appendix, you should have learned how to use joins to display data from multiple tables by using Oracle-proprietary syntax.

Copyright © 2009, Oracle. All rights reserved. F Practice F: Overview This practice covers the following topics: Joining tables by using an equijoin Performing outer and self-joins Adding conditions

Copyright © 2009, Oracle. All rights reserved. F - 102