Home

Creating a Table

  
 

Description

The primary formula to create a table is:

CREATE TABLE Country(Column1, Column2, Column3)

You can also write each column on its own line:

CREATE TABLE TableName(
Column1,
Column2,
Column-n);

After the CREATE TABLE expression, enter the name of the table followed by parentheses. Inside the parentheses, create the columns. Each column uses the following formula:

ColumnName DataType Options

A column starts with a name, followed by a data type, followed by some options. Here is an example of creating a table:

SQL> CREATE TABLE Employees
  2  (
  3     EmployeeNumber int,
  4     FirstName varchar2(20),
  5     LastName varchar2(20),
  6     HourlySalary decimal(6, 2)
  7  );

Table created.

SQL>

 

 
     
 

Home Copyright © 2009-2010 FunctionX, Inc.