create table EmployeeInfo
(
Id int,
Name varchar(200),
Address varchar(200)
)
//Insert multiple record into table with single query
insert EmployeeInfo values(1,'Ashish','Chandigarh'),(2,'Pankaj','Delhi'),(3,'Verma','UP'),(4,'Rahul','Chandigarh'),(5,'Seema','Punjab'),(6,'Satish','LKO'),(7,'Ramesh','Patna')
Table scan-
Table scan is that in which select statement is fired on a table which don't have any clustered index.
exp -
select * from EmployeeInfo
select * from EmployeeInfo where Id=1
(
Id int,
Name varchar(200),
Address varchar(200)
)
//Insert multiple record into table with single query
insert EmployeeInfo values(1,'Ashish','Chandigarh'),(2,'Pankaj','Delhi'),(3,'Verma','UP'),(4,'Rahul','Chandigarh'),(5,'Seema','Punjab'),(6,'Satish','LKO'),(7,'Ramesh','Patna')
Table scan-
Table scan is that in which select statement is fired on a table which don't have any clustered index.
exp -
select * from EmployeeInfo
select * from EmployeeInfo where Id=1
Covering Index (Clustered index scan) -
Select statement is execute on that table which have clustered index. To get all records from the table in such manner to cover all indexes of a table known as Covering Index and query is known as index query
Exp -
create table EmployeeInfo1
(
Id int primary key,
Name varchar(200),
Address varchar(200)
)
insert EmployeeInfo1 values(1,'Ashish','Chandigarh'),(2,'Pankaj','Delhi'),(3,'Verma','UP'),(4,'Rahul','Chandigarh'),(5,'Seema','Punjab'),(6,'Satish','LKO'),(7,'Ramesh','Patna')
select * from EmployeeInfo1
Exp -
create table EmployeeInfo1
(
Id int primary key,
Name varchar(200),
Address varchar(200)
)
insert EmployeeInfo1 values(1,'Ashish','Chandigarh'),(2,'Pankaj','Delhi'),(3,'Verma','UP'),(4,'Rahul','Chandigarh'),(5,'Seema','Punjab'),(6,'Satish','LKO'),(7,'Ramesh','Patna')
select * from EmployeeInfo1
No comments:
Post a Comment