Q1
True / FalseA view in PostgreSQL is a stored query that you can reference like a table.
A view in PostgreSQL is indeed a stored query that can be referenced as if it were a table. It does not store data itself but presents data from other tables.
Q2
True / FalseYou can update the data in a view in PostgreSQL.
You can update the data in a view, but it must be an updatable view. This typically means the view is based on a single table and does not include complex joins, aggregates, or distinct clauses.
Q3
True / FalsePostgreSQL views support triggers like tables do.
Unlike tables, views in PostgreSQL do not support triggers directly. However, you can define INSTEAD OF triggers on views to handle insert, update, and delete operations.
Q4
True / FalseIn PostgreSQL, you can create a view with a WITH CHECK OPTION clause to ensure the view only allows rows that conform to its WHERE clause.
The WITH CHECK OPTION clause can be used in PostgreSQL to ensure that any modifications to the view conform to the criteria defined by the view's WHERE clause.
Q5
True / FalseA materialized view in PostgreSQL is updated automatically whenever the underlying data changes.
A materialized view in PostgreSQL is not updated automatically when the underlying data changes. It must be refreshed manually using the REFRESH MATERIALIZED VIEW command.
Q6
True / FalsePostgreSQL views can include window functions in their definitions.
Views in PostgreSQL can include window functions in their definitions, allowing complex analytical queries to be stored and reused.
Q7
True / FalseIn PostgreSQL, you can define indexes on views to improve query performance.
In PostgreSQL, you cannot define indexes directly on views. However, you can create indexes on materialized views since they store data physically.
Q8
True / FalsePostgreSQL supports the creation of recursive views using the WITH RECURSIVE clause.
PostgreSQL supports recursive queries using the WITH RECURSIVE clause, and such queries can be used in view definitions to create recursive views.
Q9
True / FalseYou can use the ORACLE-specific hint in PostgreSQL views to optimize query performance.
PostgreSQL does not support ORACLE-specific hints. Query optimization in PostgreSQL is handled differently and does not use Oracle-style hints.
Q10
True / FalseWhen using PostgreSQL views in a data migration project from ORACLE, all view definitions can be directly transferred without any modification.
When migrating views from ORACLE to PostgreSQL, view definitions often require modification due to differences in SQL dialects, functions, and features supported by the two systems.