create assignment query