01-02-2013, 03:18 PM
DATA MANIPULATION LANGUAGE (DML) COMMANDS
DATA MANIPULATION.docx (Size: 27.5 KB / Downloads: 25)
AIM:
To study DML and DCL commands in RDBMS.
DML COMMANDS:
INSERT
UPDATE
DELETE
SELECT
QUERY:
Query is a statement in the DML that request the retrieval of data from database.
The portion of the DML used in a Query is called Query language. The SELECT statement is used to query a database
SYNTAX OF COMMANDS
INSERT:
Values can be inserted into table using insert commands. There are two types of insert commands. They are multiple value insert commands (using ‘&’ symbol) single value insert command (without using ‘&’symbol)
DELETE:
This allows you to delete the particular column values using where clause condition.
The select statement is used to query a database .This statement is used to retrieve the information from the database. The SELECT statement can be used in many ways. They are:
1. Selecting some columns :
To select specified number of columns from the table the
Following command is used.
Syntax:
SELECT column name FROM table_name;
2. Query All Columns:
To select all columns from the table * is used instead of column names.
Syntax:
SELECT * FROM table_name;
3. Select using DISTINCT:
The DISTINCT keyword is used to return only different values (i.e. ) this command does not select the duplicate values from the table .
Syntax:
SELECT DISTINCT column name(s) FROM table_name;
4. Select using IN:
If you want to get the rows which contain certain values, the best way to do it is to use the IN conditional expression.
To Select NULL values:
We can use the SELECT statement to select the ‘null’ values also.
For retrieving roes where some of the columns have been defined as NULLs there is a special comparison operator of the form IS [NOT] NULL.
RESULT:
Thus DML commands were studied and executed in RDBMS