Views and PL/SQL Basics MCQs: 12 Solved Questions with Explanations
Test views, materialized views, PL/SQL purity, Pro*C and trigger syntax with 12 solved MCQs. Each explanation separates the right rule from its distractors.
KnowledgeGate Team
Exam prep & CS education

Views, materialized views, PL/SQL and triggers use overlapping database vocabulary. That is why an aspirant can recognise the right idea but choose an option that names the wrong object. Standard views expose current base-table results, materialized views retain stored results until refresh, PL/SQL supplies procedural logic, and triggers react to events. Choose an option before opening each explanation. Use the Views & PL/SQL Basics practice page for more questions. The Semester & College Exam Courses page connects this topic to a wider learning route.
Views, materialized views, PL/SQL and triggers: four distinctions before solving

Object | What it means |
|---|---|
Standard view | A stored |
Materialized view | A stored result that needs refresh or maintenance. |
PL/SQL | Oracle's procedural SQL layer, with blocks, variables, conditions, procedures and functions. |
Trigger | An event-driven action tied to |
Consider LibraryLoan(loan_id, member_id, overdue_days, branch) with rows (L17, M04, 3, North), (L21, M09, 14, South) and (L34, M12, 18, North). Define:
CREATE VIEW north_overdue_loans AS
SELECT loan_id, member_id, overdue_days
FROM LibraryLoan
WHERE branch = 'North' AND overdue_days >= 10;The first result is (L34, M12, 18): L17 has only 3 overdue days, while L21 belongs to the South branch. After UPDATE LibraryLoan SET overdue_days = 12 WHERE loan_id = 'L17';, the result becomes (L17, M04, 12) and (L34, M12, 18). The standard view reads current base-table rows. A materialized snapshot taken before the update still shows only L34 until refresh. PL/SQL can package the update and its checks, while a trigger follows Event, Condition, Action when a database event occurs.
Views MCQs 1-3: virtual relations, security and stored data
Question 1: RPSC 2024
Which term describes a relation that is not a part of the Logical Model but is made visible to a user as a virtual relation?
A. Tuple
B. View
C. Instance
D. Schema
Correct answer: B. View.
A view is a named virtual relation exposed through a stored query. A tuple is one row, an instance is the database state at a moment, and a schema defines structure. “Virtual relation” fixes the answer. Solved page.
Question 2: ISRO 2025
Which of the following statement is true about database views?
A. Views always store a duplicate copy of the data
B. Views can be used to restrict access to sensitive columns
C. Views cannot be queried like normal database tables
D. Views cannot be updated under any condition
Correct answer: B. Views can be used to restrict access to sensitive columns.
An Employee view could expose emp_id, name and dept_id while hiding salary. Standard views need not duplicate rows, are queryable, and can sometimes be updated. The absolutes in A, C and D are false. Solved page.
Question 3: KVS 2013
Which of the following statements is not true for views in SQL?
A. Select statement used in the view definition cannot include ORDER BY clause.
B. A view derives its data from the base table(s).
C. A view is updatable if it has been defined from a single relation.
D. A view contains a copy of the data.
Correct answer: D. A view contains a copy of the data.
Under the question's introductory SQL convention, D is the intended false statement: a standard view stores a query definition, not an ordinary copy of rows. Some DBMSs permit ORDER BY in restricted view definitions, and a single-table view can still be non-updatable when it uses aggregates, DISTINCT or other disqualifying features. A materialized view, by contrast, stores results. Solved page.
Views MCQs 4-5: view versus trigger and materialized-view maintenance
Question 4: UGC NET 2017
Which of the following is/are true with reference to ‘view’ in DBMS ?(a) A ‘view’ is a special stored procedure executed when certain event occurs.(b) A ‘view’ is a virtual table, which occurs after executing a pre-compiled query.Code :
A. Only (a) is true
B. Only (b) is true
C. Both (a) and (b) are true
D. Neither (a) nor (b) are true
Correct answer: B. Only (b) is true.
Statement (a) describes trigger-like event-driven behaviour. Statement (b) gives the intended view definition. More precisely, CREATE VIEW saves a query definition that is evaluated against its base tables when queried. Solved page.
Question 5: RSSB 2022
Which object is used to maintain a materialized view in RDBMS?
A. Trigger
B. Pointer
C. Clone object
D. None
Correct answer: A. Trigger.
For this exam item, Trigger is the intended answer: base-table changes can invoke maintenance logic, while pointers and clones cannot. Production DBMSs often implement materialized-view refresh internally or through refresh logs and schedules, so a trigger is not a universal implementation rule. Solved page.
PL/SQL basics MCQs 6-8: procedural purpose, purity and Pro*C
Question 6: TPSC 2024
What is the primary purpose of using PL/SQL in Oracle databases ?
A. To create database schemas
B. To perform data analysis
C. To generate reports
D. To create stored procedures and functions for database operations
Correct answer: D. To create stored procedures and functions for database operations.
SQL states the required data operation. PL/SQL adds variables, conditions, loops, exceptions, procedures and functions to package database-side logic. Schema creation, analysis and report presentation are not its primary purpose. Solved page.
Question 7: UPPSC Polytechnic Lecturer 2018
If a function does not modify the database, the purity level is
A. RNDS
B. WNPS
C. RNPS
D. WNDS
Correct answer: D. WNDS.
WNDS expands to Writes No Database State, exactly the restriction in the stem. RNDS concerns reading database state, while WNPS and RNPS concern writing or reading package state.
Question 8: Hexaware 2024
The ______ pre-compiler translates embedded SQL into calls to the Oracle runtime library.
A. Pro*C
B. ORM
C. ApexSQL
D. None of the mentioned
Correct answer: A. Pro*C.
The flow is C source with EXEC SQL SELECT ... to Pro*C precompiler to C code with Oracle runtime calls to the normal C compiler. ORM maps objects, and ApexSQL is not this Oracle precompiler. Solved page.
Trigger MCQs 9-10: event-driven action and the ECA model
Question 9: BEL 2023
A ______ defines an action the database should take when some database-related event occurs that causes a change in the content of a table in a database.
A. Trigger
B. Hit
C. Field
D. Relation
Correct answer: A. Trigger.
A trigger is stored logic fired by an event. For example, BEFORE INSERT ON LibraryLoan can set an audit timestamp before storage. Field and relation describe data; hit is not the required object. Solved page.
Question 10: Coal India 2020

