Do You Want to Learn SQL?

Take our free eight day course, where I'll teach you in simple to understand English all you need to get started learning SQL.


Free Beginners SQL Course!

Question #1

In a one-to-one relationship there exists one, and only one, matching record for each key provided.  That is the primary key will only match one or zero foreign key values.

Whereas, in a many-to-one relationship, there are one or more matches.  Examples:

Husband <–> Wife is one to one.

Husband <–> Children is one to many.

Question #2

A foreign key is a set of values in a table which match to the primary key of another table.  There isn’t a command to define a foreign key, per se, the existence of columns with the proper data is the minimum requirement.

That said, as you advance in your learning, you’ll learn about constraints.  You can use these to enforce a match between the foreign key and primary key.

Question #3

Primary key is the general term for any set of values that are unique and non-null across a table.  They provide a means to identity one record in a table.  A compound primary key is a primary key made up of two or more columns.