updated SQL from latest DB