Data Manipulation Language
Data Manipulation Language
Command Description
1. SELECT
SELECT command or statement in SQL is used to fetch
data records from the database table and present it in
the form of a result set. It is usually considered as a
DQL command but it can also be considered as DML.
The basic syntax for writing a SELECT query in SQL is as
follows :
SELECT column_name1, column_name2, …
FROM table_name
WHERE condition_ expression;
The parameters used in the above syntax are as
follows:
column_name1, column_name2, … : Specify the
column_names which have to be fetched or
selected for the final result set.
table_name: Specify the name of the database
table from which these results have to be fetched.
DML COMMAND INFORMATION WITH EXAMPLES AND SYNTAX
2. INSERT
INSERT commands in SQL are used to insert data
records or rows in a database table. In an INSERT
statement, we specify both the column_names for
which the entry has to be made along with the data
value that has to be inserted.
The basic syntax for writing INSERT statements in SQL
is as follows :
DML COMMAND INFORMATION WITH EXAMPLES AND SYNTAX
DELETE
Delete command is used to delete records from a
database table.
The syntax for the delete command is as follows -
Syntax
Delete from <table_name>WHERE condition;
For example, if we want to delete an entire row of
employee id 002, we can use the following command −
Example
DELETE from Employee WHERE Emp_id=002;
UPDATE
Update command is used to update existing data
within a table.
The syntax for the update command is as follows -
Syntax
UPDATE <table_name> SET column_number
=value_number WHERE condition;
For example, if we want to update the name of the
employee having the employee id 001, we can use the
command given below −
DML COMMAND INFORMATION WITH EXAMPLES AND SYNTAX
Example
UPDATE Employee SET Emp_name= Ram WHERE
Emp_id= 001;