0% found this document useful (0 votes)
49 views4 pages

SQL Practical 5

Views allow queries to be stored and reused, with the view relation generated on demand from the query expression. Materialized views physically store the view data and update when tables change. Updateable views must have a single table in the from clause and only attribute names in the select clause without expressions or aggregates. Transactions can create savepoints to rollback to intermediate points, with rollback only possible to savepoints set after a commit, as committed work cannot be rolled back.

Uploaded by

Jyovita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views4 pages

SQL Practical 5

Views allow queries to be stored and reused, with the view relation generated on demand from the query expression. Materialized views physically store the view data and update when tables change. Updateable views must have a single table in the from clause and only attribute names in the select clause without expressions or aggregates. Transactions can create savepoints to rollback to intermediate points, with rollback only possible to savepoints set after a commit, as committed work cannot be rolled back.

Uploaded by

Jyovita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical 5 –Views and Transaction Commands

Views

 Database only stores the query expression associated with the view relation. View
relation is created whenever needed, on demand.
 Views can be created from existing views also.
 Materialized Views: Storing whole view and updating when table changes.
 Updateable Views:
o The from clause has only one database relation.
o The select clause contains only attribute names of the relation, and does not
have any expressions, aggregates, or distinct specification.
o Any attribute not listed in the select clause can be set to NULL, if it does not have
a not null constraint.
o The query does not have a group by or having clause.

Commit, Savepoint and Roll Back

Creating a savepoint and commiting:

Adding another savepoint:


Savepoint before commit cannot be rolledback to. However, roll back can be done upto a
savepoint written after commit. This is because committed work cannot be rolled back.

You might also like