You are on page 1of 1

Experiment Observations

• Views:
1) No need to have a PRIMARY KEY in the original table to create a view.
2) Inserting a value in a view inserts a corrosponding value in the original table with
NULL in the fields not included in the view.
3) Cannot insert in a view if the original table has as a PRIMARY KEY but the view
does not have that field.
4) Fields can have NULL values in the rows.
5) A view is by default updatable if the original table does not have a PRIMARY
KEY.
Example of an updatable view: table:temp(primary key(rollno))

view:

• Stored Procedures
1. way to store a query to use it again.
2. Comes handy when a particular query is fired very frequently.
3. Faster as they are cached in the server

*delimiter $$ used to run compound statements


4. provides security as query is made using procedure name only.
• Transactions
SELECT, UPDATE etc are in itself transactions and either affect the table or
not, now suppose we want to run multiple such statements so we need to use SET
TRANSACTION to begin transection and COMMIT to end a transaction.
Rollback is also done if transaction is not done completely.
• Grant/Revoke Privileges
1. Only Database Administrator can provide/remove privileges on a database object.
2. System privileges - This allows the user to CREATE, ALTER, or DROP database
objects.
3. Object privileges - This allows the user to EXECUTE, SELECT, INSERT,
UPDATE data from database objects to which the
privileges apply.
• Triggers
1. Triggers are called automatically when an event occurs.
2. Help in generation of some derived attribute of an entity. For ex return date is
automatically calculated as issue date is filled.
3. Serves purpose as an auditor.

You might also like