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 / sunil kumar
Foreign key represents the relationship between two tables.
A foreign key in a table whose value is derived from the
primary key from some other table.The table in which foreign
key is defined is called a foreign table or detailed table.
The table that defines the primary key and is referenced by
the foreign table is called primary table or master table.
Difference between primary key and foreign key is that
primary key must contain a value,must not contain null
value,redundant value and foreign key can contain redundant
value.
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 ? | 13 Yes | 0 No |
Post New Answer View All Answers
Can I install mysql on mac?
How do I start mysql manually?
How can I see all mysql databases?
How many types of indexes are there in mysql?
How do I select a database in mysql workbench?
What is the datatype for password in mysql?
What does mysql workbench do?
What is mysqli_num?
What is mysql and how it works?
How to store binary data in mysql?
Can you rename a database in mysql?
Why do we write stored procedures?
What is mysql database used for?
Please can the SQL code below be interpreted IF @xMatchCriteria='MATCH12' BEGIN IF EXISTS (Select * from #InsightData where (EmailAddress=@xDCPEmailAddress ) ) BEGIN SET @xTestMatchCriteria = @xMatchCriteria; SELECT @xCRMCustomerId=CustomerId, @xCRMDcpCustomerId=DcpCustomerId, @xCRMPortalCustomerID=PortalCustomerID,@xCRMDcpID=DcpID, @xCRMCardNumber=CardNumber, @xCRMEmailAddress=EmailAddress, @xCRMfirtLetterFirstName=firtLetterFirstName, @xCRMLastName=Surname,@xCRMAddressLine1=AddressLine1, @xCRMPostCode=PostCode FROM #InsightData where (EmailAddress=@xDCPEmailAddress ) END ELSE BEGIN SET @xTestMatchCriteria='No'+@xMatchCriteria; END END
Which is faster innodb or myisam?