PROMPT Creating table REFLIGHT_PAX

CREATE TABLE REFLIGHT_PAX ( 
   PAX_ID                        NUMBER (10) NOT NULL, 
   FLIGHT_ID                     NUMBER (10) NOT NULL,
   SITE_ID                       NUMBER (10) NOT NULL,
   PAX_INITIALS                  CHAR (4),
   PAX_SURNAME                   CHAR (27),
   PAX_FULL_INITS                CHAR (60),
   PAX_DESTINATION               CHAR (3),
   PAX_CLASS                     CHAR (1),
   DEPARTURE_AIRPORT_CODE        CHAR (3),
   row_create_time               date,
   row_date_time                 date,
   cuser                         varchar2(30),
   muser                         varchar2(30),
   mterm                         varchar2(64),
   source                        varchar2(8),
   to_be_archived                varchar2(1),
   appn_row_id                   number(18) not null,
   system_id                     number(4) default 0 not null
);

alter table reflight_pax add ( constraint reflight_pax_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table reflight_pax add ( constraint reflight_pax_uk1 unique (pax_id) using index tablespace &1._indexes);

ALTER TABLE reflight_pax ADD CONSTRAINT refpax_fk_reflt FOREIGN KEY (flight_id) REFERENCES reflight_flight (flight_id) ;

CREATE INDEX reflight_pax_sk1 ON reflight_pax(flight_id) TABLESPACE &1._indexes;

COMMENT ON TABLE REFLIGHT_PAX IS 'This table contains details of reflight pasengers';

COMMENT ON COLUMN REFLIGHT_PAX.DEPARTURE_AIRPORT_CODE IS  'Departure airport code';
COMMENT ON COLUMN REFLIGHT_PAX.FLIGHT_ID IS  'Flight identifier';
COMMENT ON COLUMN REFLIGHT_PAX.PAX_CLASS IS  'Passenger class';
COMMENT ON COLUMN REFLIGHT_PAX.PAX_DESTINATION IS  'Passenger destination';
COMMENT ON COLUMN REFLIGHT_PAX.PAX_FULL_INITS IS  'Full initials of the passenger';
COMMENT ON COLUMN REFLIGHT_PAX.PAX_ID IS  'Passenger identifier';
COMMENT ON COLUMN REFLIGHT_PAX.PAX_INITIALS IS  'Passenger initials';
COMMENT ON COLUMN REFLIGHT_PAX.PAX_SURNAME IS  'Passenger surname';
COMMENT ON COLUMN REFLIGHT_PAX.SITE_ID IS  'Site identifier';
COMMENT ON COLUMN REFLIGHT_PAX.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN REFLIGHT_PAX.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN REFLIGHT_PAX.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN REFLIGHT_PAX.CUSER IS 'The user who created the row';
COMMENT ON COLUMN REFLIGHT_PAX.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN REFLIGHT_PAX.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN REFLIGHT_PAX.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN REFLIGHT_PAX.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN REFLIGHT_PAX.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
