nerdexam
Oracle

1Z0-061 · Question #94

Evaluate the following SQL statements: The above command fails when executed. What could be the reason?

The correct answer is B. SYSDATE cannot be used with the CHECK constraint. CHECK Constraint The CHECK constraint defines a condition that each row must satisfy. The condition can use the same constructs as the query conditions, with the following exceptions: SYSDATE, UID, USER, and USERENV functions Queries that refer to other values in other rows A…

Using DDL Statements to Create and Manage Tables

Question

Evaluate the following SQL statements:

The above command fails when executed. What could be the reason?

Exhibit

1Z0-061 question #94 exhibit

Options

  • AThe BETWEEN clause cannot be used for the CHECK constraint
  • BSYSDATE cannot be used with the CHECK constraint
  • CORD_NO and ITEM_NO cannot be used as a composite primary key because ORD_NO is also
  • DThe CHECK constraint cannot be placed on columns having the DATE data type

How the community answered

(58 responses)
  • A
    5% (3)
  • B
    84% (49)
  • C
    9% (5)
  • D
    2% (1)

Explanation

CHECK Constraint The CHECK constraint defines a condition that each row must satisfy. The condition can use the same constructs as the query conditions, with the following exceptions: SYSDATE, UID, USER, and USERENV functions Queries that refer to other values in other rows A single column can have multiple CHECK constraints that refer to the column in its definition. There is no limit to the number of CHECK constraints that you can define on a column. CHECK constraints can be defined at the column level or table level. CREATE TABLE employees salary NUMBER(8, 2) CONSTRAINT emp_salary_min CHECK (salary > 0),

Topics

#CHECK constraint#SYSDATE restriction#constraint rules#DDL

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice