Q:

SQL Get count of users who participated in a survey

I want to know how I can write a SQL query to get the count of users who participated in each month survey
The table structures are like below
SurveyTable
SurveyId, SurveyName, Datetime

SurveyInfo
Id, SurveyId, First name, Last name DateTime

Sample Data
SurveyTable
1  Survey-ABC 1 Jan 2011
2  Survey-AXC 1 Feb 2011
3  Survey-AEW 1 Mar 2011
4  Survey-AVD 1 Apr 2011
....

SurveyInfo
1  1  Peter James 1 Jan 2011
2  1  John Tom    1 Jan 2011
3  1  Harry Kin   1 Jan 2011
4  2  Amber Wills 1 Feb 2011
5  2  Tom Kin     1 Feb 2011

I want a result like 

3 users participated in Survey-ABC, 
2 users participated in Survey-AXC

Thanks

A:

SELECT stab.Name, COUNT(si.ID)
FROM SurveyTable as stab INNER JOIN SurveyInfo si ON si.SurveyId = stab.SurveyId
GROUP BY stab.Name

