Abstract syntax trees for SQL queries