먼저 table을 create 할때는 Primary key 나 Foreign Key 설정을 안했습니다.
그리고 나서
BOOK 테이블에
alter table BOOK
add PRIMARY KEY (Book_id)
이렇게 해서 만들구여
또 PUBLISHER 테이블에는
alter table BOOK
add PRIMARY KEY(Name)
이렇게 해놓은 상태에서여
BOOK 테이블에 Publisher_name 이라는 것과 PUBLISHER table 에 Name 과 연결하고 싶은데여
alter table
add FOREIGN KEY(Publisher_name)
references PUBLISHER (Name)
이렇게 하니까
There is no unique constraint on the referend column in the referend table PUBLISHER specified in referential contraint declation BOOK
머 이렇게 나오는데...
어떻게 해야 하는지도 모르곘고,
Table은 그냥 두고 , PRIMARY KEY setting 해놓은거를 지우고 싶은데... 어떻게 해야하나요!!!
알려주세야!!!!
|