primary key is foreign key for the same table?

Answers were Sorted based on User's Feedback



primary key is foreign key for the same table?..

Answer / mukesh

Yes

Is This Answer Correct ?    9 Yes 1 No

primary key is foreign key for the same table?..

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

Post New Answer

More Oracle General Interview Questions

What is the use of file param in imp command?

0 Answers  


Why we choose emp number as primarykey?

4 Answers  


What are the different approaches used by Optimizer in choosing an execution plan ?

2 Answers  


Will you be able to store pictures in the database?

0 Answers  


How to increment dates by 1 in oracle?

0 Answers  






7. Repeat query (7) but also display all clients who have never ordered anything.

1 Answers   Wipro,


write sql query following source are EmpID, Salary 101 1000 102 2000 103 3000 I want the output format like following empid,sal,composite_sal 101 1000 1000 102 2000 3000 103 3000 6000

4 Answers   TCS,


What are the built-in functions used for sending Parameters to forms ?

0 Answers   Oracle, TCS,


what is exact difference between drop and truncate table.

3 Answers  


15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.

0 Answers   Wipro,


Where do you use decode and case statements?

0 Answers  


How to convert character types to numeric types?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)