We Create Database in SQL Server
Step 1. Firstly open Computer and Click on SQL Server then Create DataBase.
Step 1. Write Query of creation of Database in Sql Server like this-
Syntex
CREATE DATABASE DATABASE_NAME
Note- Here DATABASE_NAME is Created Database Name. Whatever u want to giveProper name
of Database
Ex.
CREATE DATABASE Management
Execute this query then Data base is created with Management name and we use tis data base then Write .
Use DataBase_Name
Ex.
Use Management
Execute this query then we easly access this database and use for table and also use store procedure and function also.
CREATE Table in SQL.
Syntex-
Set Identity (Increment by 1) and CityName is Name of City This is navrchar type give limit 200
and last is CreateDate is Date mention default GETDATE() means current Date in this DATETIME is datatype.
Step 1. Firstly open Computer and Click on SQL Server then Create DataBase.
Step 1. Write Query of creation of Database in Sql Server like this-
Syntex
CREATE DATABASE DATABASE_NAME
Note- Here DATABASE_NAME is Created Database Name. Whatever u want to giveProper name
of Database
Ex.
CREATE DATABASE Management
Execute this query then Data base is created with Management name and we use tis data base then Write .
Use DataBase_Name
Ex.
Use Management
Execute this query then we easly access this database and use for table and also use store procedure and function also.
CREATE Table in SQL.
Syntex-
Create Table Table_Name
(
ColumnName1
)
)
SQL Exmple-
Create Table City
(
CityId Int IDENTITY(1,1) PRIMARY KEY,
CityName NVARCHAR(200),
CreateDate DATETIME Default GETDATE()
)
Note- Here "City" is Table Name and CityId ColumnName1 this is int type and primary key and(
CityId Int IDENTITY(1,1) PRIMARY KEY,
CityName NVARCHAR(200),
CreateDate DATETIME Default GETDATE()
)
Set Identity (Increment by 1) and CityName is Name of City This is navrchar type give limit 200
and last is CreateDate is Date mention default GETDATE() means current Date in this DATETIME is datatype.
0 comments :
Post a Comment