Database Languages
Two types of
languages are there:
1. Data – Definition Language (DDL)
2. Data – Manipulation Language (DML)
1. Data – Definition Language (DDL)
A Data – Definition Language specifies the database schema by set of definitions. For example,
create table customer
(cust_name char(20), cust_number integer, cust_address char(50), cust_city char(20), cust_pincode integer)
The implementation details of the database schema, which are hidden from the users, are defined by the data storage and definition language statements.
2. Data – Manipulation Language (DML)
The Data – Manipulation Language expresses database queries and updates. It allows users to access or manipulate data using data models. Data manipulation performs four operations on the data stored in the database.
- Retrieval of information from database (Read)
- Inserting new information in the database (Write)
- Deleting an existing information from database (Delete)
- Modifying information in the database (Update/Modify)
There are two types
of Data – Manipulation Languages (DML):
- Procedural DMLs: Requires users to specify what data is needed and how to access those data.
- Declarative DMLs or Non – procedural DMLs: Requires user to specify what data is needed without specifying how to access those data.
A query language is used to
retrieve information from the database using a query statement.
For example,
select customer.cust_name from customer where customer.customer_id = 459
The
above query specifies those rows from the customer table where customer_id
= 459 and customer_name must be displayed. If query was executed on the
table specified in Figure – 2 of Data models topic, the name Venkat
would have been displayed.
For example,
select account.balance from depositor, account
where
depositor.customer_id = 459 and depositor.account_number =
account.account_number
The above query would display the result as Venkat
and 60000, if it was executed on the table from Figure – 2 of the Data
models topic.
Comments
Post a Comment