Anonymous Asked in Cars &Transportation · 2 weeks ago

What is primary key and foreign key in SQL with example?

A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in another table. The table with the foreign key is called the child table, and the table with the primary key is called the referenced or parent table.


What is primary key and foreign key with example?

Primary KeyForeign KeyPrimary key is used to uniquely identify a rowForeign key is used to connect two tables or maintain relationship between themA table can have only have one primary keyA table can have multiple foreign keys

What is primary key in SQL with example?

A primary key is a field in a table which uniquely identifies each row/record in a database table. Primary keys must contain unique values. A primary key column cannot have NULL values. A table can have only one primary key, which may consist of single or multiple fields.

Related Questions

Relevance
Write us your question, the answer will be received in 24 hours