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

How to create a table index in oracle?

1134


What is a view and how is it different from a table?

1056


What are the uses of linked server and explain it in detail?

1061


What is a directory object?

1101


What is bulk collect in oracle?

1000


How to view existing locks on the database?

1057


How to name query output columns in oracle?

1190


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?

1956


What is the recommended interval at which to run statspack snapshots, and why?

2923


How does one get the view definition of fixed views/tables?

1023


What is open database communication (odbc) in oracle?

1003


What are the different windows events activated at runtime ?

2902


How do I know if oracle client is installed on windows?

1025


What are the parameters that we can pass through a stored procedure?

1069


What are the arithmetic operations?

1087