Oracle Database Quiz Questions

Course Name:Oracle
Chapter Name:Chapter 8 - RDBMS Concepts
Lesson Content Link:Primary Key
Current Quiz Count:30
Progress
0%
Q1
True / False

In Oracle, a primary key is a column or a set of columns that uniquely identifies each row in a table.

Q2
True / False

In Oracle, a table can have multiple primary keys.

Q3
True / False

The primary key in Oracle automatically creates a unique index on the primary key column(s).

Q4
True / False

In Oracle, the primary key constraint can be defined at the column level or the table level.

Q5
True / False

In Oracle, a primary key column can contain NULL values.

Q6
True / False

In Oracle, you can add a primary key constraint to an existing table using the ALTER TABLE statement.

Q7
True / False

In Oracle, if a primary key constraint is defined on multiple columns (composite key), the combination of values in those columns must be unique.

Q8
True / False

In Oracle, you can create a primary key on a column that already has a unique constraint.

Q9
True / False

Dropping a primary key constraint in Oracle also drops the unique index associated with the primary key.

Q10
True / False

The Oracle Certified Professional (OCP) exam includes knowledge on creating, modifying, and managing primary key constraints, as well as understanding their impact on database integrity and performance.

Q11
Single Choice

What is the primary function of a primary key in an Oracle database?

Q12
Single Choice

In Oracle SQL, which constraint is automatically associated with a primary key?

Q13
Single Choice

Which of the following SQL commands creates a primary key on the employee_id column of a table named employees?

Q14
Single Choice

Consider the following Oracle SQL query:What does this query do?

SQL Code
CREATE TABLE departments (
 department_id NUMBER PRIMARY KEY,
 department_name VARCHAR2(50)
);
Q15
Single Choice

Which Oracle SQL command can be used to create a composite primary key on the employee_id and department_id columns?

Q16
Single Choice

Given the Oracle SQL query:What will be the result?

SQL Code
ALTER TABLE employees DROP PRIMARY KEY;
Q17
Single Choice

What will happen if you try to insert a row with a duplicate value in a primary key column in Oracle?

Q18
Single Choice

Consider this Oracle SQL query:What type of primary key is being created?

Q19
Single Choice

Which of the following is true about primary keys and foreign keys in an Oracle database?

Q20
Single Choice

Consider the following Oracle SQL scenario:What does this SQL code demonstrate?

SQL Code
CREATE TABLE products (
 product_id NUMBER PRIMARY KEY,
 product_name VARCHAR2(50),
 category_id NUMBER,
 CONSTRAINT fk_category FOREIGN KEY (category_id) REFERENCES categories(category_id)
);
Q21
Multiple Choice

Identify the SQL statements that correctly define a primary key in an Oracle table.

SQL Code
CREATE TABLE customers (
 customer_id NUMBER,
 customer_name VARCHAR2(100)
);
Q22
Multiple Choice

Select the SQL statements that correctly enforce primary key constraints in a composite key scenario.

Q23
Multiple Choice

Which of the following SQL statements will correctly modify the primary key?

Q24
Multiple Choice

Identify the SQL statements that ensure data integrity by using primary key constraints in Oracle.

Q25
Multiple Choice

Choose the SQL statements that demonstrate the importance of primary keys in table relationships.

Q26
Multiple Choice

Which SQL statements demonstrate the handling of duplicate values when defining a primary key?

Q27
Multiple Choice

Determine the SQL statements that demonstrate the use of primary keys in conjunction with unique constraints.

Q28
Multiple Choice

Which of the following SQL statements correctly create a partitioned table?

Q29
Multiple Choice

Select the SQL statements that demonstrate the use of primary keys with auto-increment features in Oracle.

Q30
Multiple Choice

Choose the SQL statements that demonstrate the use of primary keys in distributed databases.