Category: 06. Oracle Joins
-
Oracle View
In Oracle, view is a virtual table that does not physically exist. It is stored in Oracle data dictionary and do not store any data. It can be executed when called. A view is created by a query joining one or more tables. Oracle CREATE VIEW Syntax: Parameters: Example: Let’s take an example to create…
-
Oracle Semi Join
Semi-join is introduced in Oracle 8.0. It provides an efficient method of performing a WHERE EXISTS sub-query. A semi-join returns one copy of each row in first table for which at least one match is found. Semi-joins are written using the EXISTS construct. Oracle Semi Join Example Let’s take two tables “departments” and “customer” Departments…
-
Oracle Anti Join
Anti-join is used to make the queries run faster. It is a very powerful SQL construct Oracle offers for faster queries. Anti-join between two tables returns rows from the first table where no matches are found in the second table. It is opposite of a semi-join. An anti-join returns one copy of each row in…
-
Oracle Cross Join (Cartesian Products)
The CROSS JOIN specifies that all rows from first table join with all of the rows of second table. If there are “x” rows in table1 and “y” rows in table2 then the cross join result set have x*y rows. It normally happens when no matching join columns are specified. In simple words you can…
-
Oracle SELF JOIN
Self Join is a specific type of Join. In Self Join, a table is joined with itself (Unary relationship). A self join simply specifies that each rows of a table is combined with itself and every other row of the table. Syntax Oracle SELF JOIN Example Let’s take a table “customers”. Join this table using…
-
Oracle EQUI JOIN
Oracle Equi join returns the matching column values of the associated tables. It uses a comparison operator in the WHERE clause to refer equality. Syntax Equijoin also can be performed by using JOIN keyword followed by ON keyword and then specifying names of the columns along with their associated tables to check equality. Syntax Oracle…
-
Oracle OUTER JOIN
An outer join is similar to equijoin but it gets also the non-matched rows from the table. It is categorized in Left Outer Join, Right Outer Join and Full Outer Join by Oracle 9i ANSI/ISO 1999 standard. Left Outer Join Left Outer Join returns all rows from the left (first) table specified in the ON…
-
Oracle INNER JOIN
Inner Join is the simplest and most common type of join. It is also known as simple join. It returns all rows from multiple tables where the join condition is met. Syntax Image representation of Inner Join Oracle INNER JOIN Example Let’s take an example to perform Inner Join on two tables “Suppliers” and “Order1”.…
-
Oracle Joins
Join is a query that is used to combine rows from two or more tables, views, or materialized views. It retrieves data from multiple tables and creates a new table. Join Conditions There may be at least one join condition either in the FROM clause or in the WHERE clause for joining two tables. It…