Oracle Database Quiz Questions

Course Name:Oracle
Chapter Name:Chapter 5 - DDL (Data Definition Language)
Lesson Content Link:CHECK Constraint
Current Quiz Count:30
Progress
0%
Q1
True / False

In Oracle, a CHECK constraint is used to enforce a condition on each row in a table.

Q2
True / False

A CHECK constraint in Oracle can only be applied to a single column in a table.

Q3
True / False

In Oracle, a CHECK constraint can be added to a table at the time of table creation using the CREATE TABLE statement.

Q4
True / False

In Oracle, the ALTER TABLE statement can be used to add a CHECK constraint to an existing table.

Q5
True / False

In Oracle, a CHECK constraint cannot reference other tables or columns outside of the table it is defined on.

Q6
True / False

In Oracle, the CHECK constraint can include functions and expressions.

Q7
True / False

In Oracle, if a CHECK constraint condition fails during an INSERT or UPDATE operation, the operation will still succeed but will generate a warning.

Q8
True / False

In Oracle, a disabled CHECK constraint will still be enforced during data modifications.

Q9
True / False

In Oracle, a CHECK constraint can be defined using the USING INDEX clause to specify an index for fast validation.

Q10
True / False

The Oracle Certified Professional (OCP) exam includes knowledge on creating, managing, and optimizing CHECK constraints in database tables.

Q11
Single Choice

Which of the following is true about the Oracle CHECK constraint?

Q12
Single Choice

In Oracle, which of the following SQL commands would create a CHECK constraint to ensure that the column AGE in the EMPLOYEES table is always greater than 18?

Q13
Single Choice

Which of the following is the correct syntax to create a table in Oracle with a CHECK constraint that ensures the SALARY column has values between 1000 and 10000?

Q14
Single Choice

In Oracle, if a CHECK constraint on a table is violated, what is the typical outcome?

Q15
Single Choice

Given the following Oracle SQL code, which of the following will result in an error when trying to insert a row?

SQL Code
CREATE TABLE PRODUCTS (
 PRODUCT_ID NUMBER PRIMARY KEY,
 PRODUCT_NAME VARCHAR2(100),
 PRICE NUMBER,
 CONSTRAINT chk_price CHECK (PRICE > 0)
);
Q16
Single Choice

Which Oracle SQL statement would correctly add a CHECK constraint on the QUANTITY column of an existing ORDERS table to ensure it is always a positive integer?

Q17
Single Choice

Consider an Oracle table EMPLOYEES with a CHECK constraint on the DEPARTMENT_ID column. Which of the following changes would require disabling and re-enabling the CHECK constraint?

Q18
Single Choice

Which of the following Oracle SQL commands will result in a CHECK constraint violation error?

SQL Code
CREATE TABLE INVENTORY (
 ITEM_ID NUMBER PRIMARY KEY,
 ITEM_NAME VARCHAR2(100),
 STOCK NUMBER,
 CONSTRAINT chk_stock CHECK (STOCK >= 0 AND STOCK <= 100)
);

INSERT INTO INVENTORY (ITEM_ID, ITEM_NAME, STOCK)
VALUES (1, 'Widget', 120);
Q19
Single Choice

How can you ensure in Oracle that a column GRADE in the STUDENTS table only contains values 'A', 'B', 'C', 'D', or 'F'?

Q20
Single Choice

In Oracle, if a CHECK constraint is defined on multiple columns, which of the following is true?

Q21
Multiple Choice

Identify the SQL scripts that correctly define a CHECK constraint on a numeric column in Oracle.

Q22
Multiple Choice

Select the SQL scripts that correctly modify an existing table to add a CHECK constraint in Oracle.

Q23
Multiple Choice

Determine the SQL scripts that correctly query data based on a CHECK constraint in Oracle.

Q24
Multiple Choice

Identify the SQL scripts that correctly drop a CHECK constraint from a column in Oracle.

Q25
Multiple Choice

Select the SQL scripts that correctly define a complex CHECK constraint involving multiple columns in Oracle.

Q26
Multiple Choice

Determine the SQL scripts that correctly enforce a CHECK constraint with a subquery in Oracle.

Q27
Multiple Choice

Identify the SQL scripts that correctly validate data against a CHECK constraint in Oracle.

Q28
Multiple Choice

Determine the SQL scripts that correctly enforce a CHECK constraint on a VARCHAR2 column in Oracle.

Q29
Multiple Choice

Select the SQL scripts that correctly define a table with multiple CHECK constraints in Oracle.

Q30
Multiple Choice

Identify the SQL scripts that correctly disable and enable a CHECK constraint in Oracle.