How to Create a Table in Oracle

Last updated August 25, 2026 · By the SaturnSQL team

Use CREATE TABLE with NUMBER, VARCHAR2, and DATE. Always use VARCHAR2, never VARCHAR, and watch BYTE vs CHAR length semantics on multibyte data.

CREATE TABLE employees (
    employee_id   NUMBER PRIMARY KEY,
    first_name    VARCHAR2(50),
    last_name     VARCHAR2(50) NOT NULL,
    email         VARCHAR2(100 CHAR),
    hire_date     DATE DEFAULT SYSDATE,
    salary        NUMBER(10,2),
    created_at    TIMESTAMP DEFAULT SYSTIMESTAMP
);

VARCHAR2 vs VARCHAR

Oracle reserves VARCHAR as a synonym for VARCHAR2 today, but the documentation warns its semantics may change in a future release and it may not always mean variable-length character data. Use VARCHAR2 everywhere; nothing in Oracle requires VARCHAR. CHAR, by contrast, is fixed-length and blank-pads shorter values, which trips up equality comparisons against VARCHAR2 columns.

BYTE vs CHAR length semantics

VARCHAR2(100) means 100 bytes by default (controlled by NLS_LENGTH_SEMANTICS), not 100 characters. On a multibyte character set like AL32UTF8, a column sized for byte semantics can silently reject strings well short of 100 characters. Append CHAR explicitly, as in VARCHAR2(100 CHAR), when the length should mean characters regardless of encoding.

NUMBER with no precision or scale stores any numeric value Oracle can represent, which is convenient but gives up validation; prefer NUMBER(p,s) for anything with a known range, like money or quantities.

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Do more with Oracle

Related Oracle guides