Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I was asked a question in interview.Suppose an employee table with columns ID,Name,Age,
Sex,Designation and there are lakhs of records.

Query is
Select Name,Age,Sex from Employee where Designation=@EmpDesignation.

WHat is alternative query to improve the performance on database.How can we do that

Thanks in advance
Posted
Comments
ridoy 29-Sep-13 3:48am    
I think indexing would be a good option and also use a LIKE operator.
bluesathish 30-Sep-13 3:47am    
create a index on designation column would reduce the retreiving time.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900