Schema Explorer
Navigate tables, views, indexes, and stored procedures in the Connections panel.
This tutorial teaches you SQL basics using SQL Developer. You'll learn SELECT, WHERE, ORDER BY, and JOIN — the building blocks of every database query.
# Tutorial
level = Beginner
time = 15 minutes
topics = SELECT · WHERE · ORDER BY · LIMIT · JOIN
prereq = SQL Developer + a database connection
# Examples
dialects = MySQL · PostgreSQL · Oracle · SQL Server · SQLite
tables_used = customers · orders · products
// includes a practice exercise at the end
After you download SQL Developer and connect to your database, you're ready to write queries.
Keyboard shortcut: Press Ctrl + N to open a new query window.
SELECT retrieves data from your database. It's the most common SQL command you'll use.
Use * to select every column from a table:
SELECT * FROM customers;
List the column names you want to retrieve:
SELECT first_name, last_name, email
FROM customers;
Ctrl + Enter — runs the current statementF5 — runs all statements in the editorResults appear in the panel below the editor.
The WHERE clause filters results to show only rows that match your conditions.
SELECT * FROM orders
WHERE total_amount > 100;
SELECT * FROM customers
WHERE country = 'USA';
-- Both conditions must be true
SELECT * FROM products
WHERE category = 'Electronics' AND price < 500;
-- Either condition can be true
SELECT * FROM customers
WHERE country = 'USA' OR country = 'Canada';
-- Names starting with 'J'
SELECT * FROM customers
WHERE first_name LIKE 'J%';
-- Email addresses from gmail
SELECT * FROM customers
WHERE email LIKE '%@gmail.com';
% matches any number of characters. _ matches exactly one character.
ORDER BY sorts your results in ascending (ASC) or descending (DESC) order.
SELECT * FROM products
ORDER BY price;
SELECT * FROM products
ORDER BY price DESC;
SELECT * FROM customers
ORDER BY country ASC, last_name ASC;
This sorts first by country, then by last name within each country.
When working with large tables, limit the number of rows returned. Syntax differs by database.
SELECT * FROM orders
ORDER BY order_date DESC
LIMIT 10;
-- Oracle 12c and later (preferred)
SELECT * FROM orders
ORDER BY order_date DESC
FETCH FIRST 10 ROWS ONLY;
-- Older Oracle
SELECT * FROM orders
WHERE ROWNUM <= 10
ORDER BY order_date DESC;
SELECT TOP 10 * FROM orders
ORDER BY order_date DESC;
JOIN combines rows from two or more tables based on a related column.
Returns only rows that have matching values in both tables:
SELECT orders.order_id, customers.first_name, orders.total_amount
FROM orders
INNER JOIN customers ON orders.customer_id = customers.customer_id;
Make your queries shorter and more readable:
SELECT o.order_id, c.first_name, c.last_name, o.total_amount
FROM orders o
INNER JOIN customers c ON o.customer_id = c.customer_id
WHERE o.total_amount > 100
ORDER BY o.order_date DESC;
Returns all rows from the left table, even if there's no match in the right table:
SELECT c.first_name, c.last_name, o.order_id
FROM customers c
LEFT JOIN orders o ON c.customer_id = o.customer_id;
Customers without orders will show NULL for order columns.
Try writing these queries in SQL Developer to lock in what you learned.
Tip: Use Ctrl + Space in SQL Developer for auto-complete suggestions as you type table and column names.
Continue learning with these related guides.
Navigate tables, views, indexes, and stored procedures in the Connections panel.
Auto-format messy SQL into clean, readable code with Ctrl+F7.
Execute .sql files and multiple queries with F5.
Speed up your workflow with 50+ shortcuts.
The best free SQL client for Windows 10/11. No account required.
See also: Installation · Schema Explorer