primary key is foreign key for the same table?
Answers were Sorted based on User's Feedback
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 |
What is oracle rownum?
If server is in US and client is in india there is timezone is diffrence, How can we display date in indian time when data is displayed from US server timezone?
Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.
What is the difference between Delete, Truncate and Drop in Oracle?
What privilege is needed for a user to query tables in another schema?
What are inner join and outer join?
SQLERRM is a a. Constraint b. Pre Defined Exception c. Pseduocolumn d. Constant e. None of Above.
What WHERE CURRENT OF clause does in a cursor?
How to use fetch statement in a loop?
after installatio of ORACLE 8i, work properly, but after restarting the system, it throw an error ORA 01034: ORACLE not availble
How to add a new column to an existing table in oracle?
How to connect to a local oracle 10g xe server?