반응형

oracle foreign key 생성/삭제

create table bbs (
 no number not null,
 id varchar2(20) not null,
 bbspasswd varchar2(20) not null,
 title varchar2(100) not null,
 content varchar2(1000) not null,
 regdate date not null,
 readcount number not null,
);

생성
SQL> ALTER TABLE 테이블명 ADD CONSTRAINT fk_bbs_id FOREIGN KEY(id) REFERENCES 참조되는 테이블명(id);

삭제
SQL> ALTER TABLE 테이블명 DROP CONSTRAINT fk_bbs_id;
반응형

+ Recent posts