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
Why would you call update statistics?
What is the syntax for encrypting a column in SQL Server?
Why do we backup Active Directory ?
What are sql dirty pages?
What are the dmvs?
What is precedence constraint?
What are data files?
Does sql server 2016 have ssms?
what protocol both networks use? : Sql server database administration
Is the log file is a part of file group?
What is statement level trigger?
How does normalization work?
How to generate create function script on an existing function?
What are the difference between data mart and data warehouse? : sql server analysis services, ssas
What is temporary table in sql server? Why we use temp table?