What is Foreign Key?
What is the main difference between primary key and Foreign
Key ?
How Foreign Key can be defined?
Is Foreign key is used to join two or more table?

Answer Posted / balaji ganesh doddi

Foreign key is establish the relationship between two
tables.
Primary key is used to uniqly identified by the data into a
table.
The major differences are
Primary key should not contain null values and redundant
value.
Foreign key can contain redundant value.

Foreign key is a primary key of reference table.

Foreign key is defined as= create table employee(empno int
not null,empname char(40)not null,dept char(20),foreign
key(dept)references department(deptno))
Yes Foreign key is used t join two or more tables.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the ways in which you can retrieve data in the result set of mysql using php?

498


Explain timestamp?

584


What is the maximum size of mysql database?

483


Does mysql use t sql?

572


How many triggers are possible in mysql?

506






In how many ways we can retrieve data in the result set of mysql using php?

615


How would you get the current date in mysql?

646


In which format data is stored in mysql database?

524


How do I select a table in mysql?

484


What is a definer?

469


What does tinyint mean?

510


What are the technical specifications of mysql?

671


How can I create a database in mysql?

465


Why is it called mysql?

508


Which is best pdo or mysqli?

476