what is the difference between primary key & foreign key?
Answers were Sorted based on User's Feedback
Answer / shree
foreign key is NULL
foreign key reference as Primary key in another table
Primary key is unique
primary key is not NULL and
| Is This Answer Correct ? | 46 Yes | 12 No |
Answer / simbu
primary key is a keyword .that refers to the unique value
in the particular record.it cant have null
foreign key is always keyword that refers primary key.it has
null value.its refers to another table
| Is This Answer Correct ? | 34 Yes | 8 No |
Answer / rohit tyagi
forign key includes the information that primary key
contains,but primary key does not include the information
of forein key.
thaks[something different,isn't it!]
| Is This Answer Correct ? | 28 Yes | 5 No |
Answer / raji
foregin key reference a primary key in another table
and primary key is used to identify a row.
| Is This Answer Correct ? | 30 Yes | 10 No |
Answer / harish
primary key does not allow duplicate and null values
but foreign key allows null values it refers primary key
| Is This Answer Correct ? | 25 Yes | 10 No |
Answer / mathiyarasan
Primary is unique one. Each table has only one primary key.
But not allow null values.
Foreign key is opposite of primary. It is reference of
primary key from another table. It allow Null value. Each
table can have more than one foreign key.
Foreign key is used to link one to another table.
| Is This Answer Correct ? | 22 Yes | 7 No |
Answer / deepa
Primary key is a keyword.
It should not have null value and duplicate value.
We can have only one primary key in a table and the value
should be unique.
Foreign key is a keyword.
It can have null value and duplicate value.
We can have more than one foreign key for a table and this
froeign key table references the primary key table.
| Is This Answer Correct ? | 22 Yes | 7 No |
Answer / mithun
primary key is the unique value,but its not nul values..
this kry is avoided dublicate values
foreign key is always references the primary key.
| Is This Answer Correct ? | 21 Yes | 8 No |
Answer / afzaal
primary key is a constraint key that can not contain a null
or duplicate values.
foriegn key is a reference key ,before referencing the
foriegn key parent table field or fields must have primary
key.If u can try to insert a value in referencing field,new
record that must contain parent field.
| Is This Answer Correct ? | 22 Yes | 11 No |
Answer / altaf ali
primary key of a relation is a candidate key that has been
designated as the main key.It doesn't has null value.
A foreign key is an attribute in a relation that can be
used as a key to another relation.It allow null and
duplicate value.
| Is This Answer Correct ? | 16 Yes | 5 No |
what is the scripts in data base?
How to retrieve values from data fields in record variables?
What is data file?
What would you do with an in-doubt distributed transaction?
10. Display the client number, order date and shipping date for all orders where the shipping date is between three and six months after the order date.
Explain the concept of the DUAL table.
What are the Referential actions supported by FOREIGN KEY integrity constraint ?
Which Functions Using Integer ==> String's i.e 2 ==> Two... Like that string's ==> integer values ? It is Possible ?
List out the types of joins.
hey friends, What are the steps I can do to transfer the database from Microsoft Access 2003 to oracle10g (or SQL) Best regards
What is trigger associated with the timer ?
Create table Employee ( Employee_Id varchar2(8) Constraint emp_id_pk primary key, FirstName varchar2(50), LastName varchar2(50), DeptID Number(5) Constraint dept_id_fk Foreign Key(DeptId) References Department(DeptId) ) Error I am getting: Constraint specification are not allowed here