SQL Queries
SQL Queries: free step-by-step lesson with examples, common mistakes, and interview tips — part of Oracle SQL Tutorial on Toolliyo Academy.
On this page
Oracle SQL Tutorial · Lesson 55 of 96
SQL Queries
Setup & Connect ✓ → Architecture & SQL ✓ → DBA & Tuning → Projects
DBA & Tuning · 3 — Production · ~10 min · Oracle — SQL & PL/SQL
What is this?
SQL queries read and filter rows from tables with SELECT, WHERE, ORDER BY, and GROUP BY. In Oracle you often use dual for expressions and NVL/COALESCE for nulls.
Why should you care?
Almost every screen in banking and ERP is a SELECT under the hood — accounts, balances, tickets, invoices.
See it live — copy this example
Run these statements in SQL Developer or SQL*Plus against your lab PDB. Prefer a practice user — not SYS — for application SQL.
-- OracleCore sample
CREATE TABLE customers (
customer_id NUMBER PRIMARY KEY,
full_name VARCHAR2(100) NOT NULL,
city VARCHAR2(50),
balance NUMBER(12,2) DEFAULT 0
);
INSERT INTO customers VALUES (1, 'Asha Rao', 'Bengaluru', 25000);
INSERT INTO customers VALUES (2, 'Vikram Shah', 'Mumbai', 18000);
COMMIT;
SELECT customer_id, full_name, balance
FROM customers
WHERE city = 'Bengaluru'
ORDER BY balance DESC;
What happened?
- CREATE TABLE defines columns.
- INSERT adds rows.
- COMMIT saves them.
- SELECT filters Bengaluru customers and sorts by balance.
Practice next
- Run the CREATE/INSERT/COMMIT in SQL Developer.
- Run the SELECT.
- Change the city filter to Mumbai.
- Add a third customer.
- Select only full_name and city.
Remember
SELECT reads rows; WHERE filters; ORDER BY sorts. COMMIT makes DML visible to others. Practice on small tables first.
Branch customer list
Branch manager needs Bengaluru customers sorted by balance for a campaign.
Outcome: One clear SELECT replaces a messy Excel export.
Interview prep for this lesson
Practice these questions aloud after reading—each links to a full structured answer.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!