Exercise

Set - 1

Question 6 :

Explain "Commit" and "Roll back"

Answer :

The Oracle RDBMS provides a transaction model based on a unit of work. The PL/SQL language supports most, but not all, of the database model for transactions (you cannot, for example, ROLLBACK FORCE). Transactions begin with the first change to data and end with either a COMMIT or ROLLBACK.

COMMIT makes the database changes permanent and visible to other database sessions.

ROLLBACK undoes the changes made in the current transaction either to the beginning of the transaction or to a savepoint. A savepoint is a named processing point in a transaction, created with the SAVEPOINT statement. Rolling back to a savepoint is a partial rollback of a transaction, wiping out all changes (and savepoints) that occurred later than the named savepoint.


Question 7 :

What happens "Update" command is used without where clause ?

Answer :

Answer1:
It will update all the records with same name in the particular field of the table.

Answer2:
If we dont mention "WHERE" clause in the UPDATE statement, it will update all records satisfying the given condition (if given any ) in the table !

Answer3:
Based on query condition. it will update all the fields which are mentioned in the query.
ex: update employee set firstname= @firstname,lastname=@lastname where employee_id =@employee_id.
so in the above case nothing wil be happen if you used where clause or not.
if you have many statements in the query you need to use the where clause.


Question 8 :

What are logical databases?

Answer :

Answer1:
insert' will add a new record or a new row into the database table.
'Update' will modify a record in the DB table.
'Modify' it is a combination of both insert and update...

Answer2:
INSERT - Add a new record into the database table.
MODIFY - If record is available it modifies otherwise it wont modify.
UPDATE - If record is available its update the record otherwise it creates a new record.


Question 9 :

Difference between "Insert", "Update" and "Modify"

Answer :

INSERT - Add a new record into the database table.
MODIFY - If record is available it modifies otherwise it wont modify.
UPDATE - If record is available its update the record otherwise it creates a new record.


Question 10 :

"Catch" Command

Answer :

Trying to catch any runtime errors programmatically or manually we use this statement catch.