关闭

数据库面试题

483人阅读 评论(0) 收藏 举报
分类:
select  * from user_tables
create table t_user(
       id number not null primary key,
       name varchar(10),
      age number(3),
      rmark varchar (59)
)


drop sequence sqe_s

create sequence sqe_s
start with 1
increment by 1
minvalue 1
maxvalue  9999999;



insert into t_user values (sqe_s.nextval,'name',131,'rmark');
commit;

select * from T_user

create  view vi_user 
as
 select t.id as id, t.name as 姓名,t.age as  年龄, t. rmark  as 备注 from T_user t;

drop view vi_user
select * from vi_user

create or replace procedure pp (in number a)
begin
   insert into t_user values (sqe_s.nextval,'name',a,'rmark');
  end;
  
  declare 
  a number;
  begin
    a:=10;
     pp(a);
    end;
    
    begin
      pp(411);
     end;
    
select * from  t_user where age > (select avg(age) from  t_user)

select sum(age) from t_user

select to_date('2013-01-01','yyyy-mm-dd') from  t_user

create or replace trigger tri_my 
after
 insert on t_user
begin
  update T_user set age=99 where age>100;
  end;
  
  
  
  create or replace trigger tri_my 
before
 insert or update of on t_user
begin
  update T_user set age=99 where age>100;
  end;




create table r_user as select * from t_user where age<10

insert into r_user select * from t_user where age>10

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:59846次
    • 积分:1226
    • 等级:
    • 排名:千里之外
    • 原创:57篇
    • 转载:1篇
    • 译文:0篇
    • 评论:8条