Add the SQL version of the second query.