Previous |
Next
What is the SQL CREATE TABLE Statement?The SQL CREATE TABLE statement is the SQL command that adds a new table to an SQL database. Tables are a basic unit of organization and storage of data in SQL. Each table tends to represent an entity such as a customer, product, code or event. A table is similar to a file in a non-database system.
How To Use the SQL CREATE TABLE StatementThe SQL CREATE TABLE command is used as follows. SQL CREATE TABLE Statement Syntax
The number of characters that can make up SQL table names and column names varies by DBMS. In many cases the limit is 30 characters. The leading character of the name must be alphabetic - not a number or special character. The name of a new table can not duplicate the name of an existing table and should not be the same as a SQL reserved word. The underscore character can be used to improve readability. The same column name can not be repeated within a table. List elements are seperated by commas. Here are some example datatypes:
SQL CREATE TABLE Statement Example The following example creates a table named product with columns named product_nbr, product_name, product_status_code, start_date, end_date and raw_material_cost_amt. This SQL CREATE TABLE Statement is executed:
|
| HOME | SQL OVERVIEW | SQL BASICS | SQL ADMINISTRATION | SQL ADVANCED | SQL SYNTAX |
| Copyright© 1999-2010, First Place Software, Inc. |


