totn Oracle Functions

Oracle / PLSQL: DDL/DML (ROWNUM Function)

If you have an Oracle database and want to follow along with the examples in the ROWNUM function tutorial, we have included the DDL and DML that you will need below.

Just follow the instructions to populate your database. Then click the following button to return to the ROWNUM function tutorial so that you can try the examples for yourself.

Return to Tutorial

DDL for Tutorial Examples

DDL stands for Data Definition Language and are the statements required to create the tables used in the ROWNUM examples.

Execute the following DDL statement in your Oracle database:

CREATE TABLE customers
( customer_id number(10) NOT NULL,
  last_name varchar2(50) NOT NULL,
  first_name varchar2(50) NOT NULL,
  favorite_website varchar2(50),
  CONSTRAINT customers_pk PRIMARY KEY (customer_id));

DML for Tutorial Examples

DML stands for Data Manipulation Language. These are the INSERT statements that you will need to run in your Oracle database to populate the data:

Execute the following DML statements in your Oracle database:

INSERT INTO customers
(customer_id, last_name, first_name, favorite_website)
VALUES
(4000,'Jackson','Joe','www.techonthenet.com');

INSERT INTO customers
(customer_id, last_name, first_name, favorite_website)
VALUES
(5000,'Smith','Jane','www.digminecraft.com');

INSERT INTO customers
(customer_id, last_name, first_name, favorite_website)
VALUES
(6000,'Ferguson','Samantha','www.bigactivities.com');

INSERT INTO customers
(customer_id, last_name, first_name, favorite_website)
VALUES
(7000,'Reynolds','Allen','www.checkyourmath.com');

INSERT INTO customers
(customer_id, last_name, first_name, favorite_website)
VALUES
(8000,'Anderson','Paige',NULL);

INSERT INTO customers
(customer_id, last_name, first_name, favorite_website)
VALUES
(9000,'Johnson','Derek','www.techonthenet.com');