Transact-SQL A TO Z using for SQL Server

the CREATE DATABASE statement is used to create a database
---------------------------------------------------------------------
CREATE DATABASE database_name

EXAMPLE
create database student
 ------------


create  table employee

(
    ecode char(10),
    ename varchar(30),
    city char(20),
    salary money,
    age int
)


drop table employee


insert into employee values ('e001','manash','kolkata',26000,26)
insert into employee values ('e002','saikat','london',26000,26)
insert into employee values ('e003','plash','bengalore',26000,26)
insert into employee values ('e004','sundip','mumbai',26000,26)
insert into employee values ('e005','sudip','santipur',26000,26)
insert into employee values ('e006','babon','kolkata',26000,26)
insert into employee values ('e007','aniban','london',26000,26)
insert into employee values ('e008','souvik','kolkata',26000,26)



select * from employee

create table loan
(
    ecode char(10),
    loanamnt money,
    loandate datetime,
    emi money

)

insert into loan values ('eoo1',80000,4/8/2009,500)
insert into loan values ('eoo2',56200,5/9/2008,400)
insert into loan values ('eoo3',54000,3/8/2009,300)
insert into loan values ('eoo4',98000,2/2/2010,400)
insert into loan values ('eoo5',88000,7/6/2007,350)
insert into loan values ('eoo6',89000,5/5/2006,400)
insert into loan values ('eoo7',88000,4/7/2005,600)



--display the current year
select datepart (year,getdate())as 'current year'
--display current date ,month & year
select datepart ()








sql server index

sql index An index is an internal table structure that sql server uses to provide quick access to rows of a table based on the values...