Oracle SQL Learning Environment Setup Guide
1. Install Oracle Database Locally
You'll need a local Oracle Database to connect to. There are a few easy options:
Option A: Use Oracle Database Free 23c (Recommended for learning)
- Download link: [Link]
- Choose: Oracle Database 23c Free - Developer Release
- Install it on your machine (Windows/Linux/Mac with Docker)
- It comes with a default service name (e.g., FREEPDB1) and port 1521.
2. Install SQL Developer
- Download from: [Link]
- Install and launch SQL Developer on your computer.
3. Sample Databases (Optional but useful)
You can install the HR sample schema:
- Locate HR_main.sql from your Oracle installation or download from:
[Link]
- Run in SQL Developer:
@/path/to/hr_main.sql
- Unlock the HR account and set a password during setup.
4. Connect from SQL Developer
1. Open SQL Developer.
2. Create a new connection with the following settings:
- Username: hr (or your schema)
- Password: (your password)
- Hostname: localhost
- Port: 1521
- Service Name: FREEPDB1 (or your PDB)
3. Click Test, then Connect.
5. Bonus: Create Your Own Tables
Run the following SQL commands in SQL Developer:
CREATE TABLE students (
student_id NUMBER PRIMARY KEY,
name VARCHAR2(100),
grade NUMBER
);
INSERT INTO students VALUES (1, 'Alice', 90);
INSERT INTO students VALUES (2, 'Bob', 85);
6. Teaching Tip
Start with these core SQL concepts:
- SELECT statements
- WHERE, ORDER BY
- INSERT, UPDATE, DELETE
- JOINS (use HR schema)
- Functions like COUNT, SUM, AVG