What is SQL?

SQL stands for Structured Query Language. It is used to:

  • SELECT data from tables

  • INSERT new data into tables

  • UPDATE existing records

  • DELETE unwanted data

  • Manage database objects like tables, users, and views

  • Control access rights and permissions

SQL – The Gateway to the Database

SQL is the primary way to interact with a relational database. Think of it as the window to the database — without it, you can’t retrieve, manipulate, or store data in Oracle or any RDBMS.


It’s a 4GL (Fourth Generation Language) — designed to be simple, efficient, and user-friendly, especially compared to older, more complex languages.

A Brief History of SQL

  • SQL was not created by Oracle.

  • It evolved from the work of Dr. E.F. Codd and IBM in the 1970s.

  • Today, it is standardized by ANSI (American National Standards Institute).

  • Oracle supports ANSI SQL but adds enhancements via its SQL*Plus tools.

SQL*Plus – Oracle's SQL Interface

Oracle provides SQL*Plus as a utility to run SQL and PL/SQL commands. It comes in multiple forms:

  1. Command Line – via DOS or Unix terminal
  2. GUI Tools – like SQL Developer, SQL Worksheet, or Enterprise Manager

  3. Web-Based – iSQL*Plus (available from Oracle 10g onward)

These tools allow you to connect and interact with both local and remote Oracle databases.

SQL Syntax Examples:

-- SELECT: Fetch records
SELECT first_name, salary FROM employees WHERE department_id = 10;

-- INSERT: Add a new row
INSERT INTO employees (employee_id, first_name, salary) 
VALUES (101, 'Amit', 50000);

-- UPDATE: Change existing data
UPDATE employees SET salary = 60000 WHERE employee_id = 101;

-- DELETE: Remove a row
DELETE FROM employees WHERE employee_id = 101;

Types of SQL Statements

SQL commands can be grouped into five main categories:

  1. Data Query Language (DQL)

    • Used to query the database.

Examples:

SELECT * FROM employees;

   2. Data Definition Language (DDL)

    • Used to define and modify database structure.

    • Commands: CREATE, ALTER, DROP, TRUNCATE

Examples:

CREATE TABLE students (id NUMBER, name VARCHAR2(50));

   3. Data Manipulation Language (DML)

    • Used to manipulate data within tables.

    • Commands: INSERT, UPDATE, DELETE

Examples:

UPDATE employees SET salary = 55000 WHERE id = 101;

   4. Transaction Control Language (TCL)

    • Manages transactions in the database.

    • Commands: COMMIT, ROLLBACK, SAVEPOINT

Examples:

COMMIT;

   3. Data Control Language (DCL)

    • Controls access to data.

    • Commands: GRANT, REVOKE

Examples:

GRANT SELECT ON employees TO hr_user;

Tools to Run SQL in Oracle

ToolDescription
SQL*Plus CLICommand-line interface for running SQL & PL/SQL commands
iSQL*PlusWeb-based version of SQL*Plus (Oracle 10g)
SQL DeveloperGUI tool for running and debugging SQL/PLSQL
Enterprise ManagerWeb GUI to monitor and manage the database

Why Learn SQL?

  • SQL is universal across databases like MySQL, Oracle, PostgreSQL, SQL Server.

  • Knowing SQL is a core skill for developers, DBAs, analysts, and testers.

  • It forms the foundation of PL/SQL and many backend systems.

Scroll to Top