SQL Concepts & Queries- Lab
SQL COMMANDS
DML (Data Manipulation Language)
• The DML commands in Structured Query
Language change the data present in the SQL
database.
• We can easily access, store, modify, update
and delete the existing records from the
database using DML commands.
DML (Data Definition Language)
• INSERT - Allows users to insert data in
database tables.
• UPDATE- Allows users to update or modify
the existing data in database tables.
• DELETE - Allows SQL users to remove
single or multiple existing records from the
database tables.
Update Command
• Syntax:
UPDATE table_name SET
[column_name1= value_1,
column_name2= value_2,...] WHERE
CONDITION;
Delete Command
• Syntax:
DELETE FROM table_Name WHERE
condition;
DCL (Data Control Language)
• DCL includes commands such as GRANT and
REVOKE.
• DCL mainly deal with the rights, permissions,
and other controls of the database system.
• GRANT: This command gives users access
privileges to the database.
• REVOKE: This command withdraws the
user’s access privileges given by using the
GRANT command.
TCL(Transaction Control Language)
• Transactions group a set of tasks into a single
execution unit.
• Each transaction begins with a specific task
and ends when all the tasks in the group
successfully complete.
• If any of the tasks fail, the transaction fails.
TCL(Transaction Control Language)
• Following TCL commands are used to control
the execution of a transaction.
• Commit: Commits a Transaction.
• Rollbacks: Rollbacks a transaction in
case of any error occurs.
• Save Point: Sets a save point within a
transaction.
Data Query Language (DQL)
• SELECT command used to extract data from a
database in order to perform actions on it.
Syntax:
SELECT expression FROM table_x
WHERE code_conditions;