Oracle Database Quiz Questions

Course Name:Oracle
Chapter Name:Chapter 9 - Advanced Topics
Lesson Content Link:Database View
Current Quiz Count:30
Progress
0%
Q1
True / False

In ORACLE, a view is a virtual table that is based on the result of a SELECT query.

Q2
True / False

In ORACLE, views can be used to simplify complex queries.

Q3
True / False

In ORACLE, you can insert, update, and delete data through a view.

Q4
True / False

In ORACLE, a view can be created using a SELECT statement that includes a JOIN.

Q5
True / False

In ORACLE, views can have indexes created on them.

Q6
True / False

In ORACLE, views can be used to enforce security by restricting access to specific columns or rows.

Q7
True / False

In ORACLE, a materialized view stores the result of the query physically.

Q8
True / False

In ORACLE, changes to the underlying tables are automatically reflected in a materialized view without any additional steps.

Q9
True / False

In ORACLE, views can include a WHERE clause to filter data.

Q10
True / False

In ORACLE, a view can be created with the WITH CHECK OPTION clause to ensure that all DML operations on the view conform to the view's WHERE clause.

Q11
Multiple Choice

Identify the SQL statements that correctly create a simple view based on a single table in Oracle.

SQL Code
CREATE TABLE employees (
 employee_id NUMBER PRIMARY KEY,
 employee_name VARCHAR2(100),
 department_id NUMBER
);
Q12
Multiple Choice

Select the SQL statements that correctly create an updatable view in Oracle.

Q13
Multiple Choice

Which of the following SQL statements correctly create this complex view?

Q14
Multiple Choice

Identify the SQL statements that correctly create a materialized view in Oracle.

Q15
Multiple Choice

Choose the SQL statements that correctly demonstrate the creation of a view with a WHERE clause in Oracle.

Q16
Multiple Choice

Which SQL statements demonstrate the creation of an inline view in Oracle?

Q17
Multiple Choice

Determine the SQL statements that correctly create a view with a WITH CHECK OPTION clause in Oracle.

Q18
Multiple Choice

Which of the following SQL statements correctly create this read-only view?

Q19
Multiple Choice

Choose the SQL statements that correctly demonstrate the creation of a view with a GROUP BY clause in Oracle.

Q20
Multiple Choice

Select the SQL statements that demonstrate the creation of a view with a JOIN and a GROUP BY clause in Oracle.

Q21
Single Choice

How would you create a database view to display the employee names and their department names?

SQL Code
CREATE VIEW emp_dept_view AS
SELECT e.employee_name, d.department_name
FROM employees e
JOIN departments d ON e.department_id = d.department_id;
Q22
Single Choice

How can you create a view that filters records based on a specific condition?

SQL Code
CREATE VIEW active_employees_view AS
SELECT employee_id, employee_name
FROM employees
WHERE status = 'Active';
Q23
Single Choice

What happens when you try to create a view with a SELECT statement that includes a GROUP BY clause?

SQL Code
CREATE VIEW dept_salary_view AS
SELECT department_id, SUM(salary) AS total_salary
FROM employees
GROUP BY department_id;
Q24
Single Choice

How would you create a view that includes a subquery in its SELECT statement?

SQL Code
CREATE VIEW high_salary_employees AS
SELECT employee_id, employee_name, salary
FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees);
Q25
Single Choice

What is the impact of using the WITH CHECK OPTION clause when creating a view?

SQL Code
CREATE VIEW active_employees_view AS
SELECT employee_id, employee_name
FROM employees
WHERE status = 'Active'
WITH CHECK OPTION;
Q26
Single Choice

How would you create a view that concatenates columns to display a full name?

SQL Code
CREATE VIEW employee_full_name_view AS
SELECT employee_id, first_name || ' ' || last_name AS full_name
FROM employees;
Q27
Single Choice

What is the result of creating a view that includes an ORDER BY clause?

SQL Code
CREATE VIEW sorted_employees_view AS
SELECT employee_id, employee_name
FROM employees
ORDER BY employee_name;
Q28
Single Choice

How would you create a view that restricts access to only specific columns?

SQL Code
CREATE VIEW employee_summary_view AS
SELECT employee_id, employee_name, department_id
FROM employees;
Q29
Single Choice

What is the purpose of creating an inline view in Oracle?

SQL Code
SELECT department_id, AVG(salary) AS avg_salary
FROM (SELECT department_id, salary
 FROM employees)
GROUP BY department_id;
Q30
Single Choice

How would you create a materialized view that stores precomputed results?

SQL Code
CREATE MATERIALIZED VIEW sales_summary_mv
AS SELECT product_id, SUM(sales_amount) AS total_sales
FROM sales
GROUP BY product_id;