primary key is foreign key for the same table?
Answer Posted / javed a. khan
Yes this is possible and it will allow.
CREATE TABLE learn_01(book_id NUMBER,
book_name VARCHAR2(100),
book_genre VARCHAR2(100),
isbn_number NUMBER ,
author VARCHAR2(100),
ref_book_id NUMBER)
alter table learn_01 add constraint book_pk primary key (book_id)
alter table learn_01 add constraint foreign key book_rf (ref_book_id) references learn_01
ALTER TABLE learn_01 add CONSTRAINT book_fk1 FOREIGN KEY (book_id) REFERENCES learn_01(book_id);
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is PL/SQL ?
Explain an exception and its types?
What is enter substitution variable in oracle?
Where do you use decode and case statements?
What is the Tune Query
How to find out what oracle odbc drivers are installed?
Explain a data segment?
Explain joins in oracle?
What is define in oracle?
Is it possible to split the print reviewer into more than one region ?
What are the different types of partitions in oracle?
How to delete a column in an existing table?
If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?
In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col
How do you find out from the RMAN catalog if a particular archive log has been backed-up?