Author: admin
-
Using PL/SQL for More Complex Operations
You can create a PL/SQL block to calculate and display the average salary of employees in a specific department:
-
Query the Data
To retrieve all employees in a specific department with a salary greater than $60,000, use the following query:
-
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…