The CREATE TABLE statement is used to create a database table. A table creation statement requires three parameters. The name of table specify table name in database. The column parameters specify the names of the columns of the table. The datatype parameter specifies the type of data to be store (e.g. varchar, integer, date, etc.).
Tip: In order to get compelet details of the available data types, go to our Oracle Data Types section.
In the above example, The pk column is of type int NOT NULL and will hold an integer. The NOT NULL is a field attribute and it is used to make sure field should not be NULL.
The firstName, lastName and address fields are of type varchar and will hold characters with specified length. The NULL is a field attribute and it is used to allow NULL value to be stored.
A primary key is a single field or combination of fields that contains a unique record. The primary key can not be null value. A table can have only one primary key.