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 create a table index in oracle?
What is a view and how is it different from a table?
What are the uses of linked server and explain it in detail?
What is a directory object?
What is bulk collect in oracle?
How to view existing locks on the database?
How to name query output columns in oracle?
i have a question here... As of my knowledge, when we apply an index (b-tree)on a column, internally it arranges the data in b-tree format and do the fetching process correspondingly... and my quetion is... How a bit-map index arranges the data internally when applied on a column?IS it in b-tree format or whatelse?
What is the recommended interval at which to run statspack snapshots, and why?
How does one get the view definition of fixed views/tables?
What is open database communication (odbc) in oracle?
What are the different windows events activated at runtime ?
How do I know if oracle client is installed on windows?
What are the parameters that we can pass through a stored procedure?
What are the arithmetic operations?