Tests on Sql Generation