Execute below query
Syntax :
use Database_Name
go
Create Table Table_Name
(
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional),
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional),
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional),
...
...
...
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional)
)
Example:
use test
go
Create Table tblPersonInfo
(
ID int NOT NULL Primary Key,
Name nvarchar(50) NOT Null,
Email nvarchar(50) Null
)
Note :
1. use Database_Name
go
--this command is used to enforce the SQL Server to create table in the appropriate database (Optional command) supply that database name in which you want to create table
2. Create Table Table_Name
-- Here you have to provide meaning full Table name
3. Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional)
-- Column_Name - here you have to supply meaning full column name
-- Data_Type(Data_Length) - supply valid data type as per your column's requirement, Data type could be INT, VARCHAR, NVARCHAR etc. and length of data type depend upon column
-- Null/Not Null - choose either NULL or NOT NULL. it's depend on database designer whether he want to enforce user to supply data or not in that column.
4. Key_Constraint(Optional)
-- there should be only one Primary Key reside in a particular table
-- It could be Primary Key that maintain database integrity, means in which column you define Primary Key that column accept only unique data on that particular column
Syntax :
use Database_Name
go
Create Table Table_Name
(
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional),
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional),
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional),
...
...
...
Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional)
)
Example:
use test
go
Create Table tblPersonInfo
(
ID int NOT NULL Primary Key,
Name nvarchar(50) NOT Null,
Email nvarchar(50) Null
)
Note :
1. use Database_Name
go
--this command is used to enforce the SQL Server to create table in the appropriate database (Optional command) supply that database name in which you want to create table
2. Create Table Table_Name
-- Here you have to provide meaning full Table name
3. Column_Name Data_Type(Data_Length) Null/Not Null Key_Constraint(Optional)
-- Column_Name - here you have to supply meaning full column name
-- Data_Type(Data_Length) - supply valid data type as per your column's requirement, Data type could be INT, VARCHAR, NVARCHAR etc. and length of data type depend upon column
-- Null/Not Null - choose either NULL or NOT NULL. it's depend on database designer whether he want to enforce user to supply data or not in that column.
4. Key_Constraint(Optional)
-- there should be only one Primary Key reside in a particular table
-- It could be Primary Key that maintain database integrity, means in which column you define Primary Key that column accept only unique data on that particular column