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 is the use of composite key constraint?
How to define an anonymous procedure with variables?
Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.
When do I need to use a semicolon vs a slash in oracle sql?
Briefly explain what is literal? Give an example where it can be used?
What is oracle thin client?
How to use subqueries with the in operator using oracle?
How to open a cursor variable?
What is the relationship among database, tablespace and data file?
What privilege is needed for a user to connect to oracle server?
How different is ms access and 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.