niisar
5/19/2014 - 9:26 PM

sample table 1

sample table 1

create table NUMBERS(
NUM integer
);
INSERT INTO NUMBERS VALUES (1);
INSERT INTO NUMBERS VALUES (2);
insert into NUMBERS values (3);
INSERT INTO NUMBERS VALUES (4);

create table FAMILY(
CHILD_KEY varchar(50),
PARENT_KEY varchar (50)
);
insert into FAMILY values ('GRANDPARENTS',null);
insert into FAMILY values ('PARENTS','GRANDPARENTS');
insert into FAMILY values ('CHILD-1','PARENTS');
insert into FAMILY values ('PARENTS','PARENTS');

alter table FAMILY modify(
CHILD_KEY varchar2(50),
PARENT_KEY VARCHAR2(50)
);

create table COMPANY(
EMPLOYEE_ID integer,
EMPLOYEE_NAME varchar2(50),
MANAGER_ID integer,
SALARY numeric(20,2)
);

insert into COMPANY values(1,'FRED',null,100000);
insert into COMPANY values(2,'BARNEY',1,50000);
insert into COMPANY values(3,'WILMA',1,50000);
insert into COMPANY values(4,'BETTY',3,40000);
insert into COMPANY values(5,'PEBBLES',3,40000);
insert into COMPANY values(6,'BAM-BAM',4,20000);
insert into COMPANY values(7,'DINO',4,20000);
insert into COMPANY values(8,'DOPPY',4,40000);

COMMIT