存储过程
select text from user_source;--查询user用户下的procedure
select text from user_source where name=upper('get_comment');
表
添加列:alter table student add stuId number(10);
删除列:alter table student drop column stuId;
/* 添加检查约束 */
alter table stuinfo add constraint ck_stuAddr check(length(stuAddr)>3);
分页查询
select * from (select rownum r,s.* from student s) where r<=3;
平均年龄最大的性别
select stusex from (select stusex,avg(stuqq) avg_stuqq from stuinfo group by stusex) a where a.avg_stuqq in (select max(avg(stuqq)) from stuinfo group by stusex);