Q1
True / FalseIn ORACLE, a Business Key is always unique within a table
A Business Key is a unique identifier used within the business context and must be unique within the table to ensure accurate identification of records.
Q2
True / FalseA Natural Key in ORACLE is derived from the attributes of the business domain.
A Natural Key is a key that is formed of attributes that naturally exist in the business domain, such as a social security number or email address.
Q3
True / FalseIn ORACLE, a Candidate Key can only consist of a single column.
A Candidate Key can be composed of one or more columns, as long as it uniquely identifies a row in the table.
Q4
True / FalseA Business Key in ORACLE can serve as a Natural Key.
A Business Key can also be a Natural Key if it is derived from business attributes that uniquely identify a record.
Q5
True / FalseIn ORACLE, a table can have multiple Candidate Keys.
A table can have multiple Candidate Keys, each of which can uniquely identify a row within the table.
Q6
True / FalseNatural Keys in ORACLE databases are preferred over surrogate keys for performance reasons.
Natural Keys are not necessarily preferred for performance reasons; surrogate keys are often used for performance and manageability benefits.
Q7
True / FalseIn ORACLE, a Candidate Key can be chosen as the Primary Key of a table.
Any Candidate Key can be chosen as the Primary Key of a table since it uniquely identifies each row in the table.
Q8
True / FalseA Business Key in ORACLE should not change over time to maintain data integrity.
Business Keys should remain stable over time to maintain data integrity and avoid issues with data consistency.
Q9
True / FalseIn ORACLE, a Natural Key can contain null values.
A Natural Key cannot contain null values because it must uniquely identify a row in the table, and null values would prevent this.
Q10
True / FalseIn ORACLE, while designing a table, it's mandatory to have at least one Candidate Key.
When designing a table, it is mandatory to have at least one Candidate Key, as it is required to uniquely identify rows within the table. This ensures the integrity and uniqueness of the data.
Q11
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate creating a table with `email` as a business key because it uniquely identifies each employee. Option D is incorrect because it does not include the `UNIQUE` constraint on the `email` column.
Q12
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate using `product_code` as a natural key, as it is derived from the business context and uniquely identifies a product. Option D is incorrect because it does not use a natural key.
Q13
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate identifying `ssn` and `email` as candidate keys because they both uniquely identify a student. Option D is incorrect because it does not enforce uniqueness on either `ssn` or `email`.
Q14
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate creating a table where `order_id` is the surrogate key and `order_number` is the natural key. Option D is incorrect because it lacks the unique constraint on `order_number`.
Q15
Multiple ChoiceWhich 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
);
Options A, B, and C correctly demonstrate a table where `vin` is the natural key, and `registration_number` and `license_plate` are candidate keys. Option D is incorrect because it lacks the unique constraint on `registration_number` and `license_plate`.
Q16
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate enforcing a business key (`email`) and other candidate keys (`social_security_number`). Option D is incorrect because it does not enforce uniqueness on the `social_security_number`.
Q17
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate a composite key scenario with a natural key (`course_code`) and a surrogate key (`enrollment_id`). Option D is incorrect because it does not include a composite key.
Q18
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate a composite key scenario where `supplier_code` is a business key, and `company_name` is a candidate key. Option D is incorrect because it does not enforce uniqueness on `company_name`.
Q19
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate using `flight_code` as a natural key within a composite primary key. Option D is incorrect because it does not include a composite key.
Q20
Multiple ChoiceWhich 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)
);
Options A, B, and C correctly demonstrate a table where `department_name` is a business key and `department_code` is a candidate key. Option D is incorrect because it does not enforce uniqueness on `department_code`.