Different types of database languages
Data-definition Languages(DDL): A database schema is specified by a set of definitions expressed by a special language (DDL). The result of compilation of DDL statements is a set of tables that is stored in a special file called data dictionary or data directory.
A data dictionary is a file that contains metadata, that is data about data. This file is consulted before actual data are read or modified in the database system.
The storage structure and access methods used by the database system are specified by a set of definitions in a special type of DDL called as data storage and definition language. The result of compilation of these definitions is a set of instruction to specify the implementation details of the database schemas-Details are usually hidden from the user. Create table command is used for creation of the table. Suppose we wish to create table account having columns account_no, branch, and amount, then we have to write the following query;
create table account
(account_no number,
branch varchar2(50),
account number);
In this example, table account is created on which various modification operations can be performed.
Data manipulation language (DML): By data manipulation, we mean
1.The retrieval of information stored in the database
2.The insertion of new information into the database
3.Deletion of information from the database.
4.The modification of information stored in the database.
At the physical level, we must define algorithms that allow efficient access to data. At higher levels of abstraction, we emphasize ease of use. The goal is to provideefficient human interaction system.
A data manipulation language (DML) is a language that enables users to access or manipulate data organised by the appropriate data model. There are basically two types:
a) Procedural DMLs requires a user to specify what data are needed and how to get those data.
b)Non procedural DMLs Require a user to specify what data are needed without specifying how to get those data.
Non procedural DMLs are usually easier to learn and use than are procedural DMls. However since a user does not have to specify, how to get those data, these languages may generate code that may not be as that efficient as that produced by procedural languages.
For example: The simplest insert statement is a request to insert one tuple.
Suppose that we wish to insert the fact that there is an account A-9732 at a perryridge branch and that it has a balance of $1200. The query is
insert into account
values("A-9732", "Perryridge", 1200)
In this example, the values are specified in the order in which the corresponding attributes are listed in the relation schema.