Added test case for flat fields in SQL