title: sql select count from table by another table values
body: <p>i am beginner to sql database 
  i want some help .... i have two tables (families_table ) and (children_table ) that related via family_id so every family in families table has many of children in children table ...
  i want to select some families from family table , and know the number of children for all selected families .. i tries to do this by </p>
  
  <pre><code>select count (*) from dbo.Children where family_id in (select top 50 percent * from dbo.Families where economic_state = 'a' or economic_state = 'j')
  </code></pre>