ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
Assume,there are three tables in a database, Can i have 
both primary key and foreign key for each table in the same 
database?
 Question Submitted By :: Kathiravan_g
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Assume,there are three tables in a database, Can i have both primary key and foreign key for each table in the same database?
Answer
# 1
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 0 No
Subbu
 
  Re: Assume,there are three tables in a database, Can i have both primary key and foreign key for each table in the same database?
Answer
# 2
We can create 3 tables with PK and FK but can not insert 
rows.  Try it.
 
Is This Answer Correct ?    2 Yes 0 No
Madhu
 
 
 
  Re: Assume,there are three tables in a database, Can i have both primary key and foreign key for each table in the same database?
Answer
# 3
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
Siva
 
  Re: Assume,there are three tables in a database, Can i have both primary key and foreign key for each table in the same database?
Answer
# 4
Nope.
 
Is This Answer Correct ?    1 Yes 0 No
Guest
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What are sub-queries? Give example? In which case sub-queries are not feasible? Infosys3
I am Having tables T1 and T2 both having same data how to check (or) compare the data in both table are same?  2
how to rest identity columns in sql server Matrix3
Can we create a clustered index on composite primary key.  2
Which command using Query Analyzer will give you the version of SQL server and operating system?  3
What is Transaction?  2
Assume,there are three tables in a database, Can i have both primary key and foreign key for each table in the same database?  4
What is INTVAL( )and where we use Plz any body help me  1
Which TCP/IP port does SQL Server run on?  2
what is the difference between group and having give an example with query and sample output  2
What is the difference between SSAS 2000 and SSAS 2005? APX1
can you any body tell me the how to decrease the logfile  4
can you any body tell me simple recovery,full recovery,bulk logged recovery where can use?  1
Is it possible to delete duplicate rows in a table without using a temporary table ?  6
What is excution Plan in sql server TCS1
I have a table in which phno is one of the columns.i do have some values in tht phno column.i need to update phno column values with 0(zero) as prefix.give me a correct solution plz... Value-Labs5
How can I know what query is executing by by a particural user? (using sp id or any othe way.)  2
What are the pros and cons of creating extended stored procedures?  1
As a part of your job, what are the DBCC commands that you commonly use for database maintenance? HCL1
What is the difference between windows authentication and sql server authentication HCL4
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com