SQL*Plus hints

Online Help

Creating a table

create table tableName(
  field type (length) constraints,
  field2 type (length) constraints,
);

Basic Field Types

Column restraints

Viewing a table

describe tableName;
shows the table's metadata
select * from tableName;
shows all the data in the table

Adding records

INSERT INTO tableName VALUES(1, 'text', 45);

Changing records

UPDATE tableName
SET column = value
WHERE condition;

Importing a script

Script file is named myScript.sql
start myScript;

Deleting a table definition

DROP tableName;

Selecting data

Conditions

Operators

Date Functions

Aggregate functions

Views

  CREATE VIEW viewName AS select statement

Report formatting


© Andy Harris
Indiana University / Purdue University, Indianapolis
email: aharris@cs.iupui.edu
homepage: http://www.cs.iupui.edu/~aharris