Q1
True / FalseIn PostgreSQL, a primary key uniquely identifies each record in a table.
A primary key is a column or a set of columns that uniquely identifies each row in a table, ensuring no duplicate records.
Q2
True / FalseA table in PostgreSQL can have more than one primary key.
A table can have only one primary key, which may consist of one or multiple columns (composite key).
Q3
True / FalseIn PostgreSQL, a primary key column cannot contain NULL values.
Primary key columns must contain unique and non-NULL values to ensure the integrity of the data.
Q4
True / FalseIn PostgreSQL, a primary key constraint automatically creates a unique index on the primary key column(s).
When a primary key is defined, PostgreSQL automatically creates a unique index on the column(s) to enforce the uniqueness constraint.
Q5
True / FalseIn PostgreSQL, you can define a primary key on an existing table using the ALTER TABLE statement.
You can use the ALTER TABLE statement to add a primary key constraint to an existing table.
Q6
True / FalsePostgreSQL allows defining a primary key on a column that already has a unique constraint.
A primary key can be defined on a column that already has a unique constraint, as long as it does not contain NULL values.
Q7
True / FalseIn PostgreSQL, a composite primary key can consist of columns from different tables.
A composite primary key must consist of columns within the same table.
Q8
True / FalseDropping a primary key constraint in PostgreSQL will automatically drop any associated indexes.
Dropping a primary key constraint will also remove the unique index associated with it.
Q9
True / FalseIn PostgreSQL, you can use the USING INDEX clause to specify a custom index for enforcing a primary key constraint.
The USING INDEX clause is not available for primary key constraints in PostgreSQL; primary keys always create their own unique indexes.
Q10
True / FalseIn PostgreSQL, defining a primary key on a table that already contains duplicate values in the target column(s) will succeed without errors.
Defining a primary key on columns that contain duplicate values will result in an error, as primary keys require all values to be unique and non-NULL.