Introduction
A DBMS (database management system) provides necessary database languages that allow users to express database updates, queries, and requests for data. There are various database languages to choose from, including SQL, the standard programming language for many databases. Database languages are divided into four sublanguages that perform different tasks.
In this blog, we will learn about the concept of Database Languages
So, let's begin!
Also See, Schema in DBMS and Checkpoint in DBMS
Types of Database languages in DBMS
The four types of Database languages and their uses are discussed below.
- Data Definition Language (DDL)
- Data Manupulation Lanugage (DML)
- Data Control Language (DCL)
-
Transaction Control Language(TCL)
Types of Database Languages
Source: https://hackr.io/blog/dbms-interview-questions
Also See, Multiple Granularity in DBMS And Recursive Relationship in DBMS
Data Definition Language (DDL)
The database schema is defined using DDL. It's used to create tables, schemas, indexes, constraints, and other things, in a database.
Some of the DDL commands are:
-
CREATE: It is used to create the object in the database instance
-
ALTER: It is used to alter the structure of the database
-
DROP: It is used to delete an object from the To drop database instances
-
TRUNCATE: It is used to remove all data from tables in a database instance
-
RENAME: It is used to rename an object from database instances
- Comment: To Comment
Data manipulation language (DML)
Data manipulation language (DML) is a programming language that handles user requests and allows users to access and modify the data stored in databases. Some of its most typical functions are inserting, updating, and retrieving data from a database.
The following is a list of DML statements:
-
INSERT: Adds new data to a database table that already exists.
-
UPDATE: Changes or updated values in the table
-
DELETE: It is used to remove rows or records from a table.
-
SELECT: .It is used to retrieve data from a table or multiple tables in the database.
-
Merge: Combines records from two tables based on a specified condition.
-
Call: Executes a stored procedure or function in a database.
-
Explain Plan: Displays the execution plan for a SQL query.
- Lock Table: Restricts access to a table to prevent concurrent data modifications.
Data control language (DCL)
DCL (data control language) is a programming language that controls who has access to the data that users store in a database. Essentially, this language manages the database system's rights and permissions. It allows users to grant or revoke database privileges. The following is a list of DCL statements:
GRANT: This allows a user to access the database.
REVOKE: Removes a user's access to the database
Transaction Control Language(TCL)
TCL is used to perform or roll back the modifications we made to the database using DML commands.
COMMIT: It is used to keep the database's modifications made by DML commands.
ROLLBACK: It is used to restore the modifications made to the database.
Check out this article - File System Vs DBMS