added query to SQL translation