Saturday, 11 June 2016
TRANSACTION
A transaction is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program.
A transaction is the propagation of one or more changes to the database. For example, if you are creating a record or updating a record or deleting a record from the table, then you are performing transaction on the table. It is important to control transactions to ensure data integrity and to handle database errors.
Properties of Transactions
Transactions have the following four standard properties, usually referred to by the acronym ACID:
1. 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.
2. Consistency: ensures that the database properly changes states upon a successfully committed transaction.
3. Isolation: enables transactions to operate independently of and transparent to each other.
4. Durability: ensures that the result or effect of a committed transaction persists in case of a system failure.
DATABASE LANGUAGES
Data Defunition Language (DDL)
Data Definition Language is used to define the database conceptual schema. In most DBMS, the DDL also defines user views and sometimes storage structures. The DBMS will have a DDL compiler whose function is to process DDL statements in order to identify descriptions of the schema constructs and to store the schema description in the DBMS catalog. In other DBMSs, separate languages -View Definition Language (VDL), Storage Definition Language (SDL) - may exist for specifying views and storage structures.
DDL statements are used to alter/modify a database or table structure and schema. These statements handle the design and storage of database objects;
CREATE – create a new Table, database, schema
ALTER – alter existing table, column description
DROP – delete existing objects from database
Data Manipulation Language (DML)
A data manipulation language (DML) is a family of computer languages including commands permitting users to manipulate data in a database. This manipulation involves inserting data into database tables, retrieving existing data, deleting data from existing tables and modifying existing data. DML is mostly incorporated in SQL databases.
DML statements affect records in a table. These are basic operations we perform on data such as selecting a few records from a table, inserting new records, deleting unnecessary records, and updating/modifying existing records.
DML statements include the following:
SELECT – select records from a table
INSERT – insert new records
UPDATE – update/Modify existing records
DELETE – delete existing records
Subscribe to:
Posts (Atom)