/*添加数据*/
insert into studenttable(id,name,age) values(1,'张无忌',18);
/*1、列名和值要一一对应
2、如果表名后,不定义列名,则默认给所有列添加值*/
INSERT INTO studenttable VALUES(2,'赵敏',17,99.9,null);
INSERT INTO studenttable VALUES(3,'刘亦菲',25,80,NULL,'女');
/*查看数据*/
SELECT * from studenttable;
/*删除数据*/
delete from studenttable where id=1;
/*删除表,然后再创建一个一模一样的新表*/
truncate table studenttable;
/*删除一个表*/
drop table studenttable;
/*修改数据*/
update studenttable set age=20 ,score=90 where id=1
DML增删改表中的数据
最新推荐文章于 2024-07-11 21:41:59 发布