title: Does LINQ-to-SQL Support Composable Queries?
body: <p>Speaking as a non-C# savvy programmer, I'm curious as to the evaluation semantics of LINQ queries like the following:</p>
  
  <pre><code>var people = from p in Person
               where p.age &lt; 18
               select p
  
  var otherPeople = from p in people
                    where p.firstName equals "Daniel"
                    select p
  </code></pre>
  
  <p>Assuming that <code>Person</code> is an ADO entity which defines the <code>age</code> and <code>firstName</code> fields, what would this do from a database standpoint?  Specifically, would the <code>people</code> query be run to produce an in-memory structure, which would then be queried by the <code>otherPeople</code> query?  Or would the construction of <code>otherPeople</code> merely pull the data regarding the query from <code>people</code> and then produce a new database-peered query?  So, if I iterated over both of these queries, how many SQL statements would be executed?</p>