Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Types of SQL Commands.

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarKiran Dalvi
  • 22 Jan, 2024
  • 0 Comments
  • 1 Min Read

Types of SQL Commands.

In the realm of relational databases, SQL (Structured Query Language) serves as the fundamental tool for interacting with and managing data. SQL commands are broadly categorized into Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), Transaction Control Language (TCL), and Data Query Language (DQL), each serving distinct purposes.

1. Data Definition Language (DDL)

  • CREATE: Used to create database objects like tables, views, or indexes.
  • ALTER: Modifies the structure of existing database objects.
  • DROP: Deletes database objects, such as tables or views.
  • TRUNCATE: Removes all records from a table but retains the table structure.

2. Data Manipulation Language (DML)

  • SELECT: Retrieves data from one or more tables.
  • INSERT: Adds new records into a table.
  • UPDATE: Modifies existing records in a table.
  • DELETE: Removes records from a table.

3. Data Control Language (DCL)

  • GRANT: Provides specific privileges to database users.
  • REVOKE: Withdraws previously granted privileges.

4. Transaction Control Language (TCL)

  • COMMIT: Finalizes a transaction, making all changes permanent.
  • ROLLBACK: Reverts the database to its state before the beginning of a transaction.
  • SAVEPOINT: Sets points within transactions to which you can later roll back.

5. Data Query Language (DQL)

  • SELECT: Primarily used for querying the database to retrieve specific information.

Understanding and mastering these SQL command categories are essential for effective database management and manipulation. DDL commands shape the database structure, DML commands handle data modification, DCL commands manage access and permissions, TCL commands ensure transaction integrity, and DQL commands facilitate data retrieval. Whether you’re a database administrator, developer, or analyst, proficiency in these SQL command types is crucial for efficient and accurate data management.