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
What are a cluster and non-cluster index?
Write a trigger example in oracle?
How to rebuild an index in oracle?
How do you increase the OS limitation for open files (LINUX and/or Solaris)?
What is Virtual Private Database in Oracle?
Compare and contrast between sql and sql server and explain its various functions?
Explain index?
what's query optimization and without use of IN AND Exist can we get another way data from query
how to join query for one source type is oracle another source type is sql server ?
What is save point in oracle database?
What is an oracle database table?
How do we display rows from the table without duplicates?
How to run create database statement?
What privilege is needed for a user to connect to oracle server?
Explain database link?