Oracle Database Quiz Questions

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

In ORACLE, a Business Key is always unique within a table

Q2
True / False

A Natural Key in ORACLE is derived from the attributes of the business domain.

Q3
True / False

In ORACLE, a Candidate Key can only consist of a single column.

Q4
True / False

A Business Key in ORACLE can serve as a Natural Key.

Q5
True / False

In ORACLE, a table can have multiple Candidate Keys.

Q6
True / False

Natural Keys in ORACLE databases are preferred over surrogate keys for performance reasons.

Q7
True / False

In ORACLE, a Candidate Key can be chosen as the Primary Key of a table.

Q8
True / False

A Business Key in ORACLE should not change over time to maintain data integrity.

Q9
True / False

In ORACLE, a Natural Key can contain null values.

Q10
True / False

In ORACLE, while designing a table, it's mandatory to have at least one Candidate Key.

Q11
Multiple Choice

Which SQL code snippet demonstrates the creation of a table with a business key in Oracle?

SQL Code
CREATE TABLE employees (
employee_id NUMBER PRIMARY KEY,
email VARCHAR2(100) UNIQUE,
first_name VARCHAR2(50),
last_name VARCHAR2(50)
);
Q12
Multiple Choice

Which SQL code snippet demonstrates the use of a natural key in Oracle?

SQL Code
CREATE TABLE products (
product_code VARCHAR2(50) PRIMARY KEY,
product_name VARCHAR2(100),
price NUMBER(10, 2)
);
Q13
Multiple Choice

Which SQL code snippet demonstrates identifying a candidate key in a table?

SQL Code
CREATE TABLE students (
student_id NUMBER,
ssn VARCHAR2(11) UNIQUE,
email VARCHAR2(100) UNIQUE,
PRIMARY KEY (student_id)
);
Q14
Multiple Choice

Which SQL code snippet demonstrates creating a table with both a natural key and a surrogate key?

SQL Code
CREATE TABLE orders (
order_id NUMBER GENERATED ALWAYS AS IDENTITY,
order_number VARCHAR2(20) UNIQUE,
customer_id NUMBER,
PRIMARY KEY (order_id)
);
Q15
Multiple Choice

Which SQL code snippet demonstrates a situation where both a natural key and candidate keys are used?

SQL Code
CREATE TABLE vehicles (
vin VARCHAR2(17) PRIMARY KEY,
registration_number VARCHAR2(20) UNIQUE,
license_plate VARCHAR2(10) UNIQUE
);
Q16
Multiple Choice

Which SQL code snippet demonstrates an advanced scenario where a business key is enforced along with other candidate keys?

SQL Code
CREATE TABLE employees (
employee_id NUMBER,
email VARCHAR2(100) UNIQUE,
social_security_number VARCHAR2(11) UNIQUE,
PRIMARY KEY (employee_id)
);
Q17
Multiple Choice

Which SQL code snippet demonstrates a certification-level scenario using both natural keys and surrogate keys in a composite key?

SQL Code
CREATE TABLE enrollment (
enrollment_id NUMBER GENERATED ALWAYS AS IDENTITY,
student_id NUMBER,
course_code VARCHAR2(10),
PRIMARY KEY (enrollment_id, student_id)
);
Q18
Multiple Choice

Which SQL code snippet demonstrates enforcing a business key and candidate keys in a composite key scenario?

SQL Code
CREATE TABLE suppliers (
supplier_id NUMBER,
supplier_code VARCHAR2(20) UNIQUE,
company_name VARCHAR2(100) UNIQUE,
PRIMARY KEY (supplier_id)
);
Q19
Multiple Choice

Which SQL code snippet demonstrates using a natural key as part of a composite primary key?

SQL Code
CREATE TABLE flight_schedule (
flight_id NUMBER,
flight_code VARCHAR2(10),
departure_time TIMESTAMP,
PRIMARY KEY (flight_code, departure_time)
);
Q20
Multiple Choice

Which SQL code snippet demonstrates a certification-level scenario with both business and candidate keys?

SQL Code
CREATE TABLE departments (
department_id NUMBER,
department_name VARCHAR2(50) UNIQUE,
department_code VARCHAR2(10) UNIQUE,
PRIMARY KEY (department_id)
);
Q21
Single Choice

In Oracle databases, what is a Business Key?

Q22
Single Choice

Which of the following best describes a Natural Key in an Oracle database?

Q23
Single Choice

What is a Candidate Key in Oracle databases?

Q24
Single Choice

Consider the following Oracle SQL table definition:Which of the following could be considered as Natural Keys?

SQL Code
CREATE TABLE employees (
 emp_id NUMBER,
 emp_ssn VARCHAR2(11),
 emp_email VARCHAR2(50),
 emp_name VARCHAR2(100),
 PRIMARY KEY (emp_id)
);
Q25
Single Choice

In the following Oracle SQL code, which columns can be Candidate Keys?

SQL Code
CREATE TABLE students (
 student_id NUMBER,
 student_email VARCHAR2(100),
 student_roll_no VARCHAR2(20),
 student_name VARCHAR2(100),
 PRIMARY KEY (student_id)
);
Q26
Single Choice

Given the following Oracle table:Which of these could serve as a Business Key?

SQL Code
CREATE TABLE products (
 product_id NUMBER,
 product_sku VARCHAR2(50),
 product_name VARCHAR2(100),
 product_price NUMBER,
 PRIMARY KEY (product_id)
);
Q27
Single Choice

In Oracle, why might you choose to use a Natural Key over a Surrogate Key?

Q28
Single Choice

Consider the following Oracle SQL table definition:If order_number is unique and business meaningful, what key type does it represent?

SQL Code
If order_number is unique and business meaningful, what key type does it represent?
Q29
Single Choice

In Oracle, a Candidate Key is defined as:

Q30
Single Choice

Analyze the following Oracle table:If both product_code and warehouse_id are unique within the context of the business, how would you classify these keys?

SQL Code
CREATE TABLE inventory (
 inventory_id NUMBER,
 product_code VARCHAR2(50),
 warehouse_id NUMBER,
 quantity NUMBER,
 PRIMARY KEY (inventory_id)
);