Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to round a numeric value to a specific precision?

1055


Why is replication required on the sql server?

1047


When we should use and scope of @@identity?

987


What is a coalesce function?

1165


what is difference between NULL and ISNULL in SQL Server 2008?

999


What is the difference between row_number and dense_rank?

858


Do you know what are acid properties?

1052


Explain the concepts and capabilities of sql server?

956


What is a trigger what are the advantages of trigger?

977


What are system databases in ms sql server?

1024


Explain an incremental backup?

977


What is repeatable read?

988


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?

1041


How do I start sql server agent automatically?

947


How to disable a login name in ms sql server?

1110