20:49:17 select * from student where year(sbirthdate)=2002and ssex="女" Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssex="女"' at line 1 0.000 sec
解决方法:加上分隔符。1064这表示没有打分隔符(;)
20:44:58 INSERT INTO student(sno,sname,ssex,sbirthdate,smajor) VALUES ('20180121','李勇','男',CAST('1998-3-1' AS DATE),'计算机科学与技术') Error Code: 1062. Duplicate entry '20180121' for key 'PRIMARY' 0.000 sec
解决方法:不要再插入相同主键,表示数据已近插入到表中发生了重复插入主键的错误