1. create语句
create table personinfo
(
pno varchar(20) not null,
pname varchar(20),
primary key(pno)
);
2. select 语句
select sname,num(sqy)
from stu
where sno>'121513'
group by sno
[distinct,max,concat,convert等函数]或者
select *
from stu
where sno in (或者=)
(
select sno
from person
where sno>‘121513’
)
1)插入一行
insert into student (sno,sname) values('121513','zhayefei')
2)插入多行
insert into student(sno,sname) values ('123','zha'),('456','cha'),('789','Leo');
3)用select语句插入
insert into student(sno,sname)
select concat(sno,'10'),concat(sname,'v')
from student
where sno>'121513'
4. delete语句
delete
from student
where sno='121518'
5. update语句(两种方法)
update student set sname='Leo-zha' where sno='121513'
或者
update
(
select * from student
where sno='121513'
)
set sname='zhayefei'