Updated DatabaseQuery to handle update statements