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

How to get the definition of a user defined function back?

0 Answers  


What is a view? is View updatable?

17 Answers   IBM, L&T,


What's the purpose of Stored Procedure?

6 Answers   Wipro,


What are partitioned views?

0 Answers  


how do we find every fifth record in a table

14 Answers   Aspire, HCL,






What is difference between createstatement and preparedstatement?

0 Answers  


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

0 Answers  


What is the difference between local table and global table

1 Answers   CarrizalSoft Technologies, Polaris,


How do I view views in sql server?

0 Answers  


What is an sql server agent?

0 Answers  


what is macro?

5 Answers   Excel, Global Innovation, Wipro,


Describe triggers features and limitations?

0 Answers  


Categories