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 difference between Rename and Alias?
Explain the use of show option in imp command.
How do we know whether an index is created on a table ???
Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.
which is the best training centre for learning oracle?
What is an oracle cursor variable?
How to join two tables in a single query using oracle?
1.display list of all users from ur data base.what is the query?
What are the restrictions in a oracle read only transaction?
Youre getting high busy buffer waits - how can you find whats causing it?
i deleted 4 records form the table.after i have applied commit .now i want to get back those records.how?
How to insert multiple rows with one insert statement in oracle?