Assume,there are three tables in a database, Can i have
both primary key and foreign key for each table in the same
database?

Answers were Sorted based on User's Feedback



Assume,there are three tables in a database, Can i have both primary key and foreign key for each ..

Answer / madhu

We can create 3 tables with PK and FK but can not insert
rows. Try it.

Is This Answer Correct ?    5 Yes 0 No

Assume,there are three tables in a database, Can i have both primary key and foreign key for each ..

Answer / siva

Hi,

You can place the foreign key column in each table to allow
nulls. And insert values.

But I am still worried a lot about deletion of the values
from these tables ?

Plz post your comments

Regards,
Subbu

Is This Answer Correct ?    0 Yes 0 No

Assume,there are three tables in a database, Can i have both primary key and foreign key for each ..

Answer / guest

Nope.

Is This Answer Correct ?    1 Yes 1 No

Assume,there are three tables in a database, Can i have both primary key and foreign key for each ..

Answer / subbu

Yes we can have that ! Let me expalin with this small
example.

(PK)ProjectID (FK)ClientID -- Project Table
(PK)ClientID (FK)ProjectManagerID -- ClientTable
(PK)Employee (FK)ProjetcID -- Employee Table

Check This In this example I am having 3 tables and each
table have PK and FK.

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More SQL Server Interview Questions

Difference between report and query parameter. Why do we need different type of parameter?

0 Answers  


Why do we partition data?

0 Answers  


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

0 Answers  


Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?

0 Answers   MCN Solutions,


What is system stored procedures?

0 Answers  






What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

0 Answers  


what is difference between view and Dip.

0 Answers   IBM, L&T,


What is a sql join?

0 Answers  


What are the advantages of log shipping?

0 Answers  


1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?

0 Answers  


Do you know sql server 2008 introduces automatic auditing?

0 Answers  


between cast and convert which function would you prefer and why?

0 Answers  


Categories