Intro to DBMS

Database Languages

  • Database languages are used to read, update, and store the data in the database.
  • A DBMS has its appropriate languages and interfaces to express database queries and updates

Types of Database Language

1. Data Definition Language (DDL)

DDL stands for Data Definition Language. It is used to create and update the schema in the database. It is used to update the database schema.

DDL performs the following tasks

  • Create: This command is used to create the structure of new objects in the database.
  • Alter: Alter command is used to change the structure of the database.
  • Drop: The drop command is used to delete objects from the database.
  • Truncate: Truncate command is used to remove all records from a table.
  • Rename: Rename command is used to rename an object.

2. Data Manipulation Language (DML)

DML stands for Data Manipulation Language. DML is used for retrieving/accessing, and manipulating data in a database. It handles user requests.

DML performs the following tasks

  • Select: This command is used to access the data from a database.
  • Insert: This command is used to insert data into a table.
  • Update: This command is used to update the database.
  • Delete: This command is used to remove all records from a database table.
  • Lock Table: This command controls concurrency.
  • Call: This command is used to call a structured query language or a Java subprogram.

3. Data Control Language (DCL)

DCL stands for Data Control Language. DCL is used to retrieve the saved data. The DCL execution is transactional. It also has rollback parameters.

DCL performs the following tasks

  • Grant: This command is used to give user access privileges to a database.
  • Revoke: This command is used to take back permissions from the user.

4. Transaction Control Language (TCL)

Transaction control language is used to update the changes made by the data manipulation (DML) statement.

TCL performs the following tasks

  • Commit: This command is used to save the committed transaction on the database.
  • Rollback: This command is used to restore the database to the original since the last Commit.