Test SQL queries on record arrays