Advertisement
rootuss

Untitled

May 31st, 2020
1,755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 2.74 KB | None | 0 0
  1.  CREATE TABLE "BATTALIONS"
  2.    (    "REGIMENT_ID" NUMBER(6,0),
  3.     "NUMBE" VARCHAR2(20 BYTE),
  4.     "COMMANDER_ID" NUMBER(6,0)
  5.    );
  6.    
  7.   CREATE TABLE "PLATOONS"
  8.    (    "UNIT_ID" NUMBER(6,0),
  9.     "UNIT_NAME" VARCHAR2(15 BYTE),
  10.     "COMMANDER_ID" NUMBER(6,0),
  11.     "REGIMENT_ID" NUMBER(6,0)
  12.    );
  13.  
  14.   CREATE TABLE "RANKS"
  15.    (    "RANK_ID" NUMBER(4,0),
  16.     "RANK_NAME" VARCHAR2(25 BYTE)
  17.    );
  18.  
  19.   CREATE TABLE "SERVICE_HISTORY"
  20.    (    "SOLIDER_ID" NUMBER(6,0),
  21.     "START_DATE" DATE,
  22.     "END_DATE" DATE
  23.    ) ;
  24.  
  25.   CREATE TABLE "SOLIDERS"
  26.    (    "SOLIDER_ID" NUMBER(6,0),
  27.     "FIRST_NAME" VARCHAR2(25 BYTE),
  28.     "LAST_NAME" VARCHAR2(25 BYTE),
  29.     "DATE_OF_BIRTH" DATE,
  30.     "PAY" NUMBER(8,0),
  31.     "BARRACK_ID" NUMBER(6,0),
  32.     "RANK_ID" NUMBER(6,0),
  33.     "WEAPON_ID" NUMBER(6,0),
  34.     "VEHICLE_ID" NUMBER(6,0),
  35.     "SPECIALIZATION_ID" NUMBER(6,0),
  36.     "UNIT_ID" NUMBER(6,0)
  37.    );
  38.  
  39.   CREATE TABLE "SPECIALIZATIONS"
  40.    (    "SPECIALIZATION_ID" NUMBER(6,0),
  41.     "SPECIALIZATION_NAME" VARCHAR2(25 BYTE)
  42.    );
  43.    
  44.   CREATE TABLE "VEHICLES"
  45.    (    "VEHICLE_ID" NUMBER(6,0),
  46.     "TYPE" VARCHAR2(20 BYTE),
  47.     "MODEL" VARCHAR2(20 BYTE),
  48.     "CREW_SIZE" NUMBER(6,0)
  49.    );
  50.  
  51.   CREATE TABLE "WEAPONS"
  52.    (    "WEAPON_ID" NUMBER(6,0),
  53.     "NAME" VARCHAR2(20 BYTE),
  54.     "TYPE" VARCHAR2(20 BYTE),
  55.     "QUANTITY" NUMBER(4,0)
  56.    );
  57.    
  58.   ALTER TABLE "BARACKS" MODIFY ("BARACK_ID" NOT NULL ENABLE);
  59.   ALTER TABLE "BARACKS" ADD CONSTRAINT "BARACKS_PK" PRIMARY KEY ("BARACK_ID");
  60.   ALTER TABLE "SERVICE_HISTORY" ADD PRIMARY KEY ("SOLIDER_ID");
  61.   ALTER TABLE "SPECIALIZATIONS" MODIFY ("SPECIALIZATION_ID" NOT NULL ENABLE);
  62.   ALTER TABLE "SPECIALIZATIONS" ADD CONSTRAINT "SPECIALIZATIONS_PK" PRIMARY KEY ("SPECIALIZATION_ID");
  63.   ALTER TABLE "PLATOONS" MODIFY ("UNIT_ID" NOT NULL ENABLE);
  64.   ALTER TABLE "PLATOONS" ADD CONSTRAINT "PLATOONS_PK" PRIMARY KEY ("UNIT_ID");
  65.   ALTER TABLE "RANKS" MODIFY ("RANK_NAME" NOT NULL ENABLE);
  66.   ALTER TABLE "RANKS" MODIFY ("RANK_ID" NOT NULL ENABLE);
  67.   ALTER TABLE "RANKS" ADD CONSTRAINT "RANKS_PK" PRIMARY KEY ("RANK_ID");
  68.   ALTER TABLE "WEAPONS" ADD CONSTRAINT "WEAPONS_PK" PRIMARY KEY ("WEAPON_ID");
  69.   ALTER TABLE "WEAPONS" MODIFY ("QUANTITY" NOT NULL ENABLE);
  70.   ALTER TABLE "WEAPONS" MODIFY ("NAME" NOT NULL ENABLE);
  71.   ALTER TABLE "WEAPONS" MODIFY ("WEAPON_ID" NOT NULL ENABLE);
  72.   ALTER TABLE "VEHICLES" ADD CONSTRAINT "VEHICLES_PK" PRIMARY KEY ("VEHICLE_ID");
  73.   ALTER TABLE "VEHICLES" MODIFY ("CREW_SIZE" NOT NULL ENABLE);
  74.   ALTER TABLE "VEHICLES" MODIFY ("VEHICLE_ID" NOT NULL ENABLE);
  75.   ALTER TABLE "BATTALIONS" MODIFY ("REGIMENT_ID" NOT NULL ENABLE);
  76.   ALTER TABLE "BATTALIONS" ADD CONSTRAINT "BATTALIONS_PK" PRIMARY KEY ("REGIMENT_ID");
  77.   ALTER TABLE "SOLIDERS" MODIFY ("SOLIDER_ID" NOT NULL ENABLE);
  78.   ALTER TABLE "SOLIDERS" ADD CONSTRAINT "SOLIDERS_PK" PRIMARY KEY ("SOLIDER_ID");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement