O'Reilly logo

Visual Basic® .NET Database Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CREATE TABLE

After you create a database, you need to add tables to it. Tables hold a lot of information about the database structure. They hold the table’s field definitions, index definitions, and relational information.

Because tables hold so much information, the CREATE TABLE statement is quite complicated. The basic syntax looks like this:

CREATE TABLE table_name ( 
    field_name data_type [(size)] [DEFAULT default] [NOT NULL] 
[column_constraint], 
    field_name data_type [(size)] [DEFAULT default] [NOT NULL] 
[column_constraint], 
    ... 
    field_name data_type [(size)] [DEFAULT default] [NOT NULL] [column_constraint] 
[, CONSTRAINT table_constraint, ...] 
) 

The meanings of the parameters are

  • field_name— Gives the name of the table’s field.

  • data_type ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required