Oracle SQL
By Ramesh K
DB Intro and Clauses
DB Types
DB -> RDMS (oracle, sql server, sybase etc..,) / Non-RDMS (Mongo DB
etec.,)
DB Stores information
Customer Details (table1) id, name, address
Account Details (table2) id, accid, acctype, total amount, etc..,
To deal with DB Sql, Pl/sql
Oracle Server vs Oracle DB
DB is memory
Table is an object which stores information/data
Overview of Oracle:
Oracle Database is a relational database management system
(RDBMS).
It is also known as Oracle database, Oracle DB, or simply Oracle.
It is produced and marketed by Oracle Corporation.
Oracle was the first database designed for enterprise grid
computing, which is a flexible and cost-effective way to manage
information and applications.
SQL Clauses:
Where
Order By
Having
Group By
Select:
Select * from emp where Deptno =10;
Where
Select * from emp where Deptno in (10,20); --> in to select multiple data
Order By
Select * from emp where Deptno in (10,20,30) order by deptno asc; --by default sorting is done in asc
order only
Select empno,ename,sal from emp where Deptno in (10,20) order by deptno desc;
Group By
Select count(empno),job from emp where Deptno in (10,20,30) group by job order by job;
And
Select count(empno),job from emp where Deptno in (10,20,30) and sal >200 group by job order by job;
Having
Select count(empno),job from emp where Deptno in (10,20,30) having count(empno)>2 group by job
order by job;
Select count(empno),job from emp where Deptno in (10,20,30) group by job having count(empno)>2
order by job;
Priority and Mandatory
Order of Execution/Order of writing a SQl
Query
Order or writing a query:
Select 1
from 2
where 3
having 4/5
group by 4/5
order by 6
Order Of Execution of sql query:
Select 2
from 1
where 3
group by 4
order by 6
having 5
Language Commands
decode & Case
Aggregate Functions
SQL
The Structured Query Language (SQL), as we all know, is a database language that allows us
to execute specific operations on existing databases and construct new ones. SQL employs
commands such as Create, Drop, and Insert to complete the tasks.
These SQL commands are primarily divided into four groups:
Data Definition Language (DDL)
Data Manipulation Language (DML)
Data Control Language (DCL)
Transaction Control Language (TCL)
1) What Is DDL?
DDL, or data definition language, is a programming language for
creating and modifying databases. It’s termed a language, but it’s more
like syntax in and of itself. Alternatively, a sequence of statements
allows the user to define or edit data structures and objects like data
tables.
How to Use DDL Commands?
As previously stated, DDL is the component of the SQL syntax that deals
with the elements of a database by executing commands (also known as
statements) such as:
CREATE CREATE TABLE object_name (column_name data_type);
ALTER ALTER TABLE sales ADD COLUMN date_of_purchase DATE;
DROP DROP TABLE customers;
RENAME RENAME TABLE customers TO customer_data;
TRUNCATE TRUNCATE TABLE customers;
2) What is DML?
It’s time to implement DML, or data manipulation language, after you’ve
already set up your database – or loaded one that you’d like to work with.
This SQL syntax allows you to manipulate existing data objects using a set
of actions.
What Are the SQL DML Commands?
DML has various instructions – or statements – that we utilize as we work
our way through data tables, as do all SQL syntax components:
SELECT Select * from Table
INSERT INSERT INTO sales (purchase_number, date_of_purchase)
VALUES
(1, ‘20xx-xx-xx’);
UPDATE UPDATE sales SET date_of_purchase = ‘2022-12-12’
WHERE purchase_number = 1;
DELETE DELETE FROM sales;
3) What Is DCL?
The data control language (DCL) is essentially a SQL syntax that allows you to manage
users’ access in a database using a pair of commands. Furthermore, database
administrators can manage user access if they have full access to a database.
What Are the DCL Commands?
DCL has only two SQL statements:
GRANT
REVOKE
GRANT type_of_permission ON database_name.table_name TO
'@username'@'localhost'
REVOKE type_of_permission ON database_name.table_name FROM
'username'@'localhost'
4) What Is TCL?
It is critical to be in control of the transactions you conduct while dealing
with relational database management systems in a professional setting.
To put it another way, you want to know exactly what you’re doing in
your database when you insert, delete, or update data.
What Are the TCL Statements?
You must be familiar with TCL’s commands in order to deal with it,
specifically:
COMMIT UPDATE customers SET last_name = 'Amit’ WHERE
customer_id = 4
COMMIT;
ROLLBACK UPDATE customers SET last_name = 'Amit’ WHERE
customer_id = 4
ROLLBACK;
SAVEPOINT SAVEPOINT savepoint_name;
Create and Insert data in Table:
CREATE TABLE customers (
customer_id number NOT NULL,
customer_name varchar2(50) NOT NULL,
city varchar2(50) --NULL(Default)
);
Insert into customers values(1,'Dinesh','Hyd');
Insert into customers values(2,'prem','Bang');
Insert into customers values(3,'Chandan','Pune');
commit;
Decode/case
1. Decode --> if else statement
if region='north' then 'N'
elsif region='south' then 'S'
else 'My Direction'
end if;
Select salesperson,region, decode(region,'North','N','My Direction') from sales;
Select salesperson,region, decode(region,'North','N','South','S','My Direction') from sales;
2. case --> if else statment
Select salesperson,region, sum(amount), (case when sum(amount)/100 > 5 then 'Good guy'
else 'Bad Guy' end) from sales group by salesperson,region;
Select salesperson,region, (case region when 'North' then 'N' else 'My Direction' end) from
sales;
Aggregate functions: sum , max, min, count, avg
select salesperson, sum(amount) from sales group by salesperson;
select salesperson, max(amount) from sales group by salesperson;
Select min(amount) from sales s;
select count(*) from sales;
select count(salesperson) from sales;
select avg(amount) from sales;
avg(amount) = sum(amount)/count(*)
select sum(amount)/count(*) from sales;
Constraints
Defining constraints
Enabling/disabling constraints
CREATE TABLE sales ( SELECT
salesperson,
sale_id NUMBER PRIMARY KEY, region,
salesperson VARCHAR2(50), COUNT(*) AS total_sales,
SUM(amount) AS total_amount,
region VARCHAR2(20),
amount NUMBER, -- DECODE to label region
sale_date DATE ); DECODE(region,
'North', 'Northern Region',
INSERT INTO sales VALUES (1, 'Alice', 'North', 500, TO_DATE('2025-08-01', 'YYYY-MM- 'South', 'Southern Region',
DD')); 'East', 'Eastern Region',
INSERT INTO sales VALUES (2, 'Bob', 'South', 700, TO_DATE('2025-08-02', 'YYYY-MM- 'Other') AS region_label,
DD'));
INSERT INTO sales VALUES (3, 'Alice', 'North', 1200, TO_DATE('2025-08-03', 'YYYY- -- CASE to classify performance
MM-DD')); CASE
INSERT INTO sales VALUES (4, 'Charlie', 'East', 300, TO_DATE('2025-08-01', 'YYYY- WHEN SUM(amount) >= 2000 THEN 'High Performer'
MM-DD'));
WHEN SUM(amount) >= 1000 THEN 'Medium Performer'
INSERT INTO sales VALUES (5, 'Bob', 'South', 2000, TO_DATE('2025-08-04', 'YYYY-MM-
DD')); ELSE 'Low Performer'
INSERT INTO sales VALUES (6, 'Alice', 'North', 800, TO_DATE('2025-08-05', 'YYYY-MM- END AS performance
DD'));
FROM
sales
GROUP BY
salesperson, region
HAVING
SUM(amount) > 1000
ORDER BY
total_amount DESC;
Sample for Constraints:
CREATE TABLE sample_employees (
employee_id NUMBER NOT NULL,
first_name VARCHAR2(20),
last_name VARCHAR2(25) NOT NULL,
email VARCHAR2(25) UNIQUE,
phone_number VARCHAR2(20),
hire_date DATE DEFAULT SYSDATE,
job_id VARCHAR2(10) NOT NULL,
salary NUMBER CHECK (salary > 0),
commission_pct NUMBER,
manager_id NUMBER,
department_id NUMBER,
CONSTRAINT pk_employee_id1 PRIMARY KEY (employee_id),
CONSTRAINT fk_manager_id1 FOREIGN KEY (manager_id) REFERENCES sample_employees (employee_id), -- Self-referencing FK
CONSTRAINT fk_department_id1 FOREIGN KEY (department_id) REFERENCES dept (deptno) );
insert into sample_employees values(100, 'sai', 'Akhil', '[Link]@[Link]',98765467,sysdate,123,20000,20,100,20 );
insert into sample_employees values(101, 'sai1', 'Akhil1', 'sai.akhil1@[Link]',98765467,sysdate,123,100,20,100,40 );
Data Types & Operators
[Link] Data Types
Data Type Description
NUMBER(p,s) Stores fixed or floating point numbers. p is precision (total digits),
s is scale (digits after decimal). Example: NUMBER(5,2) stores 123.45.
INTEGER Synonym for NUMBER(38,0) (whole numbers).
INT Same as INTEGER.
FLOAT(p) Floating point number with precision p.
( FLOAT is a numeric data type used to store approximate floating-point
numbers — values with decimal points, suitable for scientific or large-range calculations.)
Character Data Types/ Date and Time Data Types
Data Type Description
CHAR(n) Fixed-length string of n bytes. Padded with spaces if shorter.
VARCHAR2(n) Variable-length string up to n bytes. Most commonly used.
NCHAR(n) Fixed-length Unicode string.
NVARCHAR2(n) Variable-length Unicode string.
ex: INSERT INTO customers (customer_id, name) VALUES (1, N'अर्जुन');
Use VARCHAR2 instead of VARCHAR (for compatibility reasons).
Data Type Description
DATE Stores date and time (down to seconds). Format: 'DD-MON-YYYY HH24:MI:SS'.
TIMESTAMP Like DATE but with fractional seconds.
TIMESTAMP WITH TIME ZONE Includes timezone offset. ('14-AUG-25 [Link] AM +05:30’)
Others:
Large Object (LOB) Data Types
Data Type Description
CLOB Character large object max 4GB (e.g., large text files, html, source code etcc..).
NCLOB Unicode version of CLOB.
BLOB Binary large object (e.g., images, videos).
Raw/Binary Data Types
Data Type Description
RAW(n) Raw binary data of length n bytes.
Binary data or byte strings (not character data). It's ideal for storing data that should
not be interpreted or converted, (ex: Passwords, Digital signatutures etc..,)
LONG RAW Variable-length raw binary data (up to 2 GB). Deprecated for new applications.
Miscellaneous
Data Type Description
LONG Variable-length character data (up to 2 GB). Deprecated — use CLOB instead.
Joins and Set Operations:
INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN
Using table aliases
Set operators:
UNION, UNION ALL, INTERSECT, MINUS
Joins
Different types of the JOINs in SQL:
1. INNER JOIN: Returns records that have matching values in both tables
2. LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table
3. RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table
4. FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table
5. CROSS JOIN: Produces the Cartesian product of two tables.
6. SELF JOIN: Joins the table by itself and return the matching values
CREATE TABLE products ( CREATE TABLE sales (
product_id NUMBER PRIMARY KEY, sales_id NUMBER PRIMARY KEY,
amount NUMBER,
name VARCHAR2(100) ); sale_date DATE,
product_id NUMBER );
INSERT INTO products (product_id, name) VALUES (1, 'Shoes');
INSERT INTO products (product_id, name) VALUES (2, 'Shirts');
INSERT INTO products (product_id, name) VALUES (3, 'Watches');
INSERT INTO products (product_id, name) VALUES (4, 'Electronics');
INSERT INTO products (product_id, name) VALUES (7, ‘Cars');
INSERT INTO sales (sales_id, amount, sale_date, product_id) VALUES (11, 100, TO_DATE('10-08-2025', 'DD-MM-
YYYY'), 1);
INSERT INTO sales (sales_id, amount, sale_date, product_id) VALUES (33, 300, TO_DATE('12-08-2025', 'DD-MM-
YYYY'), 3);
INSERT INTO sales (sales_id, amount, sale_date, product_id) VALUES (44, 400, TO_DATE('13-08-2025', 'DD-MM-
YYYY'), 3);
INSERT INTO sales (sales_id, amount, sale_date, product_id) VALUES (55, 500, TO_DATE('14-08-2025', 'DD-MM-
YYYY'), 4);
INSERT INTO sales (sales_id, amount, sale_date, product_id) VALUES (66, 600, TO_DATE('15-08-2025', 'DD-MM-
YYYY'), 1);
INSERT INTO sales (sales_id, amount, sale_date, product_id) VALUES (77, 700, TO_DATE('16-08-2025', 'DD-MM-
YYYY'), 5);
Single Row Functions
String functions: UPPER, LOWER, INITCAP, SUBSTR, INSTR, LENGTH
Number functions: ROUND, TRUNC, MOD
Date functions: SYSDATE, ADD_MONTHS, MONTHS_BETWEEN, NEXT_DAY
Conversion functions: TO_CHAR, TO_DATE, TO_NUMBER
Conditional functions: NVL, NVL2, COALESCE, NULLIF, DECODE, CASE
SQL NULL Functions
ISNULL
Select * from table_name where colum is null;
NVL
Select nvl(column,’123’) from table;
NVL2
Select NVL2(discount, amount - discount, amount) AS final_amount from sales;
Coalesce
SELECT sales_id, COALESCE(discount, special_price, amount) AS final_price FROM sales;
Grouping and Aggregations:
GROUP BY and HAVING
Aggregate functions: COUNT, SUM, AVG, MIN, MAX
Grouping sets (ROLLUP, CUBE)
Subqueries
Single-row subqueries is the one which return only one Row as output (=)
Multi-row subqueries is the one which returns more than one Row as output (In)
IN,NOT IN, ANY, ALL, EXISTS, Not EXISTS
Select * from sales where amount In (600,700);
Select * from sales where amount > Any (600,700); --any one of them
Select * from sales where amount > All (600,700); --both/All of them
Select * from sales a where exists (select 1 from products b where a.product_id = b.product_id) ;
Select * from sales a where prct_id in (select product_id from products b);
Select * from sales a where exists (select 1 from products b where b.product_id = a.prct_id);
Select * from sales a, products b where a.product_id = b.product_id; --inner join (matching records
Correlated subqueries:
A correlated subquery is a subquery that references
columns from the outer query. Unlike regular (or
non-correlated) subqueries, a correlated subquery
is executed once for each row processed by the
outer query.
SELECT e.employee_id, [Link], [Link]
FROM employees e
WHERE [Link] > (
Inline views / subqueries in FROM:
Subquery (also known as an inline view) is placed in the
SELECT AVG(salary)
FROM clause of a SQL statement. It allows you to create a
FROM employees temporary table from a SELECT statement which you can
then query further.
WHERE department_id = e.department_id );
SELECT dept_name, avg_salary
FROM (
SELECT department_id, AVG(salary) AS avg_salary
FROM employees
GROUP BY department_id
) dept_avg
JOIN departments d ON dept_avg.department_id =
d.department_id;
Indexes & Types
Creating and dropping indexes
Unique vs non-unique indexes:
CREATE UNIQUE INDEX emp_email_uk ON employees (email);
ALTER TABLE employees ADD CONSTRAINT emp_email_unique UNIQUE (email);
CREATE INDEX emp_dept_idx ON employees (department_id);
(1) B-Tree: default index type, For Unique Columns(ID,Pan,aadjhar etcc.)
(2) Bitmap: CREATE BITMAP INDEX index_name ON table_name (column_name); For Non-Unique
Columns(gender,DOB)
(3) Function-Based : CREATE INDEX emp_upper_lastname_idx ON employees (UPPER(last_name));
(4) Index organized table (IOT). CREATE TABLE employees ( emp_id NUMBER PRIMARY KEY,
name VARCHAR2(50)) ORGANIZATION INDEX;
Views & Types
Creating simple and complex views
Read-only vs updatable views
Dropping views
1) Simple views: is a virtual table. It does not store data itself—just the query logic.
2) Complex views:
A Complex View is a type of view that is based on more advanced SQL queries.
It may include: Joins, Group functions (like SUM, AVG, COUNT), Subqueries, GROUP BY,HAVING,
DISTINCT
3) Materialized view:
A Materialized View is like a regular view, but with one major difference:
It stores the result set physically in the database, rather than generating it dynamically every
time you query it
4) Inline views
MATERIALIZED VIEW
CREATE MATERIALIZED VIEW product_sales_summary
AS
SELECT product_id, SUM(sale_amount) AS total_sales
FROM sales
On Schedule:
GROUP BY product_id;
CREATE MATERIALIZED VIEW my_view
REFRESH COMPLETE START WITH SYSDATE NEXT SYSDATE + 1
REFRESH FAST:
AS SELECT ...;
CREATE MATERIALIZED VIEW product_sales_summary
REFRESH FAST
Manual Refresh :
START WITH SYSDATE
EXEC DBMS_MVIEW.REFRESH('product_sales_summary’);
NEXT SYSDATE + 1
AS On Commit:
SELECT product_id, SUM(sale_amount)
CREATE MATERIALIZED VIEW my_view
FROM sales
REFRESH FAST ON COMMIT
GROUP BY product_id;
AS SELECT ...;
Advanced SQL
Analytic functions: RANK, DENSE_RANK, ROW_NUMBER, LEAD, LAG
Partitioning with OVER (PARTITION BY...)
Hierarchical queries (CONNECT BY, LEVEL, SYS_CONNECT_BY_PATH)
Pivot and Unpivot
Listagg
Merge
Analytical Functions:
1. RANK()
Purpose: Assigns a unique rank to each distinct row within a result set partition. It skips ranks if there are ties.
Syntax: RANK() OVER (PARTITION BY column ORDER BY column)
Behavior: If two rows tie, they get the same rank, and the next rank(s) are skipped.
Example:
ID Score RANK
1 100 1
2 90 2
3 90 2
4 80 4
2. DENSE_RANK()
Purpose: Similar to RANK(), but does not skip the next rank(s) after a tie.
Syntax: DENSE_RANK() OVER (PARTITION BY column ORDER BY column)
Example:
ID Score DENSE_RANK
1 100 1
2 90 2
3 90 2
4 80 3
3. ROW_NUMBER()
Purpose: Assigns a unique sequential number to each row. No ties — always unique.
Syntax:ROW_NUMBER() OVER (PARTITION BY column ORDER BY column)
Example:
ID Score ROW_NUMBER
1 100 1
2 90 2
3 90 3
4 80 4
4. LEAD()
Purpose: Accesses data from the next row in the result set without using a self-join.
Syntax:LEAD(column, offset, default) OVER (PARTITION BY column ORDER BY column)
Example: LEAD(Salary, 1) OVER (ORDER BY Salary)
ID Salary LEAD
1 1000 1500
2 1500 2000
3 2000 NULL
5. LAG()
Purpose: Accesses data from the previous row in the result set.
Syntax:LAG(column, offset, default) OVER (PARTITION BY column ORDER BY column)
Example:LAG(Salary, 1) OVER (ORDER BY Salary)
ID Salary LAG
1 1000 NULL
2 1500 1000
3 2000 1500
Merge Statement:
Also known as "upsert" — update or insert
MERGE INTO target_table AS target
USING source_table AS source
ON [Link] = [Link]
WHEN MATCHED THEN
UPDATE SET target.col1 = source.col1
WHEN NOT MATCHED THEN
INSERT (col1, col2) VALUES (source.col1, source.col2);
LISTAGG:
concatenates values from multiple rows into a single string, with a custom delimiter.
Synatx: LISTAGG(column_name, 'delimiter') WITHIN GROUP (ORDER BY column_name)
select LISTAGG(ename, ';') WITHIN GROUP (ORDER BY ename) from emp;
Global Temporary Table
A Global Temporary Table is a table that holds data only for the duration of a session or
transaction. The table definition is permanent, but the data is temporary.
Data in a GTT is private to each session.
Data is automatically deleted at the end of the transaction or session (depending on how it’s defined).
GTTs can be indexed.
CREATE GLOBAL TEMPORARY TABLE temp_employees (
id NUMBER,
name VARCHAR2(100)) ON COMMIT DELETE ROWS;
CREATE GLOBAL TEMPORARY TABLE temp_employees (
id NUMBER,
name VARCHAR2(100)) ON COMMIT PRESERVE ROWS;
ON COMMIT DELETE ROWS Data is deleted after each transaction
ON COMMIT PRESERVE ROWS Data is kept until the end of session
Example for GTT
CREATE GLOBAL TEMPORARY TABLE temp_employees (
id NUMBER,
name VARCHAR2(100),
salary NUMBER
) ON COMMIT PRESERVE ROWS;
INSERT INTO temp_employees VALUES (2, 'Bob B.', 5800); -- existing employee
INSERT INTO temp_employees VALUES (3, 'Charlie', 4000); -- new employee
-- No need to delete manually
SELECT * FROM temp_employees; -- returns 0 rows after disconnect/reconnect
Regular Expressions
REGEXP_LIKE Returns TRUE if a value matches a regular expression pattern.
(similar to LIKE, but more powerful).
REGEXP_INSTR Returns the position of a pattern match in a string.
REGEXP_SUBSTR Returns the substring that matches a regular expression pattern.
REGEXP_REPLACE Replaces substrings matching a regular expression pattern.
REGEXP_COUNT Returns the number of times a pattern occurs in a string (from Oracle 11g).
Common Regular Expression Common Regular Expression Metacharacters
Metacharacters
Symbol Meaning
Symbol Meaning
[] Any one of the characters in brackets
. Any single character
[^] Any one character not in brackets
* Zero or more occurrences
() Grouping
+ One or more occurrences
\d Digit (0-9)
? Zero or one occurrence
\w Word character (alphanumeric + _)
\s Whitespace
Examples
1. REGEXP_LIKE
SELECT * FROM employees WHERE REGEXP_LIKE(email, '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$');
--> Finds emails that match a basic email pattern.
2. REGEXP_INSTR
SELECT REGEXP_INSTR('abc123xyz', '\d+') AS position FROM dual;
--> Returns the position of the first digit sequence (123 → position 4).
3. REGEXP_SUBSTR
SELECT REGEXP_SUBSTR('Product_ABC_2025', '\d+') AS year FROM dual;
--> Extracts the first numeric substring (2025).
4. REGEXP_REPLACE
SELECT REGEXP_REPLACE('123-45-6789', '\d', 'X') AS masked_ssn FROM dual;
--> Replaces all digits with X → XXX-XX-XXXX.
5. REGEXP_COUNT
SELECT REGEXP_COUNT('banana', 'a') AS a_count FROM dual;
--> Counts the number of 'a' characters (3).
With Clause
WITH clause in Oracle (also called a Common Table Expression or CTE) allows you to create
temporary result sets (like named subqueries) that can be referenced within the main SQL
query.
It improves readability, helps avoid repeating complex subqueries, and can also be recursive.
Syntax:
WITH cte_name AS (
SELECT ...
FROM ...
WHERE ...
)
SELECT *
FROM cte_name
WHERE ...;
Sequence
Select * from all_sequences where sequence_name='RGHAVA_123';
CREATE SEQUENCE rghava_123
START WITH 1
INCREMENT BY 1
select RGHAVA_123.nextval from dual;
select RGHAVA_123.currval from dual;
CREATE SEQUENCE radhika_123
START WITH 2
INCREMENT BY 2
select radhika_123.nextval from dual;
select radhika_123.currval from dual
Pseudo Columns in Oracle
ROWNUM Returns the row number assigned to a row before ORDER BY (useful for limiting
rows).
ROWID Returns the unique address of a row in the database (physical location).
LEVEL Used with hierarchical queries (CONNECT BY) to indicate depth in a tree.
SYSDATE, CURRENTDATE Returns the current date and time from the server.
SYSTIMESTAMP Returns the current timestamp with time zone.
USER Returns the name of the current Oracle user.
CURRVAL Gets the current value of a sequence.
NEXTVAL Gets the next value from a sequence.
Level:
SELECT employee_id, manager_id, LEVEL
FROM employees
CONNECT BY PRIOR employee_id = manager_id
START WITH manager_id IS NULL;
Important Topics
1 SYSDATE arithmetic and error handling
2 LISTAGG function
3 Regular expressions
4 DUAL table object type
5 Purpose of the DUAL table
6 SQL statement execution process
7 Types of joins
8 COUNT(1) vs COUNT(*)
9 PIVOT function
10 JOIN vs UNION
11 Finding Nth highest salary
12 Views (Simple and Complex)
13 Updating complex views
14 Materialized views and refresh methods
15 Inline views
16 Inline view vs subquery
17 WHERE vs HAVING clause
18 Subquery vs correlated subquery
19 IN vs EXISTS operators
20 Analytical functions
21 RANK vs DENSE_RANK
22 Deleting duplicate values
23 Selecting duplicate values without GROUP BY
24 BTREE vs BINARY index
25 Global temporary tables
26 MERGE statement
27 NVL vs NVL2 functions
28 Primary key vs Unique constraint
29 CASE vs DECODE
30 TRUNCATE vs DELETE
31 Swapping column values
32 Pseudo columns
33 Query for 5th highest salary
34 Correlated subquery for salary comparison
35 Displaying odd/even numbered records
36 Self join
37 Indexes and types of indexes