Oracle Database Quiz Questions

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

In Oracle, a UNIQUE constraint ensures that all values in a column are distinct.

Q2
True / False

A table in Oracle can have multiple UNIQUE constraints.

Q3
True / False

A UNIQUE constraint in Oracle allows multiple NULL values in the column.

Q4
True / False

In Oracle, the UNIQUE constraint can be added to an existing table using the ALTER TABLE statement.

Q5
True / False

In Oracle, a UNIQUE constraint automatically creates a unique index on the column.

Q6
True / False

In Oracle, the UNIQUE constraint can only be applied to a single column in a table.

Q7
True / False

In Oracle, a composite UNIQUE constraint can include columns of different data types.

Q8
True / False

In Oracle, you can disable a UNIQUE constraint temporarily using the ALTER TABLE statement.

Q9
True / False

In Oracle, the UNIQUE constraint can include a USING INDEX clause to specify an existing index for enforcing the constraint.

Q10
True / False

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

Q11
Single Choice

What is the primary purpose of the UNIQUE constraint in Oracle?

Q12
Single Choice

In Oracle, which of the following SQL commands correctly defines a UNIQUE constraint on the EMAIL column in the EMPLOYEES table?

Q13
Single Choice

Which of the following SQL statements will cause a UNIQUE constraint violation in Oracle?

SQL Code
CREATE TABLE USERS (
 USER_ID NUMBER PRIMARY KEY,
 USERNAME VARCHAR2(50) UNIQUE,
 EMAIL VARCHAR2(100) UNIQUE
);

INSERT INTO USERS (USER_ID, USERNAME, EMAIL)
VALUES (1, 'johndoe', 'john@example.com');

INSERT INTO USERS (USER_ID, USERNAME, EMAIL)
VALUES (2, 'johndoe', 'john@example.com');
Q14
Single Choice

In Oracle, how can you modify an existing table to add a UNIQUE constraint on the PHONE_NUMBER column?

Q15
Single Choice

Given the following Oracle SQL code, what will happen if you try to insert a row with a duplicate value in the SSN column?

SQL Code
CREATE TABLE CITIZENS (
 ID NUMBER PRIMARY KEY,
 NAME VARCHAR2(100),
 SSN VARCHAR2(11) UNIQUE
);

INSERT INTO CITIZENS (ID, NAME, SSN)
VALUES (1, 'Alice', '123-45-6789');
Q16
Single Choice

How would you define a composite UNIQUE constraint on the FIRST_NAME and LAST_NAME columns in the EMPLOYEES table in Oracle?

Q17
Single Choice

Consider the following Oracle SQL table creation. What will happen if an attempt is made to insert a row with duplicate values for the CODE and DESCRIPTION columns?

SQL Code
CREATE TABLE PRODUCTS (
 PRODUCT_ID NUMBER PRIMARY KEY,
 CODE VARCHAR2(50),
 DESCRIPTION VARCHAR2(100),
 CONSTRAINT code_desc_unique UNIQUE (CODE, DESCRIPTION)
);
Q18
Single Choice

In Oracle, how can you temporarily disable a UNIQUE constraint on the EMAIL column in the USERS table?

Q19
Single Choice

What is the impact of defining a UNIQUE constraint on a column that already contains duplicate values in Oracle?

Q20
Single Choice

In Oracle, which of the following is true about a UNIQUE constraint that includes NULL values?

Q21
Multiple Choice

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

Q22
Multiple Choice

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

Q23
Multiple Choice

Determine the SQL scripts that correctly query rows while enforcing a UNIQUE constraint in Oracle.

Q24
Multiple Choice

Identify the SQL scripts that correctly insert data into a table with a UNIQUE constraint in Oracle.

Q25
Multiple Choice

Select the SQL scripts that correctly enforce a UNIQUE constraint across multiple columns in Oracle.

Q26
Multiple Choice

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

Q27
Multiple Choice

Determine the SQL scripts that correctly handle conflicts when inserting duplicate values into a UNIQUE column in Oracle.

Q28
Multiple Choice

Select the SQL scripts that correctly enforce a UNIQUE constraint with a WHERE clause in Oracle.

Q29
Multiple Choice

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

Q30
Multiple Choice

Determine the SQL scripts that correctly handle disabling and enabling a UNIQUE constraint in Oracle.