[辅]《Oracle 行列转换的一道微软面试题》-相关代码

注: 以下代码是为本博另一篇博文《Oracle 行列转换的一首微软面试题》服务的, 光看这代码是无意义的.

/*
  创建 sale 表, 并填充数据
  数据库: Oracle 10g
*/
create table SALE
(
  ym       CHAR(6),
  sale_amt NUMBER(14,2)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
comment on column SALE.ym
  is '年月';
comment on column SALE.sale_amt
  is '销售金额';

alter table SALE disable all triggers;
delete from SALE;
commit;
insert into SALE (ym, sale_amt)
values ('200001', 1000);
insert into SALE (ym, sale_amt)
values ('200002', 1100);
insert into SALE (ym, sale_amt)
values ('200003', 1200);
insert into SALE (ym, sale_amt)
values ('200004', 1300);
insert into SALE (ym, sale_amt)
values ('200005', 1400);
insert into SALE (ym, sale_amt)
values ('200006', 1500);
insert into SALE (ym, sale_amt)
values ('200007', 1600);
insert into SALE (ym, sale_amt)
values ('200101', 1100);
insert into SALE (ym, sale_amt)
values ('200102', 1200);
insert into SALE (ym, sale_amt)
values ('200301', 1300);
commit;
alter table SALE enable all triggers;

你可能感兴趣的:(oracle,行列转换,微软面试题)