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

What is the difference between the 2 operating modes of database mirroring?

0 Answers  


1.Describe way(s) to tune the SQL table in order to optimize performance. 2. Explain SQL Injection and how can you prevent them?

1 Answers   Techno Solutions,


What is a sql join?

0 Answers  


How to defragment indexes with alter index ... Reorganize?

0 Answers  


How many full-text indexes can a table have?

0 Answers  






How can we check the sql server version?

0 Answers  


After using delete statement in sql query to delete some records...to retrieve the deleted records we can get using rollback command but till that where it stores means particular location name i need....(after deleting and rollback )

3 Answers   CarrizalSoft Technologies, iGate,


What are the different methods available under sqlcommand class to access the data?

0 Answers   UGC Corporation,


Can you explain what is the use of custom fields in report?

0 Answers  


Do you know what are the steps to process a single select statement?

0 Answers  


What is difference between rownum and row_number?

0 Answers  


How to create Clustered Primary Key to table?

2 Answers  


Categories