Informatics Practices

Assertion. The PRIMARY KEY can be defined only once in the CREATE TABLE command.

Reason. If the PRIMARY KEY is a composite key, then it is not defined with the individual columns but at the end of the table definition as a table constraint.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

SQL Queries

2 Likes

Answer

Both A and R are true and R is the correct explanation of A.

Explanation
In SQL, when we define a table using the CREATE TABLE command, we can only specify one PRIMARY KEY constraint. This PRIMARY KEY can consist of a single column or multiple columns (composite key). When a PRIMARY KEY is a composite key (consisting of multiple columns), it's not defined with each individual column but rather as a table constraint at the end of the table definition.

Answered By

2 Likes


Related Questions