Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are a cluster and non-cluster index?

954


Write a trigger example in oracle?

977


How to rebuild an index in oracle?

968


How do you increase the OS limitation for open files (LINUX and/or Solaris)?

1874


What is Virtual Private Database in Oracle?

1014


Compare and contrast between sql and sql server and explain its various functions?

914


Explain index?

1195


what's query optimization and without use of IN AND Exist can we get another way data from query

2085


how to join query for one source type is oracle another source type is sql server ?

2375


What is save point in oracle database?

1236


What is an oracle database table?

958


How do we display rows from the table without duplicates?

918


How to run create database statement?

972


What privilege is needed for a user to connect to oracle server?

938


Explain database link?

1059