What is true about PRIMARY KEY? Choose all that apply
-
Can be defined on a single column or multiple columns in the table.
-
Can be defined only on a single column in the table.
-
A UNIQUE index is automatically created once PRIMARY KEY is defined on the table.
-
A NON-UNIQUE index is automatically created once PRIMARY KEY is defined on the table.
-
NOT NULL constraint is implicitly enforced on the columns which are part of the PRIMARY KEY
-
NULL constraint is implicitly enforced on the columns which are part of the PRIMARY KEY
A PRIMARY KEY can be defined on single or multiple columns (composite key), automatically creates a UNIQUE index to enforce uniqueness, and implicitly adds NOT NULL constraint because NULL values would violate uniqueness. Options claiming single-column only, NON-UNIQUE index, or NULL constraints are incorrect.
A PRIMARY KEY can be defined on one column or a composite of multiple columns, so 'single column only' is false. Defining a PRIMARY KEY automatically creates a UNIQUE index (used internally to enforce uniqueness and speed lookups) — not a non-unique one — so the unique-index option is true and the non-unique option is false. Finally, every column participating in a PRIMARY KEY is implicitly NOT NULL (a primary key cannot contain NULLs, since NULLs aren't comparable for uniqueness), so 'NOT NULL is implicitly enforced' is true and its opposite ('NULL is enforced') is false. This matches standard relational database (e.g., MySQL, Oracle, SQL Server) behavior.