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

What are the advantages of paper records?

1012


How you would rewrite the sql query to return the customerid sorted numerically?

1046


What is the security model used in sql server 2005?

1069


What is inline variable assignment?

1082


What are the differences between local and global temporary tables?

1131


How to enter comments in transact-sql statements?

987


How to get the number of affected rows?

1053


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1657


What is catalog views?

1121


How to create a view using data from another view?

996


What is database white box testing?

1177


What are the different types of sub-queries?

1090


What is right outer join in sql server joins?

1220


Does sql server use t sql?

1071


What is PROJECTION Operation?

1076