Solve “Deduplicate events with ROW_NUMBER”

Free. Runs in your browser, no install.

SQL · Keys, Schema & CTEs

Primary key vs foreign key?

Easyprimary keyforeign keyrelationships

Interview question

Primary key vs foreign key?

How to answer

The short answer

: identifies a row in its own table.

: references a key in another table.

Example:

It establishes a relationship between tables.

Lock it in with a real drill

You remember an answer longer once you have used it. Try a hands-on problem on this concept.

Open related drill