SQL CREATE

SQL CREATE

CREATE command used to create tables, views, database and indexes.

CREATE TABLE table1 ( column1 datatype, column2 datatype)

Table1 will be created with two columns of specified data types. Common data types are character, integer, decimal, date and time.

CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name

Creates a database named db_name.

CREATE INDEX index_name [index_type] ON tbl_name (index_col_name,…)

Create Indexed based on the columns selected

CREATE VIEW view_name AS SELECT Col1, Col2 FROM Table1

View view_name will be created based on Col1 and Col2 of Table1.

264 views

Return to top