SQL Commands, explained
❯ DDL
❯ DML
❯ DQL
❯ DCL
❯ TCL
⇩
❯ DDL
❯ DML
❯ DQL
❯ DCL
❯ TCL
⇩
This is part of this series. Other topics will be covered in later threads.
🄌 Introduction to SQL
⬘ SQL stands for Structured Query Language.
⬗ SQL is a computer language for storing, manipulating, and retrieving data in a relational database.
⬙ SQL provides useful commands for performing these operations.
These commands are put into 5 categories
⬘ SQL stands for Structured Query Language.
⬗ SQL is a computer language for storing, manipulating, and retrieving data in a relational database.
⬙ SQL provides useful commands for performing these operations.
These commands are put into 5 categories
➊ DDL
DDL ➟ Data Definition Language
❯ DDL commands are used to define the database schema.
❯ DDL is a set of SQL commands that are used to create, modify, and delete database structures but not data.
DDL ➟ Data Definition Language
❯ DDL commands are used to define the database schema.
❯ DDL is a set of SQL commands that are used to create, modify, and delete database structures but not data.
⬙ List of DDL Commands
❯ CREATE
Used to create the database or its objects (like Table, Views, Stored Procedures, Index, etc.)
❯ DROP
Used to delete objects from the database.
❯ ALTER
Used to alter the structure of the database.
❯ CREATE
Used to create the database or its objects (like Table, Views, Stored Procedures, Index, etc.)
❯ DROP
Used to delete objects from the database.
❯ ALTER
Used to alter the structure of the database.
❯ TRUNCATE
Used to remove all records from a table, including all spaces allocated for the records.
❯ RENAME
Used to rename an object already existing in the database.
❯ COMMENT
Used to add comments to the data dictionary.
Used to remove all records from a table, including all spaces allocated for the records.
❯ RENAME
Used to rename an object already existing in the database.
❯ COMMENT
Used to add comments to the data dictionary.
➋ DML
DML ➟ Data Manipulation Language
⬘ DML commands are used to manipulate the data present in the database.
⬙ List of DML Commands
❯ INSERT
Used to insert data into a table.
❯ UPDATE
Used to update existing data within a table.
DML ➟ Data Manipulation Language
⬘ DML commands are used to manipulate the data present in the database.
⬙ List of DML Commands
❯ INSERT
Used to insert data into a table.
❯ UPDATE
Used to update existing data within a table.
❯ DELETE
Used to delete records from a database table.
❯ LOCK
Used to control the concurrency on a table.
❯ CALL
Used to call a PL/SQL code.
❯ EXPLAIN PLAN
To describe the access path to data.
Used to delete records from a database table.
❯ LOCK
Used to control the concurrency on a table.
❯ CALL
Used to call a PL/SQL code.
❯ EXPLAIN PLAN
To describe the access path to data.
➌ DQL
DQL ➟ Data Query Language
⬘ DQL commands are used for performing queries on the data within schema objects.
⬙ List of DQL Commands
❯ SELECT
Used to retrieve data from the database.
DQL ➟ Data Query Language
⬘ DQL commands are used for performing queries on the data within schema objects.
⬙ List of DQL Commands
❯ SELECT
Used to retrieve data from the database.
➍ DCL
DCL ➟ Data Control Language
⬘ DCL commands mainly deal with the rights, permissions, and other controls of the database system.
⬙ List of DCL Commands
❯ GRANT
To give users access privileges to the database.
❯ REVOKE
To withdraw the user’s access privileges.
DCL ➟ Data Control Language
⬘ DCL commands mainly deal with the rights, permissions, and other controls of the database system.
⬙ List of DCL Commands
❯ GRANT
To give users access privileges to the database.
❯ REVOKE
To withdraw the user’s access privileges.
➎ TCL
TCL ➟ Transaction Control Language
⬘ TCL commands deal with the transaction within the database.
TCL ➟ Transaction Control Language
⬘ TCL commands deal with the transaction within the database.
⬙ List of TCL Commands
❯ COMMIT
Used to commit a transaction.
❯ ROLLBACK
Used to rollback a transaction in case of any error occurs.
❯ SAVEPOINT
Used to set a savepoint within a transaction.
❯ SET TRANSACTION
Used to specify characteristics for the transaction.
❯ COMMIT
Used to commit a transaction.
❯ ROLLBACK
Used to rollback a transaction in case of any error occurs.
❯ SAVEPOINT
Used to set a savepoint within a transaction.
❯ SET TRANSACTION
Used to specify characteristics for the transaction.
🏁 Final Words
⬘ We saw how SQL uses certain commands to carry out the required task.
⬙ We categorized all commands into 5 categories.
Let's summarize all these in a diagram.
⬘ We saw how SQL uses certain commands to carry out the required task.
⬙ We categorized all commands into 5 categories.
Let's summarize all these in a diagram.
Hey 👋
I am a Tech Writer and Educator from 🇮🇳, sharing
❯ Tutorials
❯ Career Tips
❯ Practice Questions
❯ Roadmaps
on
➠ Web Dev
HTML/CSS, JavaScript, Python
➠ DSA
➠ Databases (SQL, NoSQL)
Is this tutorial useful? Share your feedback.
I am a Tech Writer and Educator from 🇮🇳, sharing
❯ Tutorials
❯ Career Tips
❯ Practice Questions
❯ Roadmaps
on
➠ Web Dev
HTML/CSS, JavaScript, Python
➠ DSA
➠ Databases (SQL, NoSQL)
Is this tutorial useful? Share your feedback.
جاري تحميل الاقتراحات...