PROMPT Creating Table AIRCRAFT_CARRIER

create table aircraft_carrier(
   carrier_alpha_code            char(3)     not null,
   aircraft_subtype              varchar2(3) not null,
   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 aircraft_carrier add ( constraint aircraft_carrier_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table aircraft_carrier add ( constraint aircraft_carrier_uk1 unique (carrier_alpha_code,aircraft_subtype) using index tablespace &1._indexes);

ALTER TABLE AIRCRAFT_CARRIER ADD  CONSTRAINT FK_AC_CL FOREIGN KEY (CARRIER_ALPHA_CODE) REFERENCES CARRIER_LOOKUP (ALPHA_CODE) ;

ALTER TABLE AIRCRAFT_CARRIER ADD  CONSTRAINT FK_AC_AS FOREIGN KEY (AIRCRAFT_SUBTYPE) REFERENCES AIRCRAFT_TYPE (IATA_SUBTYPE) ;

COMMENT ON TABLE AIRCRAFT_CARRIER IS 'This table maps aircraft types with carriers';

COMMENT ON COLUMN AIRCRAFT_CARRIER.AIRCRAFT_SUBTYPE IS  'Airline carrier';
COMMENT ON COLUMN AIRCRAFT_CARRIER.CARRIER_ALPHA_CODE IS  'Aircraft sub type ';
COMMENT ON COLUMN AIRCRAFT_CARRIER.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN AIRCRAFT_CARRIER.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN AIRCRAFT_CARRIER.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN AIRCRAFT_CARRIER.CUSER IS 'The user who created the row';
COMMENT ON COLUMN AIRCRAFT_CARRIER.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN AIRCRAFT_CARRIER.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN AIRCRAFT_CARRIER.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN AIRCRAFT_CARRIER.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN AIRCRAFT_CARRIER.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
