> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/database/sql-databases/sql-fundamentals/sql-commands.md).

# SQL Commands

SQL (Structured Query Language) is a powerful language for interacting with relational databases. It allows us to create, manipulate, and retrieve data stored in tables.

SQL commands are grouped into different categories based on their functionality:

<figure><img src="/files/fImpnq7Qu0a00yQYqUOr" alt=""><figcaption></figcaption></figure>

### **Data Definition Language (DDL):**

Used to define the structure of the database, including creating, modifying, and deleting tables and other database objects.

### **Data Manipulation Language (DML):**

Used to manage and modify data within the database. This includes inserting new data, updating existing data, and deleting unwanted data.

### **Data Control Language (DCL):**

Used to control access privileges and permissions for users within the database. This ensures data security and controls who can access and modify data.

### **Transaction Control Language (TCL):**

Manages database transactions, which are a series of database operations treated as a single unit. TCL ensures data consistency and integrity by controlling how changes are committed or rolled back.

### **Data Query Language (DQL):**

Used to retrieve data from the database based on specific criteria. DQL is the foundation for querying relational databases and allows you to filter, sort, and aggregate data for analysis or reporting purposes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/database/sql-databases/sql-fundamentals/sql-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
