Skip to main content
InterviewHubPRO
Section Overview
Q3

Question 3 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

6%
SQL & Relational Databases (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What are Primary Keys, Foreign Keys, and Unique Constraints?

junior Levelsql-databasesBasic

In Simple Words:

  • Primary Key: A column (or set of columns) that uniquely identifies each row in a table. Must be unique and cannot contain NULL values. A table can have only one Primary Key.
  • Unique Key: Enforces uniqueness across values in a column. Unlike Primary Keys, unique columns allow NULL values (often multiple NULLs depending on SQL dialect).
  • Foreign Key: A column that references the Primary Key of another table, enforcing referential integrity.