In order to be less logic to the client, you can use DB's Union constant to limit the repeated input of the data, so how to establish the GroupID, UserID of GroupID, UserID in the Group_Users table?
Drop Table User_Group Cascade Constraints;
CREATE TABLE USER_GROUP (ID NUMBER NOT NULL, USER_ID NUMBER (8) DEFAULT 0 NOT NULL, GROUP_ID NUMBER (8) DEFAULT 0 NOT NULL, CONSTRAINT PK_USERCPHASE PRIMARY KEY (ID) USING INDEX TABLESPACE NEWKM_IDX PCTFREE 10 STORAGE (INITIAL 65536 NEXT 1048576 PCTINCREASE 0 )) TABLESPACE NEWKM_DAT PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 Storage (Initial 65536 Mineltents 1 MaxExtents 2147483645 Free) 1 FreeList Groups 1) Nocache;
ALTER TABLE User_Group add constraint fk_user_gro_reference_groups foreign key (group_id) References newkm.groups (ID);
ALTER TABLE User_Group Add constraint fk_user_gro_reference_users foreIGN Key (user_id) References newkm.users (ID);
Create unique index ix_usergroup_1 on "newkm" .user_group (user_id, group_id) TableSpace Newkm_idx PctFree 10 Storage (Initial 65536 Next 1048576 Pctincrease 0);
Grant SELECT ON User_Group to newEpp;
Comment on table user_group is 'group staff file (user_group)';
Comment on column user_group.group_id is' group name serial number '; comment on column user_group.id is' serial number'; comment on column user_group.user_id is' personnel serial number;