[FIX] Update SQL generation