Database language is the interface to communicate with the
database. It is used to create, read, update and store data in the database. There are three type of database language: 1. DDL (Data Definition Language) 2. DML (Data Manipulation Language) 3. DCL (Data Control Language) 1. DDL (Data Definition Language): DDL statements are used to define the database structure or schema. It is used to define the physical characteristics of records. It is a link between the logical and physical structure of database. DDL statements are always in the focus of DBA during designing of the database system. DDL Commands are: Create = to create objects in the database Alter = alter the structure of the database Drop = delete objects from the database Truncate = remove all records from a table, including all spaces allocated form the records are removed. Comment = add comments to the data dictionary Rename = rename an object Example: Create table student ( Roll_no int, Name varchar(30), Address varchar(50) ); 2. DML (Data Manipulation Language): DML statements are used for managing data within schema objects. DML is used to update the database by adding new data or modify or delete the existing data. It helps user to use query and display reports of the table. It includes commands to manipulate the information stored in the database. DML Commands are: Select = retrieve data from the database. Insert = insert data into a table. Update = Update existing data within a table. Delete = Delete all records from a table, the space for the records remain. Example: Insert into student values(101, “Hira”, “Kathmandu”); 3. DCL (Data Control Language): It is administrative language. DCL provides additional features for security of tables or database. DCL statements control access to data and the database using statement such as GRANT and REVOKE. DCL commands are: Grant = gives user’s access privileges to database Revoke = withdraw access privileges given with the grant command. Example:
GRANT COMMAND: GRANT all on Employee to ABC;
REVOKE COMMAND: REVOKE update on employee form ABC;