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
How to add code to the existing article (using improve article)?
What are alternate keys?
Detail about query optimizer?
Explain identity in sql server?
Can we do dml on views?
How can you start sql server in different modes?
What are the tools available in market as an alternative to sql server reporting services?
What command do we use to rename a database?
What is page in sql server?
What are sql servers used for?
What is nested transaction?
What is stored procedures?
What is identity?
What is the full form of ddl?
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that