Script taken from
AMIS-blog
It is used in my another post
Change bar data based on selected slice: ADF Pie Graph
CREATE TABLE DVE_COUNTRIES
(
ID NUMBER NOT NULL
, NAME VARCHAR2(20) NOT NULL
, CONSTRAINT DVE_COUNTRIES_PK PRIMARY KEY
(
ID
)
ENABLE
);
ALTER TABLE DVE_COUNTRIES
ADD CONSTRAINT DVE_COUNTRIES_UK1 UNIQUE
(
NAME
)
ENABLE;
INSERT INTO "DVT_USER"."DVE_COUNTRIES" (ID, NAME) VALUES ('1', 'Netherlands');
INSERT INTO "DVT_USER"."DVE_COUNTRIES" (ID, NAME) VALUES ('2', 'Sweden');
INSERT INTO "DVT_USER"."DVE_COUNTRIES" (ID, NAME) VALUES ('3', 'England');
INSERT INTO "DVT_USER"."DVE_COUNTRIES" (ID, NAME) VALUES ('4', 'France');
INSERT INTO "DVT_USER"."DVE_COUNTRIES" (ID, NAME) VALUES ('5', 'Australia');
INSERT INTO "DVT_USER"."DVE_COUNTRIES" (ID, NAME) VALUES ('6', 'China');
INSERT INTO "DVT_USER"."DVE_COUNTRIES" (ID, NAME) VALUES ('7', 'Italy');
CREATE TABLE DVE_RESTAURANTS
(
ID NUMBER NOT NULL
, NAME VARCHAR2(30 BYTE) NOT NULL
, COUNTRY_ID NUMBER NOT NULL
, CONSTRAINT DVE_RESTAURANTS_PK PRIMARY KEY
(
ID
)
ENABLE
);
ALTER TABLE DVE_RESTAURANTS
ADD CONSTRAINT DVE_RESTAURANTS_UK1 UNIQUE
(
NAME
)
ENABLE;
ALTER TABLE DVE_RESTAURANTS
ADD CONSTRAINT DVE_RESTAURANTS_COUNTRIES_FK1 FOREIGN KEY
(
COUNTRY_ID
)
REFERENCES DVE_COUNTRIES
(
ID
)
ENABLE;
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('1', 'The Frying Dutchman', '1');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('2', 'The Cheesecake Factory', '1');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('3', 'The Frosty Palace', '2');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('4', 'Dorsia', '3');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('5', 'Tom’s Restaurant', '3');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('6', 'Jackrabbit Slim’s', '3');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('7', 'Gusteau’s', '4');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('8', 'Texas Chili Parlor', '5');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('9', 'Big Kahuna Burger', '5');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('10', 'Bronto Burger', '5');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('11', 'Teriyaki Donut', '6');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('12', 'Nuovo Vesuvio', '7');
INSERT INTO "DVT_USER"."DVE_RESTAURANTS" (ID, NAME, COUNTRY_ID) VALUES ('13', 'Chotchkies', '7');
CREATE TABLE DVE_REVENUE
(
ID NUMBER NOT NULL
, RESTAURANT_ID NUMBER NOT NULL
, REVENUE NUMBER(10, 0) DEFAULT 0 NOT NULL
, COSTS NUMBER(10, 0) DEFAULT 0 NOT NULL
, CONSTRAINT DVE_REVENUE_PK PRIMARY KEY (ID) ENABLE
);
ALTER TABLE DVE_REVENUE
ADD CONSTRAINT DVE_REVENUE_RESTAURANTS_FK1 FOREIGN KEY
(
RESTAURANT_ID
)
REFERENCES DVE_RESTAURANTS
(
ID
)
ENABLE;
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (1,1,30000,20000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (2,2,20000,10000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (3,3,30000,10000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (4,4,15000,10000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (5,5,25000,20000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (6,6,30000,0);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (7,7,10000,0);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (8,8,20000,10000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (9,9,30000,5000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (10,10,15000,15000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (11,11,20000,5000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (12,12,30000,10000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (13,13,5000,0);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (14,1,20000,10000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (15,2,10000,0);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (16,3,50000,30000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (17,4,10000,5000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (18,5,30000,25000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (19,6,40000,30000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (20,7,0,0);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (21,8,10000,1000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (22,9,50000,30000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (23,10,15000,10000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (24,11,25000,20000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (25,12,80000,30000);
Insert into DVT_USER.DVE_REVENUE (ID,RESTAURANT_ID,REVENUE,COSTS) values (26,13,5000,1000);
commit;