What is the difference between the Primary and Foreign key?
Answer Posted / suresh babu
Primary key and foreign key both are constraints.
Primary key:We can create only one primary key for a
table,which never allows the repeated or duplicate values
and null values.The index will be created when defining a
primary key.And primary key is used to make a relation
between more than one tables.
Foreign key:It allows the duplicate and null values.if we
want to make a relation between two tables,the parent table
column must have primary column and child table column
called foreign key.
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is an invalid partition table?
What are the advantages of normalization?
How to use boolean type in select statement?
What is dynamic query?
What is a string data type in sql?
What is an inner join sql?
Does sql*plus have a pl/sql engine?
What is the purpose of cursors in pl/sql?
what are the different tables present in mysql? : Sql dba
What are the two virtual tables available at the time of database trigger execution?
What is a natural join?
what are the performance and scalability characteristics of mysql? : Sql dba
what are the authentication modes in sql server? How can it be changed? : Sql dba
What is lookup table in sql?
what is the syntax used for partition in tsql? : Transact sql