Page 87 - CITS - Computer Software Application -TT
P. 87
COMPUTER SOFTWARE APPLICATION - CITS
REVOKE SELECT ON table_name FROM user_name;
DCL commands play a crucial role in controlling who can access and manipulate data within a database, ensuring
data integrity and security. Database administrators use these commands to define and enforce access policies,
restrict unauthorized access, and manage the permissions of users and roles in the database system. Properly
configured DCL commands help protect sensitive data and maintain the integrity of the database.
TCL (Transaction Control Language)
TCL, which stands for Transaction Control Language, is a subset of SQL (Structured Query Language) used for
managing database transactions. Transactions in a database are sequences of one or more SQL statements that
are treated as a single, indivisible unit of work. TCL commands are used to control the beginning and ending of
transactions, ensuring data consistency and integrity. The primary TCL commands are:
1 COMMIT: The COMMIT command is used to permanently save the changes made during the current
transaction. Once a COMMIT is issued, all changes are made permanent and cannot be rolled back.
COMMIT;
2 ROLLBACK: The ROLLBACK command is used to undo changes made during the current transaction
and restore the database to its previous state. It cancels all the changes made since the last COMMIT or
SAVEPOINT.
ROLLBACK;
3 SAVEPOINT: The SAVEPOINT command is used to set a point within a transaction to which you can later roll
back if needed. It allows you to create intermediate savepoints within a transaction.
SAVEPOINT savepoint_name;
TCL commands are critical for maintaining data consistency and ensuring that a series of related SQL statements
are executed as a single, atomic operation. Transactions help protect data integrity and ensure that the database
remains in a consistent state even in the presence of errors or interruptions. The use of COMMIT and ROLLBACK
commands is essential for managing the success or failure of database operations within a transaction.
DQL(Data Query Language)
Data Query Language (DQL) is a subset of SQL (Structured Query Language) specifically designed for retrieving
and querying data from a relational database. DQL commands are used to interact with the data stored within
database tables, allowing users to retrieve, filter, and manipulate data to extract meaningful information. The
primary DQL command is:
SELECT: The SELECT command is the core of DQL and is used to retrieve data from one or more tables in a
database. It enables you to specify the columns you want to retrieve, apply filtering conditions, and sort the result
set.
SELECT column1, column2
FROM table_name
WHERE condition ORDER BY column1;
In addition to SELECT, DQL may involve using clauses like WHERE to filter data, JOIN to combine data from
multiple tables, GROUP BY for grouping data, HAVING for filtering grouped data, and more.
DQL is fundamental for extracting and presenting data in a structured and meaningful way, making it one of the
most commonly used components of SQL, especially for reporting and analysis purposes. It allows users to
interact with and retrieve data from a database, helping them make informed decisions based on the information
stored in the database.
74
CITS : IT&ITES - Computer software application - Lesson 18 - 36