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
How to work with data objects interactively?
Explain about the analyze command in oracle?
21. Using a set operator, display the client number of all clients who have ever placed an order and whose whose name does not contain the string Sm.
What are ddl statements in oracle?
How to define a cusotmer as a supplier in ORACLE R12
How to assign a table row to a record variable?
Where is the export dump file located?
Explain the difference between sql and oracle?
How to drop an index in oracle?
What is a oracle database?
What is a named program unit?
What will be the syntax to find current date and time in format "yyyy-mm-dd"?
Explain the use of parfile option in exp command.
How to count duplicated values in a column in oracle?
What is a package in oracle?