MySQL添加、更新、删除数据
1、查询数据
select * from student;
2、添加数据
insert into student values(1,"张三","男",23,'1999-12-23','Java001','zhangsan@qq.com');
可以添加两条相同的数据,因为没有创建相应的约束constraint
insert into student values(1,"张三","男",23,'1999-12-23','Java001','zhangsan@qq.com');
也可以添加指定位置的数据,其他位置默认为空
insert into student (sno,name,sex,classname)values (3,"王五","男","Java002");
日期有多种写法,具体可以看我上一篇博客https://blog.csdn.net/qq_48759664/article/details/115578645
insert into student values(2,'李四','男',24,"1999/12/23","Java001","lisi@qq.com");
3、修改数据
update student set sex='女' where sno=2;
4、删除数据
delete from student where email is null;
删除数据库表student中所有数据