Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.2 kB
2
Indexable
Never
CREATE TABLE CUSTOMER 
(C_ID NUMBER (4),
 C_NAME VARCHAR2(10),
 C_SURNAME VARCHAR2(10),
 C_DOB DATE);
 
 INSERT INTO CUSTOMER VALUES 
 ( 1, 'JOHN' , 'BRONX',      TO_DATE('21-SEP-1996', 'DD-MON-YYYY'));
  INSERT INTO CUSTOMER VALUES 
 ( 2, 'MARK' , 'TREVINO',    TO_DATE('17-MAR-1980', 'DD-MON-YYYY'));
  INSERT INTO CUSTOMER VALUES 
 ( 3, 'ANTHONY' , 'ERICSON', TO_DATE('10-APR-1980', 'DD-MON-YYYY'));
  INSERT INTO CUSTOMER VALUES 
 ( 4, 'FRANK' , 'ROACH',     TO_DATE('01-DEC-1980', 'DD-MON-YYYY'));
  INSERT INTO CUSTOMER VALUES 
 ( 5, 'LIAM' , 'STUART',     TO_DATE('20-JUN-1980', 'DD-MON-YYYY'));

 CREATE TABLE AGENT
(A_ID NUMBER(4),
 A_SURNAME VARCHAR2(10),
 MGR_SURNAME VARCHAR2(10),
 SALARY NUMBER(8),
 COMM NUMBER (8));
 
  INSERT INTO AGENT VALUES
( 1, 'NIELSEN', 'BURNS' , 3000 , 500);
  INSERT INTO AGENT VALUES
( 2, 'ESTRADA', 'KAUFMAN' , 2950 , 600);
  INSERT INTO AGENT VALUES
( 3, 'HARDING', 'MCDONALD' , 2100 , 800);
  INSERT INTO AGENT VALUES
( 4, 'BRUCE', 'CHAPMAN' , 5000 , 200);
  INSERT INTO AGENT VALUES
( 5, 'LEVY', 'MADDEN' , 3000 , 100);
 

CREATE TABLE TRANSPORT
(T_ID NUMBER(4), 
T_NAME VARCHAR2(10));

INSERT INTO TRANSPORT VALUES
(1, 'TRAIN');
INSERT INTO TRANSPORT VALUES
(2, 'PLANE');
INSERT INTO TRANSPORT VALUES
(3, 'BUS');
INSERT INTO TRANSPORT VALUES
(4, 'SHIP');

CREATE TABLE CITY
(CITY_ID NUMBER(4), 
CITY_NAME VARCHAR2(10));

INSERT INTO CITY VALUES
(1, 'TOKYO');
INSERT INTO CITY VALUES
(2, 'ROME');
INSERT INTO CITY VALUES
(3, 'WARSAW');
INSERT INTO CITY VALUES
(4, 'WASHINGTON'); 
 
 CREATE TABLE TRIP 
 (TRIP_ID NUMBER (4),
 PRICE NUMBER(4),
 DURATION_DAYS NUMBER(2),
 PARTICIPATION_ID NUMBER (4),
 VEHICLE_USED VARCHAR2(10),
 SELLER NUMBER (4),
 LOCATION VARCHAR2(10));
 
  INSERT INTO TRIP VALUES
  ( 1, 3000, 20, 1, 3, 1, 'TOKYO');
    INSERT INTO TRIP VALUES
  ( 2, 2600, 15, 4, 2, 2, 'ROME');
    INSERT INTO TRIP VALUES
  ( 3, 1200, 18, 1, 4, 3, 'WARSAW');
    INSERT INTO TRIP VALUES
  ( 4, 500, 10, 2, 2, 4, 'TOKYO');
    INSERT INTO TRIP VALUES
  ( 5, 3800, 15, 2, 2, 5, 'WASHINGTON');
    INSERT INTO TRIP VALUES
  ( 6, 4000, 20, 3, 4, 5, 'WASHINGTON');