Microsoft SQL Server Analyzing a Query