DML-数据库操作语言
插入数据
insert into student values(null,‘字段名’…);
查询所有
select * from student;
删除单条数据
delete from student whrere id=?;
删除所有数据
delete from student;
摧毁表
truncate table student;
修改数据
修改数据为张三的改为zhangsan
update student set name=‘张三’ where name=‘zhangsan’;
修改王五的salery和出生日期
update studnet set salery=100.01,birthday=‘1999-02-18’ where name=‘王五’
DQL-数据库查询语言
创建数据表
create table student(id int primary key auto_increment,name varchar(20) unique not null,chinese float,english float,math float);
添加几条数据
insert into student values(1,’张三’,90,80,80);
insert into student values(2,’李四’,90,87,60);
insert into student values(3,’王五’,70,60,69);
insert into student values(4,’赵六’,99,90,87);
查询所有学生信息
select * from student;
查询id为1的学生姓名