A database system provides a data definition language to specify the database schema and a data manipulation language to express database queries and updates. In practice, the data definition and data manipulation languages are not two separate languages; instead they simply form parts of a single database language, such as the widely used SQL language.
Data Definition Language (DDL):
A database schema is specified by a set of definitions expressed by a special language called ‘DDL’. The result of compilation of ‘DDL’ statements is a set of tables that is stored in a special file called ‘Data Dictionary’. Data dictionary contains metadata (i.e., data about data). And it is the Database Schema. DDL allows us to specify the storage and access methods using a special language called data storage and definition language.
The DDL commands in the SQL are CREATE, DROP, ALTER, DESC, RENAME.
Data Manipulation Language (DML):
Data Manipulation Language performs the following operations.
Insert the Data
Update the Data
Delete the Data
Retrieve the Data
A language, which enables the users to access data. A ‘Query’ is a statement to retrieve information. The query is executed by query language, which is the part of ‘DML’.
The DML commands in the SQL are INSERT, UPDATE, DELETE, SELECT.
Data Control Language (DCL):
A language, which authenticates users to access data by others. It describes that Control over the Database. It used to give the Permissions to the Users of the Database. In SQL We have the commands like GRANT and REVOKE.
Database Access from Application Programs:
Application programs are programs that are used to interact with the database. Application programs are usually written in a host language, such as Cobol, C, C++, or Java. Examples in a banking system are programs that generate payroll checks, debit accounts, credit accounts, or transfer funds between accounts.
To access the databasae, DML statements need to be executed from the host language.
There are two ways to do this:
By providing an application program interface (set of procedures) that can be used to send DML and DDL statements to the database, and retrieve the results.
The Open Database Connectivity (ODBC) standard defined by Microsoft for use with the C language is a commonly used application program interface standard. The Java Database Connectivity (JDBC) standard provides corresponding features to the Java language.
By extending the host language syntax to embed DML calls within the host language program. Usually, a special character prefaces DML calls, and a preprocessor, called the DML precompiler, converts the DML statements to normal procedure calls in the host language.