CRUD
简单插入数据
# 插入数据
insert into
student value (1, 'xiaoming', '2024-1-1', 3.55);
# 指定插入数据
insert into
student (id, name, birthday)
values
(2, 'xiaohong', '2024-1-1');
批量插入数据
# 批量插入
insert into
student (id, name, birthday)
values
(1, 'xiaoming', '2024-1-1'),
(2, 'xiaohong', '2024-1-1'),
(3, 'xiaofang', '2024-1-1');
# 表A整体插入表B
insert into
student1
select
*
from
student;
# 表A部分插入表B s
insert into
student1 (id, name)
select
id,
name
from
student;
更新数据
update student
set
name = 'xiaohong'
where
id = 2;
删除数据
delete from student
where
id = 4;
delete from student
where
birthday between '1990-1-1' and '1993-1-2';
truncate table student;