Create a Table in Oracle APEX



ORACLE APEX BASICS

4 Ways to Create a Table in Oracle APEX (And When to Use Each One)

Oracle APEX sits right on top of an Oracle database, so there's more than one way to get a table into your schema. Some methods want you typing raw SQL, others let you click your way through a wizard, and one barely feels like database work at all. Here's a walkthrough of the four you'll run into most often.

1. SQL Commands (the direct route)

If you already know SQL, this is the fastest path. Head to SQL Workshop > SQL Commands and just type out your CREATE TABLE statement, then run it.

SQL
CREATE TABLE employees (
    empl_id            NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    empl_first_name    VARCHAR2(50) NOT NULL,
    empl_last_name     VARCHAR2(50) NOT NULL,
    empl_email         VARCHAR2(100),
    empl_hire_date     DATE DEFAULT SYSDATE,
    empl_salary        NUMBER(10,2)
);

This example uses an identity column instead of a manual sequence, which is the standard way to auto-generate a primary key on Oracle 12c and later. It saves you from setting up a sequence and a trigger separately.

Good for: anyone comfortable writing SQL who wants full control over data types, constraints, and naming from the start.

2. Object Browser (the point-and-click wizard)

Go to SQL Workshop > Object Browser, click the plus icon next to Tables, and choose Create > New Table. From there you name the table, then add columns one at a time using dropdowns for data type, length, and constraints.

There's no SQL to write. APEX builds the DDL behind the scenes and shows you a preview before it actually runs anything, so you can catch mistakes before they hit the database.

Good for: people who are still getting comfortable with SQL syntax, or anyone who just wants to see every option laid out instead of remembering the right keywords.

3. Quick SQL (the shorthand method)

This one's a bit of a hidden gem. Under SQL Workshop > Utilities > Quick SQL, you describe your table using plain indented text instead of full SQL, and APEX fills in the data types and constraints for you based on naming patterns it recognizes.

QUICK SQL
employees
  empl_first_name
  empl_last_name
  empl_email
  empl_hire_date date
  empl_salary number

Type that in, click Generate SQL, and Quick SQL produces a full CREATE TABLE statement complete with a primary key, an identity column, and sensible defaults, guessing column types from the names you gave it. You get a preview of the generated SQL before you run it, so nothing is hidden from you.

Good for: sketching out a whole data model fast, especially early in a project when you're mocking up several related tables at once.

4. Data Load Wizard (build a table from a spreadsheet)

If you already have your data sitting in a CSV or Excel file, you don't have to design a table first and import later. Go to SQL Workshop > Utilities > Data Workshop (or the Data Load option when building an app), upload your file, and APEX will read the columns, guess the data types, and offer to create a brand new table that matches.

You'll get a chance to rename columns, adjust the types it guessed, and confirm everything before APEX actually creates the table and loads your rows into it in one step.

Good for: migrating existing spreadsheets, or when the data itself already defines the structure you need.

Which one should you actually use?

MethodBest when
SQL CommandsYou know exactly what SQL you want to run.
Object BrowserYou'd rather click through options than type keywords from memory.
Quick SQLYou're roughing out a whole schema and want speed over precision.
Data Load WizardYour data already lives in a spreadsheet and you just need it in Oracle.

Summary
  • SQL Commands gives you full control if you already know the syntax you want.
  • Object Browser trades typing for clicking, which is handy while you're still learning.
  • Quick SQL lets you sketch out tables fast using shorthand instead of full DDL.
  • The Data Load Wizard builds a table straight from a spreadsheet, no manual design required.

Comments