Oracle Analytic Queries – Table create and populate script

The commands below will create and populate a table named Employees, which is used in many of the Oracle Analytic queries examples.

CREATE TABLE Employees (
  Name VARCHAR2(10),
  Location VARCHAR2(8),
  Department VARCHAR2(10),
  Salary NUMBER(7),
  HireDate DATE);

INSERT INTO Employees VALUES (
  'Donna',
  'Boston', 
  'IT',
  46000,
  DATE '2005-06-03');
INSERT INTO Employees VALUES (
  'Joe',
  'Boston',
  'IT',
  40000,
  DATE '2009-04-28');
INSERT INTO Employees VALUES (
  'Ji Ping',
  'Boston',
  'IT',
  63000,
  DATE '2010-12-14');
INSERT INTO Employees VALUES (
  'Tonya',
  'Detroit',
  'Accounting',
  60000,
  DATE '2008-11-04');
INSERT INTO Employees VALUES (
  'Antonio',
  'Detroit',
  'Accounting',
  51000,
  DATE '2012-10-08');
INSERT INTO Employees VALUES (
  'Manoharan',
  'Boston',
  'Marketing',
  60000,
  DATE '2009-03-30');
INSERT INTO Employees VALUES (
  'Juan',
  'Boston',
  'IT',
  75000,
  DATE '2005-09-25');
INSERT INTO Employees VALUES (
  'Shailaja',
  'Detroit',
  'Logistics',
  67000,
  DATE '2012-06-22');
INSERT INTO Employees VALUES (
  'Jamila',
  'Boston',
  'Marketing',
  45000,
  DATE '2012-08-11');

COMMIT;

Leave a Reply

Your email address will not be published. Required fields are marked *