Test SQL generation.