title: Select count from another table to each row in result rows
body: <p>Here are the tables:</p>
  
  <pre><code>CREATE TABLE [dbo].[Classes](
      [ClassId] [int] NOT NULL,
      [ClassName] [nvarchar](50) NOT NULL,
   CONSTRAINT [PK_Classes] PRIMARY KEY CLUSTERED 
  (
      [ClassId] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  GO
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[Students](
      [StudentId] [int] NOT NULL,
      [ClassId] [int] NOT NULL,
   CONSTRAINT [PK_Students] PRIMARY KEY CLUSTERED 
  (
      [StudentId] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  GO
  ALTER TABLE [dbo].[Students]  WITH CHECK ADD  CONSTRAINT [FK_Students_Classes] FOREIGN KEY([ClassId])
  REFERENCES [dbo].[Classes] ([ClassId])
  GO
  ALTER TABLE [dbo].[Students] CHECK CONSTRAINT [FK_Students_Classes]
  GO
  </code></pre>
  
  <p>I want to get list of class, and each class - the number of student which belong to each class.
  How can I do this?</p>