Database Languages

Database Languages:

  • 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.

  1. 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.

  1. Data Manipulation Language (DML):

  • Data Manipulation Language performs the following operations.

    1. Insert the Data

    2. Update the Data

    3. Delete the Data

    4. Retrieve the Data

    5. 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’.

    6. The DML commands in the SQL are INSERT, UPDATE, DELETE, SELECT.

  1. 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.

  1. 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:

    1. 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.       

    2. 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.

    3. 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.