What is the difference between the Primary and Foreign key?

Answer Posted / slokh

Primary key does not contain NULL or duplicate values.
whereas Foreign key accepts duplicate values but not null
values.
Primary key states the Entity integrity constraint, which
says that every row in a table is unique.
Foreign key states the referential integrity constraint,
that says that you can only insert values that is present
in the primary of the parent table.

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In pl/sql, what is bulk binding, and when/how would it help performance?

543


What is server name sql?

601


How do you rename a table in sql?

539


What is the use of stored procedures?

529


What are three advantages to using sql?

564






Mention what does plv msg allows you to do?

678


What is a native sql query?

505


How to write html code in pl sql?

588


What is difference between rank () row_number () and dense_rank () in sql?

588


how to shut down the server with 'mysqladmin'? : Sql dba

553


what is top in tsql? : Transact sql

553


What are actual parameters and formal parameters?

578


What is the requirement of self-join?

556


How do I debug a stored procedure?

639


What are the benefits of triggers?

616