I have few questions on SQL..
How to analyze the performance of a query? Any software, inbuilt features of MSSQL server 2005/2008?
What shou
MSSQL generally comes with a built in gui tool called Query Analyser which describes how the query will be executed.
For 2) you could rewrite as:
SELECT *
FROM enquiry_courses ec
WHERE EXISTS (select 1 FROM enquiries e
WHERE e.enquiry_id = ec.enquiry_id
and e.session_id ='4cd3420a16dbd61c6af58f6199ac00f1' )
but I can't believe it would make any performance difference in a modern RDBMS.