Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is for foreign key ??

Answer Posted / akhtar mohammad kalim

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 ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of normalization?

1014


Difference between Logical Page and Physical Page in SSRS.

474


What is the simplest way to create a new database in ms sql server?

989


Does windows server 2016 come with sql server?

918


Can we linked SharePoint to a SQL database?

1008


How do I find query history in sql server?

925


What are the aggregate and scalar functions?

1039


after migrating the dts packg to ssis by using migrtn wizrd in 2005. iam not able to open ssis pack and getting error. what r those errors? how to resolve?

2079


What options are available to audit login activity? : sql server security

1131


Is BCNF better than 2NF & 3NF? Why?

1033


Why truncate is ddl command?

1043


Why use stored procedures in sql server?

991


What are the disadvantages of primary key and foreign key in SQL?

1090


What are diverse clauses that form a part of sql?

1053


how do you test proper tcp/ip configuration windows machine? : Sql server database administration

1036