A trigger has three parts.
The ______ describes the change that activates the trigger.
The ______ is a query that is run whenever the trigger is activated.
The ______ is the procedure that is executed if the trigger is activated and the condition is true.
A. event, condition, actor
B. entity, condition, action
C. event, question, action
D. event, condition, action
Correct answer: D. event, condition, action.
The event is an UPDATE of loan L17. The condition is NEW.overdue_days >= 10. If true, the action writes (L17, 'LONG_OVERDUE') to LoanAudit. That sequence is Event, Condition, Action. Solved page.
Trigger MCQs 11-12: choosing CREATE TRIGGER and reading MySQL syntax
Question 11: RPSC 2024
The operation which can be used to specify automatic actions that the database system will perform when certain events and conditions occur is known as –
A. CREATE TRIGGER
B. CREATE VIEW
C. CREATE ASSERTION
D. CREATE TABLE
Correct answer: A. CREATE TRIGGER.
CREATE TRIGGER defines an automatic event response. CREATE VIEW defines a stored query, CREATE TABLE defines storage, and an assertion states a constraint. “Automatic actions” plus “events” identifies the trigger statement. Solved page.
Question 12: IBPS 2024
In MySQL, which of the following statements correctly creates a trigger that executes automatically before inserting a row into the Employee table?
A.
CREATE TRIGGER trg_before_insert
BEFORE INSERT ON Employee
FOR EACH ROW
SET @x = 1;B.
CREATE TABLE trg_before_insert
BEFORE INSERT ON Employee;C.
TRIGGER trg_before_insert
ON Employee
BEFORE INSERT;D.
CREATE VIEW trg_before_insert
BEFORE INSERT ON Employee;E.
CREATE INDEX trg_before_insert
ON Employee(Before_Insert);Correct answer: A.
Option A has every token: CREATE TRIGGER, name trg_before_insert, BEFORE INSERT, ON Employee, FOR EACH ROW, then SET @x = 1. The other choices use the wrong DDL object or omit creation syntax. Solved page.
Views and PL/SQL MCQs: diagnostic map, common traps and next step
Missed questions | Concept to rebuild |
|---|---|
Questions 1-5 | Standard views, materialized results and view-versus-trigger definitions. |
Questions 6-8 | PL/SQL purpose, WNDS purity and the Pro*C precompiler. |
Questions 9-12 | Trigger events, ECA parts and CREATE TRIGGER syntax. |
Use the missed-question cluster, not the raw score, to choose a revision target. Questions 1-4 address views; Question 5 addresses materialized-view maintenance; Questions 6-8 address PL/SQL, purity and embedded SQL; Questions 9-12 address triggers, ECA and syntax.
Avoid treating every view as materialized, confusing triggers with procedures or views, and reading syntax without expanding tokens. After working through views, PL/SQL purity, Pro*C and trigger syntax, practise SELECT, joins and subqueries in the earlier DBMS SQL Query MCQs set. For command-family classification and the row effects of INSERT, UPDATE and DELETE, use the earlier DDL, DML, DCL, TCL and DESC MCQs set.
Identify the object, then test each option against it. For broader CS study, use ZERO TO HERO.
Keep learning
PowerPoint Slides & Views MCQs: 12 Solved Questions with Explanations
Test yourself on 12 PowerPoint questions covering Master views, Slide Sorter, templates, effects, file formats and slideshow shortcuts.
SQL Views Tutorial: CREATE VIEW, Updates and Worked Examples
Build SQL views on one small employee dataset, trace their exact results, test safe updates, and compare live views with stored materialized snapshots.
SELECT, WHERE and DISTINCT MCQs: 12 Solved SQL Questions with Explanations
Test the SQL basics that decide columns, filter rows and remove duplicates. Attempt 12 MCQs, then use each short solution to diagnose the exact rule involved.
Nested and Correlated Subqueries MCQs: 12 Solved SQL Questions with Explanations
Solve 12 nested and correlated subquery questions by tracing result shape, correlation, duplicates, quantified comparisons, and ranking logic.





