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 round a numeric value to a specific precision?
Why is replication required on the sql server?
When we should use and scope of @@identity?
What is a coalesce function?
what is difference between NULL and ISNULL in SQL Server 2008?
What is the difference between row_number and dense_rank?
Do you know what are acid properties?
Explain the concepts and capabilities of sql server?
What is a trigger what are the advantages of trigger?
What are system databases in ms sql server?
Explain an incremental backup?
What is repeatable read?
You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?
How do I start sql server agent automatically?
How to disable a login name in ms sql server?