Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- sccsid: @(#)dss.ri 2.1.8.1
- -- tpch benchmark version 8.0
- -- connect to tpch;
- -- alter table tpch.region drop primary key;
- -- alter table tpch.nation drop primary key;
- -- alter table tpch.part drop primary key;
- -- alter table tpch.supplier drop primary key;
- -- alter table tpch.partsupp drop primary key;
- -- alter table tpch.orders drop primary key;
- -- alter table tpch.lineitem drop primary key;
- -- alter table tpch.customer drop primary key;
- -- for table region
- alter table tpch.region add constraint tpch_region_pk primary key (r_regionkey) disable novalidate;
- -- for table nation
- alter table tpch.nation add constraint tpch_nation_pk primary key (n_nationkey) disable novalidate;
- alter table tpch.nation add constraint tpch_nation_fk1 foreign key (n_regionkey) references tpch.region (r_regionkey) disable novalidate rely;
- -- for table part
- alter table tpch.part add constraint tpch_part_pk primary key (p_partkey) disable novalidate;
- -- for table supplier
- alter table tpch.supplier
- add constraint tpch_supplier_pk primary key (s_suppkey) disable novalidate;
- alter table tpch.supplier
- add constraint tpch_supplier_fk1 foreign key (s_nationkey) references tpch.nation (n_nationkey) disable novalidate rely;
- -- for table partsupp
- alter table tpch.partsupp
- add constraint tpch_partsupp_pk primary key (ps_partkey,ps_suppkey) disable novalidate;
- -- for table customer
- alter table tpch.customer
- add constraint tpch_customer_pk primary key (c_custkey) disable novalidate;
- alter table tpch.customer
- add constraint tpch_customer_fk1 foreign key (c_nationkey) references tpch.nation (n_nationkey) disable novalidate rely;
- -- for table lineitem
- alter table tpch.lineitem
- add constraint tpch_lineitem_pk primary key (l_orderkey,l_linenumber) disable novalidate;
- -- for table orders
- alter table tpch.orders
- add constraint tpch_orders_pk primary key (o_orderkey) disable novalidate;
- -- for table partsupp
- alter table tpch.partsupp
- add constraint tpch_partsupp_fk1 foreign key (ps_suppkey) references tpch.supplier (s_suppkey) disable novalidate rely;
- alter table tpch.partsupp
- add constraint tpch_partsupp_fk2 foreign key (ps_partkey) references tpch.part (p_partkey) disable novalidate rely;
- -- for table orders
- alter table tpch.orders
- add constraint tpch_orders_fk1 foreign key (o_custkey) references tpch.customer (c_custkey) disable novalidate rely;
- -- for table lineitem
- alter table tpch.lineitem
- add constraint tpch_lineitem_fk1 foreign key (l_orderkey) references tpch.orders (o_orderkey) disable novalidate rely;
- alter table tpch.lineitem
- add constraint tpch_lineitem_fk2 foreign key (l_partkey,l_suppkey) references
- tpch.partsupp (ps_partkey, ps_suppkey) disable novalidate rely;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement