can foreign key take role of primary key?
Answer Posted / suresh murugadass
Yes. It is possible in this scenario. Here table has a
self join. Since emp_id represents both emp_id and mgr_id
this is possible a primary key to behave as foriegn key
create table emp(
emp_id int not null primarykey,
emp_name varchar2(40) not null,
mgr_id int not null foriegn key(mgr_id) references emp(emp_id)
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Explain sql server service broker?
What is the difference between mysql and mysqli?
What is store procedure? How do they work?
What is a trace frag?
List all the types of user-defined functions?
what is the difference between them (ethernet networks and token ring networks)? : Sql server database administration
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
Explain the disadvantages/limitation of the cursor?
What are entities and relationships?
How can I add Reporting Services reports to my application?
What is always encrypted?
What is nested transaction?
What are the properties of the transaction?
In which sql server version report builder introduced?
What is onf in normalization form?