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

Why would you call update statistics?

961


What is the syntax for encrypting a column in SQL Server?

1060


Why do we backup Active Directory ?

998


What are sql dirty pages?

971


What are the dmvs?

952


What is precedence constraint?

926


What are data files?

984


Does sql server 2016 have ssms?

913


what protocol both networks use? : Sql server database administration

932


Is the log file is a part of file group?

976


What is statement level trigger?

938


How does normalization work?

867


How to generate create function script on an existing function?

1048


What are the difference between data mart and data warehouse? : sql server analysis services, ssas

893


What is temporary table in sql server? Why we use temp table?

908