Oracle Database Quiz Questions

Course Name:Oracle
Chapter Name:Chapter 6 - DML (Data Manipulation Language)
Lesson Content Link:UPDATE
Current Quiz Count:30
Progress
0%
Q1
True / False

The UPDATE statement in Oracle is used to modify existing rows in a table.

Q2
True / False

In Oracle, you must specify a WHERE clause in the UPDATE statement to modify rows.

Q3
True / False

The SET clause in the UPDATE statement is used to specify the new values for the columns being updated.

Q4
True / False

In Oracle, you can use subqueries in the SET clause of an UPDATE statement.

Q5
True / False

In Oracle, the UPDATE statement can modify multiple columns in a single operation.

Q6
True / False

The UPDATE statement in Oracle cannot be used to update rows in a view.

Q7
True / False

In Oracle, you can use the RETURNING clause in an UPDATE statement to retrieve values from the updated rows.

Q8
True / False

In Oracle, an UPDATE statement can be part of a PL/SQL block and can include procedural logic.

Q9
True / False

In Oracle, updating a primary key column is allowed without any restrictions.

Q10
True / False

The Oracle Certified Professional (OCP) exam includes knowledge on optimizing the UPDATE statement for performance and understanding its interaction with indexes and triggers.

Q11
Single Choice

What is the primary purpose of the UPDATE statement in Oracle?

Q12
Single Choice

Which of the following is the correct syntax for updating the SALARY of an employee with ID = 1 in the EMPLOYEES table to 5000?

Q13
Single Choice

In Oracle, what will happen if you execute an UPDATE statement without a WHERE clause?

Q14
Single Choice

How can you update multiple columns in a single UPDATE statement in Oracle?

Q15
Single Choice

What will happen if the UPDATE statement in Oracle tries to modify a record to violate a UNIQUE constraint?

SQL Code
CREATE TABLE EMPLOYEES (
 ID NUMBER PRIMARY KEY,
 EMAIL VARCHAR2(100) UNIQUE,
 SALARY NUMBER
);

UPDATE EMPLOYEES
SET EMAIL = 'duplicate@example.com'
WHERE ID = 2;
Q16
Single Choice

How can you update a record in Oracle to set the LAST_MODIFIED column to the current date and time?

Q17
Single Choice

Consider the following Oracle SQL code. What will be the result of executing the UPDATE statement?

SQL Code
CREATE TABLE ORDERS (
 ORDER_ID NUMBER PRIMARY KEY,
 STATUS VARCHAR2(20),
 SHIP_DATE DATE
);

UPDATE ORDERS
SET SHIP_DATE = SYSDATE
WHERE STATUS = 'Shipped';
Q18
Single Choice

In Oracle, how can you use a subquery in an UPDATE statement to set the SALARY of an employee to the average salary of their department?

Q19
Single Choice

What is the effect of using the RETURNING clause in an Oracle UPDATE statement?

SQL Code
UPDATE EMPLOYEES
SET SALARY = 6000
WHERE ID = 1
RETURNING SALARY INTO :new_salary;
Q20
Single Choice

In Oracle, which of the following is true about updating records in a table that has triggers defined?

Q21
Multiple Choice

Identify the SQL scripts that correctly perform a basic UPDATE operation on a single row in Oracle.

SQL Code
You need to update the salary of an employee with employee_id 101 to 60000 in the 'employees' table.

Which of the following SQL scripts correctly implement this scenario?
Q22
Multiple Choice

Select the SQL scripts that correctly perform an UPDATE operation with a JOIN in Oracle.

SQL Code
You need to update the 'employees' table by setting the 'department_name' based on the 'departments' table using a JOIN on 'department_id'.

Which of the following SQL scripts correctly implement this scenario?
Q23
Multiple Choice

Determine the SQL scripts that correctly handle conditional UPDATE operations in Oracle.

SQL Code
You need to update the 'projects' table to increase the budget by 10% for projects with a start date earlier than 2023.

Which of the following SQL scripts correctly implement this scenario?
Q24
Multiple Choice

Identify the SQL scripts that correctly perform an UPDATE operation with a subquery in Oracle.

SQL Code
You need to update the 'employees' table by setting the 'manager_id' based on the highest salary within the same department.

Which of the following SQL scripts correctly implement this scenario?
Q25
Multiple Choice

Select the SQL scripts that correctly perform a bulk UPDATE operation in Oracle.

SQL Code
You need to update the 'products' table to set the 'discount' column to 5% for all products in the 'Electronics' category.

Which of the following SQL scripts correctly implement this scenario?
Q26
Multiple Choice

Determine the SQL scripts that correctly handle an UPDATE operation with error handling in Oracle.

SQL Code
You need to update the 'orders' table to set the 'order_status' to 'Shipped' but handle any errors that occur during the operation.

Which of the following SQL scripts correctly implement this scenario?
Q27
Multiple Choice

Identify the SQL scripts that correctly perform an UPDATE operation using the RETURNING clause in Oracle.

SQL Code
You need to update the 'inventory' table to increase the 'stock_quantity' and return the updated values for each affected row.

Which of the following SQL scripts correctly implement this scenario?
Q28
Multiple Choice

Select the SQL scripts that correctly perform an UPDATE operation on a table with a BLOB column in Oracle.

SQL Code
You need to update the 'documents' table to replace the contents of a BLOB column 'doc_content' with a new file for a specific document.

Which of the following SQL scripts correctly implement this scenario?
Q29
Multiple Choice

Determine the SQL scripts that correctly perform a complex UPDATE operation with multiple columns in Oracle.

SQL Code
You need to update both the 'salary' and 'job_title' columns in the 'employees' table for employees in the 'Sales' department.

Which of the following SQL scripts correctly implement this scenario?
Q30
Multiple Choice

Select the SQL scripts that correctly perform an UPDATE operation with a sequence in Oracle.

SQL Code
You need to update the 'transactions' table to assign a new sequence-generated value to the 'transaction_id' column for each existing record.

Which of the following SQL scripts correctly implement this scenario?