name conflict fixes in sql query