edited sql