.NET and SQL Server interview questions - Typical complicated SQL Query asked in .NET interview to test your SQL “Group by” Clause syntax capability?

 Posted by ArticlesMaint on 7/18/2011 | Category: Sql Server Interview questions | Views: 13131

Let us assume that we have the following table of Tourist with their respective rows,columns and data.

Assuming the above table, we have to display the total number of tourists from the different part of the countries.
In order to achieve the required result we have to use SQL “Group by” clause.

Query: -

select T1.TouristCountry,count(T1.TouristName) as NumberOfTourist from
Tourist T1 group by T1.TouristCountry

Output: -

Hence you can see that the total number of tourist belongs from different countries has been displayed.

You will be also interested in watching the below video: -

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response