1Z0-061 · Question #276
Examine the following SQL commands: Which statement is true regarding the execution of the above SQL commands?
The correct answer is B. The first CREATE TABLE command generates an error because the NULL constraint is not valid. Defining Constraints The slide gives the syntax for defining constraints when creating a table. You can create constraints at either the column level or table level. Constraints defined at the column level are included when the column is defined. Table-level constraints are…
Question
Examine the following SQL commands:
Which statement is true regarding the execution of the above SQL commands?
Exhibit
Options
- ABoth commands execute successfully.
- BThe first CREATE TABLE command generates an error because the NULL constraint is not valid.
- CThe second CREATE TABLE command generates an error because the CHECK constraint is not
- DThe first CREATE TABLE command generates an error because CHECK and PRIMARY KEY
- EThe first CREATE TABLE command generates an error because the column PROD_ID cannot be
How the community answered
(21 responses)- A5% (1)
- B81% (17)
- C10% (2)
- E5% (1)
Explanation
Defining Constraints The slide gives the syntax for defining constraints when creating a table. You can create constraints at either the column level or table level. Constraints defined at the column level are included when the column is defined. Table-level constraints are defined at the end of the table definition and must refer to the column or columns on which the constraint pertains in a set of parentheses. It is mainly the syntax that differentiates the two; otherwise, functionally, a columnlevel constraint is the same as a table-level constraint. NOT NULL constraints must be defined at the column level. Constraints that apply to more than one column must be defined at the table level.
Topics
Community Discussion
No community discussion yet for this question.
