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
what is for foreign key ??
 Question Submitted By :: Akhtark74
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is for foreign key ??
Answer
# 1
Follow this lick to get answer....

http://msdn.microsoft.com/en-us/library/aa933117.aspx
http://www.1keydata.com/sql/sql-foreign-key.html

thx
 
Is This Answer Correct ?    3 Yes 0 No
Amit Kumar
 
  Re: what is for foreign key ??
Answer
# 2
A foreign key is a field (or fields) that points to the 
primary key of another table. The purpose of the foreign 
key is to ensure referential integrity of the data. In 
other words, only values that are supposed to appear in the 
database are permitted. 

For example, say we have two tables, a CUSTOMER table that 
includes all customer data, and an ORDERS table that 
includes all customer orders. The constraint here is that 
all orders must be associated with a customer that is 
already in the CUSTOMER table. In this case, we will place 
a foreign key on the ORDERS table and have it relate to the 
primary key of the CUSTOMER table. This way, we can ensure 
that all orders in the ORDERS table are related to a 
customer in the CUSTOMER table. In other words, the ORDERS 
table cannot contain information on a customer that is not 
in the CUSTOMER table. 

The structure of these two tables will be as follows: 

Table CUSTOMER column name characteristic 
SID Primary Key 
Last_Name    
First_Name    


Table ORDERS column name characteristic 
Order_ID Primary Key 
Order_Date    
Customer_SID Foreign Key 
Amount    


In the above example, the Customer_SID column in the ORDERS 
table is a foreign key pointing to the SID column in the 
CUSTOMER table.
 
Is This Answer Correct ?    6 Yes 1 No
Akhtar Mohammad Kalim
 
 
 
  Re: what is for foreign key ??
Answer
# 3
It is Reference to another table
 
Is This Answer Correct ?    0 Yes 0 No
Vimal
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
How can i change the column name. HCL7
What is Deadlock? Satyam3
What are defaults? Is there a column to which a default can't be bound?  2
How do you check the performance of a query and how do you optimize it?  1
IN Vs OR operator which is best to use sql server.  3
What is the difference between constraints and triggers? Wipro6
When do we use the UPDATE_STATISTICS command?  3
Can we create a clustered index on composite primary key.  2
Can you have a nested transaction? HCL3
Where do you think the users names and passwords will be stored in sql server?  3
There is table like Events...in that name ,startdate ,enddate,location are the column names write a stored Procedure for this table to get events by Months "GetEventsByMonths"  1
is there more the two primary key in a single table? Systematix22
could u plz explain about joins and views?  2
What is normalization?  6
WHY CAN WE CREATE ONLY ONE CLUSTERED INDEX ON A TABLE IN SQL SERVER?  6
What is a cursor in SQL Server 2000 and their types?  4
how to select a field with firstletter as capital and remaining are small letters  8
How do you simulate a deadlock for testing purposes  1
what is syntex second or third highest salary. thanks & Regards Dhirendra sinha  4
Please give me the SP for the below scenario. I have two tables named Table1 and Table2...I need to fetch record by record from Table1 and insert the record in to table2 where the value in the sno column of the table1 is even number. Value-Labs4
 
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