数据库管理1

create table stu(
 `id` int(2) PRIMARY key auto_increment,
 `name` varchar(20),
 `sex` int(2),
 `phone` varchar(11),
 `role` int(2),
 `score` int(2)
)
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'zhangsan',2,'13837689458',1,54);
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'lisi',2,'18537689458',2,90);
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'wangwu',1,'15937689458',3,94);
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'zhaoliu',2,'13037689458',3,82);
UPDATE stu set phone='13297973866' where `name`='lisi';
SELECT * from stu where score<60;
SELECT * from stu where `name` like 'z%';
SELECT * from stu where role in (1,3);
DELETE from stu where role=1;
DELETE from stu;
TRUNCATE stu;
 
原文地址:https://www.cnblogs.com/Zhangchuanfeng1/p/10615692.html