1
2
3
4
5
100

What is a view in SQL?
A) A physical table
B) A saved query
C) A database
D) An index

B) A saved query

100

Does a view store data itself?
A) Yes
B) No
C) Sometimes
D) Only in SQLite

B) No

100

A view acts like:
A) A file
B) A virtual table
C) A server
D) A key

B) A virtual table

100

Why are views useful?
A) To delete data
B) To simplify queries
C) To slow down queries
D) To create indexes

B) To simplify queries

100

When you query a view, what happens?
A) Nothing
B) Data is deleted
C) The query runs again
D) A new table is created

C) The query runs again

200

What is stored inside a view?
A) Data rows
B) Query definition
C) Indexes
D) Keys

Query definition

200

Which SQL command is most commonly used with views?
A) DELETE
B) SELECT
C) DROP
D) ALTER

 SELECT

200

What problem do views solve?
A) Data duplication
B) Rewriting queries many times
C) Slow internet
D) Memory issues

 Rewriting queries many times

200

Where are views stored in SQLite?
A) user_table
B) sqlite_master
C) system_data
D) view_store

B) sqlite_master

200

What type is used for views in sqlite_master?
A) 'table'
B) 'index'
C) 'view'
D) 'data'

C) 'view'

300

 Which is NOT a benefit of views?
A) Simplification
B) Reusability
C) Data storage
D) Security

Security

300

Views help users avoid:
A) Writing code
B) Understanding complex tables
C) Using SQL
D) Running queries

Understanding complex tables

300

Views can help with:
A) Security
B) Deleting databases
C) Hardware upgrades
D) Networking

Security

300

What happens if you change a view definition?
A) All related queries update automatically
B) Data is deleted
C) Database crashes
D) Nothing changes

 All related queries update automatically

300

Views are useful for:
A) Complex joins
B) Simple queries only
C) Storing files
D) Encryption

Complex joins

400

Which operation may NOT work on some views?
A) SELECT
B) INSERT
C) UPDATE
D) All of the above

All of the above

400

In SQLite, which operations are NOT supported on views?
A) SELECT
B) INSERT/UPDATE/DELETE
C) CREATE
D) DROP

 INSERT/UPDATE/DELETE

400

What is a non-updateable view?
A) A view that stores data
B) A view that cannot be modified with INSERT/UPDATE/DELETE
C) A broken view
D) A temporary table

A view that cannot be modified with INSERT/UPDATE/DELETE

400

Why should you avoid creating views of views?
A) It increases performance
B) It simplifies queries
C) It becomes too complex
D) It deletes data

It becomes too complex

400

What is a performance issue with views?
A) They store too much data
B) They re-run queries each time
C) They delete tables
D) They block users

They re-run queries each time

500

Explain how a view helps reduce query duplication, and give a simple example.

Answer: A view stores a common query (e.g., joining students and courses), so instead of rewriting it multiple times, you reuse the view, reducing repetition.

500

What is the main difference between a table and a view in terms of data storage and execution?

Answer: A table stores actual data, while a view stores only a query and retrieves data dynamically when accessed.

500

Why are views useful when working with complex SQL queries involving joins?

Answer: They hide complexity by encapsulating joins, making queries easier to read and reuse.

500

How can a view be used to restrict access to sensitive data? Provide a simple example.

Answer: A view can show only selected columns (e.g., student name and course) while hiding sensitive ones like GPA or grades.

500

What happens if the underlying tables of a view are modified (e.g., columns added or removed)?

Answer: The view may still work if changes don’t affect its query, but it can break if required columns are removed or renamed.