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 are the uses of a database trigger?
Give syntax for SQL and ORACLE joins.
How many types of tables are there in oracle?
What is the recommended interval at which to run statspack snapshots, and why?
a query to select maxmun 3 salaries of employee table
Is the After report trigger fired if the report execution fails ?
What is a recycle bin in oracle?
what is candidate key & super key
What are the differences between a sys and system user and what are the extra privileges available to the sys user?
Explain integrity constraints?
i have a table and it has constraints and i want to get "ALTER TABLE table_name ADD CONSTRAINT constraint_name constraint type" this code must be in string type please help me if you want, i can give more explainings
What is program global area (pga) in oracle?