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

How do you rate yourself in oracle and sql server ?

2 Answers   Keane India Ltd,


Explain the use of ignore option in imp command.

0 Answers  


What is the usage of control file in oracle?

0 Answers  


Table1- have two column filename data AFGDFD-20112011 hi how r u bsdasd-23042011 name shoud be in bold Now i want output like filename data AFGDFD hi how r u bsdasd name shoud be in bold Kindly answer this

2 Answers   HCL,


What is SQL Tuning Advisor in Oracle?

0 Answers   MCN Solutions,






what is host string in sql plus? how does it related to database?

1 Answers  


How would you begin to troubleshoot an ORA-3113 error?

0 Answers  


HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.

0 Answers  


waht is referencial integrity?

2 Answers   Semantic Space,


HOW TO DISPLAY MAXIMUM SALARIES FROM EMP DEPARTMENT VISE ALONG WITH DEPARTMENT NAMES? E.g EMP,DEPT

5 Answers   College School Exams Tests, DELL,


10)In an RDBMS, the information content of a table does not depend on the order of the rows and columns. Is this statement Correct? A)Yes B)No C)Depends on the data being stored D)Only for 2-dimensional tables

6 Answers   Mind Tree,


What is an Index ?

2 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)