Database Languages
A database system includes a data-definition language for defining the database schema as well as a data-manipulation language for expressing database queries and modifications. In fact, data-definition and data-manipulation languages are not two distinct languages; rather, they are components of a single database language, such as the widely used SQL language.
Data-Manipulation Language (DML)
A data-manipulation language (DML) is a programming-related language that allows users to access and alter data that has been arranged according to the suitable data model.
Examples of DML SQL commands are
- Select
- Insert
- Delete
- Update
The types of access are
• Select: Retrieval of information stored in the database
• Insert: Insertion of new information into the database
• Delete: Deletion of information from the database
• Update: Modification of information stored in the database
DMLs are two types
• Procedural DMLs need the user to describe what data are required and how to obtain those data.
• Declarative DMLs (also known as nonprocedural DMLS) require the user to specify what data are required but not how to obtain those data.
Declarative DMLS are typically simpler to understand and apply than procedural DMLS. However, because a user does not have to define how to obtain the data, the database system must devise an efficient method of data access.
Query Language and How DML works on a database
A query is a statement that asks for information to be retrieved.
A query language is the part of a DML that deals with information retrieval. Although strictly erroneous, the phrases query language and data manipulation language are frequently used interchangeably. Several database query languages are in use, both commercially and experimentally. The abstraction layers apply not just to defining or organising data, but also to manipulating data. At the physical level, we must create algorithms that enable efficient data access. We stress usability at greater levels of abstraction. The objective is to make it possible for humans to engage with the system in an efficient manner. At the physical level of the database system, the query processor component transforms DML requests into sequences of operations.
Data-Definition Language (DDL)
A database schema is specified by a collection of definitions stated in a particular language known as a data definition language (DDL). The DDL is also used to declare extra data attributes.
Examples of DDL SQL commands are
- Create
- Drop
- Alter
- Truncate
The types of accessing the DDL
• Creating a structure to store the information in the database.
• Deleting the full information structure of a database.
• Modifying the structure of a database table.
• Deleting the full structure of a table permanently and freeing the space for the database.
How DDL works on database
DDL describes the storage structure and access mechanism utilized by the database system through a collection of statements in a subset of DDL commands known as data storage and definition language. DDL-related statements define the implementation specifics of database schemas that are often concealed from consumers. The data values recorded in the database must meet certain standards and follow certain regulations. For example, assume the university demands that a department's account balance never be negative. The DDL makes it possible to set such requirements on the database. Every time the database is changed, the database system verifies these conditions.