WEIrq

数据库——增删改数据

 创建表
CREATE TABLE student(
sid INT,
sname VARCHAR(10),
ssex CHAR(5),
birth DATE,
score DOUBLE
)
插入数据
 datetime 1999-09-09 09:09:09
INSERT INTO student VALUES(1,'小红帽','女','1999-09-09',99.9)
插入部分字段
INSERT INTO student(sid,sname) VALUES(2,'大灰狼')
 修改语句
UPDATE student SET ssex='男' WHERE sid=2
UPDATE student SET birth='2000-09-09',score=55 WHERE sid=2
删除数据
DELETE FROM student WHERE sid=2
清空表
DELETE FROM student
TRUNCATE TABLE student

posted on 2021-09-26 10:23  WEIrq  阅读(19)  评论(0编辑  收藏  举报

导航