Monday, 28 May 2018

SQL CREATE TABLE COMMAND:

CREATE TABLE COMMAND IS USE TO CREATE NEW TABLE IN PARTICULAR DATABASE.

TEH SQL CREATE COMMAND SYNTAX:

CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column1 datatype,
column2 datatype,
................)

>column is created the upper side of the table.

=see all data type in sql=DATA TYPE IN SQL

SQL CREATE TABLE COMMAND EXAMPLE:

The following Example creates a table name employee are contained id,name, mobile, address, position.

  • CREATE TABLE employee(id int,
name varchar(30),

mobile_no int,

address varchar(100),

position varchar(20)

);

Tabel look like this:-
id        name          mobile_no         address          position
CREATE TABLE USING ANOTHER EXCITING TABLE:

In new table contain all column they are already present in an exciting table.
The table is created with the help of SELECT AND CREATE TABLE COMMAND

SYNTAX:

CREATE TABLE new_table_name AS 

SELECT column1,column2,column3,.....

FROM exiting_table_name 

WHERE ......;

  

No comments:

Post a Comment