Oracle PL/SQL
if they have a basic experience in any programming language.SQL
tables using this Procedural Language.SQL
ORDER BY
clauseSELECT
column_1,
column_2,
column_3,
...
FROM
table_name
ORDER BY
{column_1 | col_1_pos} [ASC | DESC] [NULLS FIRST | NULLS LAST],
{column_1 | col_2_pos} [ASC | DESC] [NULLS FIRST | NULLS LAST],
...
SELECT DISTINCT
statementSELECT DISTINCT column_1
FROM table;
FETCH
clause syntax[ OFFSET offset ROWS]
FETCH NEXT [ row_count | percent PERCENT ] ROWS [ ONLY | WITH TIES ]
-- example
SELECT
product_name,
quantity
FROM
inventories
INNER JOIN products
USING(product_id)
ORDER BY
quantity DESC
FETCH NEXT 5 ROWS ONLY;
BETWEEN DATES
SELECT
order_id,
customer_id,
status,
order_date
FROM
orders
WHERE
order_date BETWEEN DATE '2016-12-01' AND DATE '2016-12-31'
ORDER BY
order_date;
LIKE
operator-- The following statement retrieves products that have a discount of 25%:
SELECT
product_id,
discount_message
FROM
discounts
WHERE
discount_message LIKE '%25!%%' ESCAPE '!';
ROLLUP
operatorROLLUP
Works SELECT column1, column2, ..., aggregate_function(column)
FROM table
GROUP BY ROLLUP (column1, column2, ...);
ANY
operatorSELECT
*
FROM
table_name
WHERE
c > ANY (
v1,
v2,
v3
);
-- the below does the same thing as above
SELECT
*
FROM
table_name
WHERE
c > v1
OR c > v2
OR c > v3;
ALL
operatorSELECT
*
FROM
table_name
WHERE
c > ALL (
v1,
v2,
v3
);
-- transform the ALL operator
SELECT
*
FROM
table_name
WHERE
c > v1
AND c > v2
AND c > v3;
RENAME old_table_name TO new_table_name;
UNION
v JOIN
Learning from Udemy
and able to practice parallel coding in the PL/SQL
I’m using Oracle Live SQL web editor, I know it’s not preferrable but situation demands; access the Oracle Live SQL
from here