会计考友 发表于 2012-8-4 14:01:27

2011年oracle考试测试题及答案(3)

10 、简要写出在system方案中建立序列xl的步骤。
create squence system.xl
start whith 1
increment by 1
minvalue 1
nomaxvalue
nocycle
nocache
order;

11、写出SQL语句,向表中插入一条记录,其中ID字段的值来自序列XL。
Insert into system.table1 values (system.xl.nextval,’tom’,21,’男’,2000);

12、 写出一个匿名的SQL程序块,完成如下任务:向表中插入3000条记录,在salary字段中有500条记录的值为1000,500条记录的值为1200,1000条记录的值为1500,1000条记录的值为1800
Id 字段的值来自序列xl,其他字段的值任意.
declare
x number:=0;
begin
for x in 1..3000 loop
If(x500)and (x1000)and (x1000的记录;
create view system.st as select * from system.table1 where id>1000;
15、创建一个system方案中的函数fn1,函数作用为:将指定ID号的记录中的salary字段值乘以1.05。
Create or replace function system.fn1(salary1 system.table1 salary &type)
Return number as
V1 numbre:=1.05;
V2 numbre;
Begin
V2=v1*salary1;
Return v2;
End ;
页: [1]
查看完整版本: 2011年oracle考试测试题及答案(3)