1. Data Definition Languages (DDL):
* Purpose: To define the structure of the database, including tables, columns, data types, relationships, and constraints.
* Examples:
* CREATE TABLE: Defines a new table.
* ALTER TABLE: Modifies an existing table.
* DROP TABLE: Deletes a table.
* CREATE INDEX: Creates an index for faster data retrieval.
* CREATE VIEW: Creates a virtual table based on a query.
2. Data Manipulation Languages (DML):
* Purpose: To manipulate (insert, update, delete, retrieve) data within the database.
* Examples:
* INSERT: Adds new data into a table.
* UPDATE: Modifies existing data in a table.
* DELETE: Removes data from a table.
* SELECT: Retrieves data from the database.
3. Data Control Languages (DCL):
* Purpose: To control access and permissions to the database.
* Examples:
* GRANT: Gives permissions to users.
* REVOKE: Removes permissions from users.
4. Transaction Control Languages (TCL):
* Purpose: To manage transactions, ensuring data consistency and integrity.
* Examples:
* COMMIT: Saves changes to the database permanently.
* ROLLBACK: Reverts changes made in a transaction.
* SAVEPOINT: Creates a marker in a transaction to allow partial rollback.
5. Query Languages:
* Purpose: To retrieve and manipulate data from the database.
* Examples:
* SQL (Structured Query Language): The most common query language, providing a powerful way to interact with databases.
Other Important Languages:
* Procedural Languages: Extend the capabilities of SQL by allowing for more complex operations and program logic. (e.g., PL/SQL for Oracle, T-SQL for SQL Server)
* Database-Specific Languages: Some databases have specialized languages for specific functions (e.g., NoSQL databases might have their own query languages).
Key Points:
* Most database systems use a combination of these languages.
* SQL is the core language for most relational databases, but there are other languages that work alongside it.
* The specific language used depends on the database system.
Let me know if you want to dive deeper into any specific category or language!