Category Archives: SQ L& MYsql

Autocommit

You can control the behavior of transaction by setting the session variable called AUTOCOMMIT. if AUTOCOMMIT is set to 1(the default),then each SQL statment(within a transaction or not) is considered to be a complete transaction and committed by default finishes. When AUTOCOMMIT is set to 0,by issuing the SET AUTOCOMMIT=0 command, the subsequent series of… Read More »

What is ACID in Transaction

Transaction have the following four standard properties ,usually referred to by the acronym ACID. * Atomicity-ensures that all operations within the work unit are completed successfully, otherwise the transaction is aborted at the point of failure and previous operations are rolled back to their former state. *Consistency-ensures that the database properly changes states uon a… Read More »

What is mean by Transaction?

A Transaction is a sequential group of database manipulation operation. which is performed as if it were one single work unit. Transaction will never be complete unless each individual operation within the group is successful.If any operation within the transaction fails,the entire transaction will fail.

Difference between TRUNCATE,DELETE and DROP commands

1)DELETE-Delete command is using to remove a rows from a table. “Where” clause is used to remove some rows. if no “where” condition specified all rows will be removed. After performing a DELETE operation you need to “commit” or “Rollback” the transaction to make the change permanent or undo it. 2)TRUNCATE- “truncate” removes all rows… Read More »

Transaction Control-TCL

statements are used to manage the changes made by DML statements Some Examples 1)COMMIT-save work done 2)SAVEPOINT-identify a point in a transaction to which you can later roll back 3)ROLLBACK-restore database to original since the last COMMIT 4)SETTRANSACTION- Change transaction options like isolation level and what rollback segment to use.

Data Manipulation Language-DML

statements are used for managing data within the schema objects Examples as below 1.SELECT-retrieve data from the database 2.INSERT-insert data into a table 3.UPDATE-updates existing data within a table 4.DELETE-deletes all records from a table, the space for the records remain 5.MERGE-Upsert operation it will include both insert and update 6.CALL-call a PL/SQL or java… Read More »

Data Definition Language-DDL

These are used to define database structure or schema Examles as below 1.CREATE- create objects in the database 2.ALTER- alters the structure of the database 3.DROP-delete the objects from the database 4.TRUNCATE-remove all the records from the database  including spaces allocated for the records are removed. 5.COMMENT-add comments to the data dictionary 6.RENAME-rename an object.