write sql scripts