Featured image of post Oracle in a Nutshell

Oracle in a Nutshell

Oracle DB Deep Dive: History, Features, and Code Examples

Introduction

Ah, Oracle Database. The granddaddy of enterprise databases. The software equivalent of a Swiss Army knife—but instead of a few handy tools, it’s got a thousand, and most of them require a certification to use properly.

A Brief History of Oracle (a.k.a. The Rise of the Database Empire)

It all started in the late 1970s when a few bright minds decided they wanted to organize data better. Larry Ellison, Bob Miner, and Ed Oates founded Oracle Corporation (then called “Software Development Laboratories”). Their mission? To build a relational database before relational databases were cool.

  • 1979 – Oracle v2 (Yes, they skipped v1 to look more advanced) was released. It was the first commercially available relational database.
  • 1983 – Oracle v3 introduced transaction management and locking. Now you could actually trust your data wouldn’t disappear.
  • 1988 – Oracle 6 brought PL/SQL, making developers simultaneously love and curse the language.
  • 2001 – Oracle 9i introduced XML support, making databases just a little bit more complex than they already were.
  • 2013-Present – Oracle keeps getting bigger, faster, and more expensive. Cloud offerings, autonomous databases, and AI-powered optimizations became the new trends.

And here we are today, still dealing with ORA-00942: Table or view does not exist errors like it’s a rite of passage.

Why Oracle DB?

So, why do enterprises still throw their money at Oracle? Well, because it does everything—just sometimes with a bit of an attitude.

  • Scalability: You want a database that can handle petabytes of data? Oracle’s got you.
  • Performance Tuning: Indexes, partitions, materialized views—it’s a playground for DBAs.
  • Security: Your data is safe unless you forget your GRANT and REVOKE statements.
  • PL/SQL: Oracle’s own procedural language lets you write stored procedures, functions, and packages to keep your logic close to the data.

Oracle DB Code Examples

Enough talk. Let’s get our hands dirty with some SQL and PL/SQL.

1. Creating a Table

1
2
3
4
5
6
CREATE TABLE employees (
    id NUMBER PRIMARY KEY,
    name VARCHAR2(100) NOT NULL,
    position VARCHAR2(50),
    salary NUMBER(10,2)
);

Nice and simple. A table for employees, because every database needs one.

2. Inserting Data

1
2
INSERT INTO employees (id, name, position, salary)
VALUES (1, 'Alice Johnson', 'Senior Developer', 120000);

Boom! Alice is in the system.

3. Selecting Data

1
SELECT * FROM employees WHERE salary > 100000;

Because only the high rollers matter in this example.

4. Creating a Stored Procedure

1
2
3
4
5
CREATE OR REPLACE PROCEDURE give_raise(emp_id NUMBER, amount NUMBER) IS
BEGIN
    UPDATE employees SET salary = salary + amount WHERE id = emp_id;
    COMMIT;
END;

Want a raise? Just call this procedure and hope HR doesn’t notice.

5. Indexing for Performance

1
CREATE INDEX idx_employee_salary ON employees(salary);

Because nobody likes slow queries.

6. Handling Errors in PL/SQL

1
2
3
4
5
6
7
BEGIN
    INSERT INTO employees (id, name, position, salary)
    VALUES (1, 'Bob Smith', 'Manager', 130000);
EXCEPTION
    WHEN DUP_VAL_ON_INDEX THEN
        DBMS_OUTPUT.PUT_LINE('Duplicate ID! Try again.');
END;

Oracle: You shall not pass! (without handling duplicate keys properly).


Key Ideas

ConceptSummary
HistoryOracle started in 1979, skipped v1, and became the database giant it is today.
FeaturesScalability, security, performance tuning, and PL/SQL make Oracle stand out.
SQL BasicsCreating tables, inserting data, and querying data are foundational.
PL/SQLStored procedures, error handling, and procedural logic help automate tasks.
IndexingImproves query performance, especially on large datasets.

References