DEV Community

Carnato
Carnato

Posted on

ACID PROPERTIES OF THE DBMS

ACID:

What is ACID properties :

  • It is a set of database properties. and every transaction must obey this properties for ensuring the integrity and consistency of the database.

  • Atomicity

  • Consistency

  • Isolation

  • Durability

Atomicity :

  • If any update occur in database then it should be reflected in whole database or should not be reflected at all.

Consistency:

  • This property ensure that data remains consistent before and after transaction.

Isolation:

  • This properties ensures that each transaction is occurring independently of the others. This implies that state of an ongoing transaction doesn't affect the state of another ongoing transaction.

Durability:

  • This property ensures that the data is not lost in cases of a system failure or restart and is present in the same state as it was before the system failure or restart.

Explain the difference between the DELETE and TRUNCATE command in a DBMS.

TRUNCATE

  • This command is needed to remove the complete data from the table in database.it does not required WHERE clause.

  • It is the command of the DDL.

  1. - It remove complete data from the table in the database.
  2. - It does not maintain the log and delete the whole table at once. hence it's fast.
  3. - It can not be rollback. *Example * : TRUNCATE TABLE TableName;

DELETE
This command is used when we required to delete a particular data from the table. and this command is used the WHERE clause for deleting the data from the table in the database.
It is the command of the DML

Example :DELETE FROM TableName
WHERE condition;

DROP:
It is a Data Definition Language Command (DDL). It is used to drop the whole table. With the help of the “DROP” command we can drop (delete) the whole structure in one go i.e. it removes the named elements of the schema. By using this command the existence of the whole table is finished or say lost.

SYNTAX
If we want to drop the table:
DROP table

Note – Here we can’t restore the table by using the “ROLLBACK” command because it auto commits.

Discussion (0)