码迷,mamicode.com
首页 > 数据库 > 详细

3-28 MySQL 增删改

时间:2019-03-28 09:27:06      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:图片   mysql   like   hone   http   tab   auto   技术   def   

 

 

 

 

技术图片

 

CREATE TABLE student(
id int(4) NOT NULL PRIMARY key     auto_increment,
`name` VARCHAR(20) NOT NULL DEFAULT ‘匿名‘,
sex VARCHAR(2) NOT null DEFAULT ‘1‘,
phone BIGINT(11),
role int(2),
score int(4)

)

INSERT INTO student 
VALUES (DEFAULT,‘zhangsan‘,2,13837689458,1,54);
INSERT INTO student 
VALUES (DEFAULT,‘lisi‘,2,18888888888,2,90);
INSERT INTO student 
VALUES (DEFAULT,‘wangwu‘,1,16666666666,3,94);
INSERT INTO student 
VALUES (DEFAULT,‘zhaoliu‘,2,15555555555,3,82);

UPDATE student SET Phone=18650170763 WHERE id=2;

SELECT*FROM student WHERE score<60;

SELECT* FROM student WHERE name LIKE‘z%‘;

SELECT * FROM student WHERE role IN (1,3);
DELETE FROM student WHERE role=1;

DELETE FROM student;

 

3-28 MySQL 增删改

标签:图片   mysql   like   hone   http   tab   auto   技术   def   

原文地址:https://www.cnblogs.com/bozhu-liu/p/10612717.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!