Welcome, Guest. Please login or register.
September 02, 2010, 10:30:25 pm
 
 PSOUG Forum Jump to:  

Home Help Search Login Register
PSOUG.org  |  General Category  |  PSOUG  |  Topic: one question « previous next »
Pages: [1] Print
Author Topic: one question  (Read 964 times)
ahmedghalep5
Newbie
*
Posts: 1


View Profile
« on: October 21, 2009, 03:00:49 am »

what is the primary key and the foriegn key
 
Logged
Mike
Administrator
Hero Member
*****
Posts: 560



View Profile
« Reply #1 on: October 21, 2009, 07:36:28 am »

what is the primary key and the foriegn key


http://psoug.org/reference/constraints.html

http://en.wikipedia.org/wiki/Foreign_key:

In the context of relational databases, a foreign key is a referential constraint between two tables.

The foreign key identifies a column or a set of columns in one(referencing) table that refers to a column or set of columns in another (referenced) table.

The columns in the referencing table must be the primary key or other candidate keyin the referenced table. The values in one row of the referencing columns must occur in a single row in the referenced table. Thus, a row in the referencing table cannot contain values that don't exist in the referenced table (except potentially NULL).

This way references can be made to link information together and it is an essential part of database normalization. Multiple rows in the referencing table may refer to the same row in the referenced table. Most of the time, it reflects the one (master table,or referenced table) to many (child table, or referencing table)relationship.
Logged
Pages: [1] Print 
PSOUG.org  |  General Category  |  PSOUG  |  Topic: one question « previous next »
Jump to:  


Login with username, password and session length
PSOUG.org - one question

SEO light theme by © Mustang forums. Powered by SMF 1.1.11 SMF © 2006-2008, Simple Machines LLC