primary key is foreign key for the same table?
Answers were Sorted based on User's Feedback
Answer / 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 |
What are the differences between primary key and unique key?
What is a cluster Key ?
What is dictionary cache ?
Explain about functional dependency and its relation with table design?
Why use resource manager in Oracle?
Explain about the analyze command in oracle?
How to drop an index?
I have a parent program and a child program. I want to write a statement in Exception Block of the parent program so that when the statement in the exception block is executed, the control goes to the next statement in the parent block bypassing the child block.How do i do that?
What are the values that can be specified for OPTIMIZER_GOAL parameter of the ALTER SESSION Command ?
What is a table index in oracle?
How do you tell what your machine name is and what is its IP address?
What are the differences between a sys and system user and what are the extra privileges available to the sys user?