1,增语句
INSERT INTO 表名称 (字段列表) VALUES (值1,值2...)
INSERT INTO Persons VALUES ('Gates','Bill','hello word','增加了一行数据')
在指定的列中插入数据
INSERT INTO Persons (LastName, Address) VALUES ('Liming', 'anhui')
2.删语句
DELETE FROM 表名称 WHERE 列名称=值
DELETE FROM Persons WHERE LastName='liming'
删除所有行,保留空表
DELETE FROM Persons
3.改语句
UPDATE 表名称 SET 列名称=新值 WHERE 列名称=某值
更新某一行中的一个列
UPDATE Persons SET FirstName='Fred' WHERE LastName='whilson'
更新某一行中某些列
UPDATE Persons SET Address='zhongsan',city='nanjing' WHERE LastName='willson
4.查语句
SELECT 列名称 FROM 表名称
SELECT LastName,FirstName From Persons
网友评论