SQL Create Table - Creating Table in SQL



SQL CREATE TABLE Statement

  • The CREATE TABLE statement is used to create a new table in a database.

Syntax

  CREATE TABLE  table_name (
    column1 datatype,
    column2 datatype,
    column3 datatype,
    .... 
    );
  • The column parameters specify the names of the columns of the table. The datatype parameter specifies the type of data the column can hold (e.g. varchar, integer, date, etc.).

SQL CREATE TABLE Example

  • The following example creates a table called "wikitechytable" that contains five columns: id, name, course, and fees:
 CREATE TABLE  wikitechytable(
	id  int ,
	name  varchar(50),
	course  varchar(50),
	fees  varchar(50)
        )

Output

create-table-1

Related Searches to SQL Create Table - Creating Table in SQL