数据库表
查询
SELECT * FROM `user` WHERE 1 //查询user表
SELECT * FROM `user` WHERE `name`='gml' AND `password`='gml123' //在user表中查询`name`='gml' 并且 `password`='gml123'的数据
SELECT * FROM `user` WHERE `name` LIKE 'wl_' //_代表一个字符;%代表一个或者多个字符
SELECT * FROM `user` WHERE 1 LIMIT 1,1 //第一个1代表索引为位置,第二代表截取几个
SELECT * FROM `user` WHERE 1 ORDER BY score ASC //排序:ORDER BY ASC:升序 desc:降序
SELECT `name` ,score FROM `user` WHERE 1 //只查询name ,score
插入
INSERT INTO `user` (name,password,score)
VALUES('zh','zh123',6666)
修改
UPDATE `user` set score=5555 WHERE `name`='zh'
UPDATE `user` set score=6666 WHERE `name` LIKE 'z_'
删除
DELETE FROM `user` WHERE name='zh'