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
What is a trigger? How you can create a trigger in mysql?
How to get data from mysql in php?
Write a query to count the number of rows of a table in mysql.
How can you move the master database
How you will show all data from a table.
What does mysql flush hosts do?
How to Change a users password from unix shell.
What is difference between oracle sql and mysql?
Write a query to display even rows in student table using mysql?
What is pdo in php mysql?
Table - Products has number of products as below Productid ProductName 1 iPhone 2 iPad 3 BlackBerry Table - SalesPersonProduct has the below records Salespersonid productid S1 1 S1 2 S1 3 S2 1 S3 2 Write a SQL query that returns the total number of sold products
What is the difference between primary key and candidate key?
What is the difference between unix timestamps and mysql timestamps?
suppose data is copie to oracle to sql by using DTS. Actully it taken 2 hours. suppose some day distribute the server in the middle of 2 hours. after how can i get the data ?
What are mysql queries?