Q1
True / FalseA primary key in a table ensures unique and non-null values for the column.
A primary key constraint ensures that the column values are unique and non-null, providing a unique identifier for each row.
Q2
True / FalseA table can have multiple primary keys.
A table can have only one primary key, although that primary key can consist of multiple columns (composite key).
Q3
True / FalseA primary key column cannot contain NULL values.
A primary key constraint does not allow NULL values in the column.
Q4
True / FalseThe primary key constraint can be applied to more than one column in a table.
A composite primary key can consist of more than one column.
Q5
True / FalseA primary key can be defined on a table after the table has been created.
A primary key constraint can be added to an existing table using the ALTER TABLE statement.
Q6
True / FalseThe primary key values can be duplicated across rows in a table.
Primary key values must be unique for each row in the table.
Q7
True / FalseA primary key in a relational database table uniquely identifies each row.
The primary key ensures that each row in the table is uniquely identified.
Q8
True / FalseA foreign key is the same as a primary key in a database table.
A foreign key is used to link two tables together, whereas a primary key uniquely identifies each row within a table.
Q9
True / FalseYou cannot define a primary key in a table if it already has a foreign key.
A table can have both a primary key and a foreign key. The primary key uniquely identifies rows in the table, while the foreign key establishes a relationship with another table.
Q10
True / FalseA primary key column can contain duplicate values if it is part of a composite key.
Even as part of a composite key, the primary key columns must collectively ensure unique values across the table.
Q11
True / FalsePrimary keys must be numeric fields.
Primary keys can be of any data type, not just numeric fields, as long as they uniquely identify each row.
Q12
True / FalseA table can have a primary key without a unique constraint.
A primary key inherently includes a unique constraint to ensure no duplicate values exist.
Q13
True / FalseThe values of a primary key can be changed after they are set.
While technically possible, changing primary key values is not recommended as it can disrupt relationships and data integrity.
Q14
True / FalseA primary key and a unique key are identical in function.
A primary key uniquely identifies each row and does not allow nulls, while a unique key ensures uniqueness but can allow nulls.
Q15
True / FalseIn SQL Server, a primary key is automatically indexed.
When a primary key is defined, SQL Server automatically creates a unique index on the primary key columns to enforce uniqueness.