Data Manipulation Language

DML is the abbreviation for “Data Manipulation Language”. And include the most common SQL commands such as SELECT, INSERT, UPDATE, DELETE etc for data manipulation. And the SQL commands are listed below with short descriptions:

Command Description
SELECT Command SELECT commands is used to retrieve or fetch certain data from one or more tables.
INSERT Command INSERT commands is used to create data into a table.
UPDATE Command UPDATE commands is used to modifies the existing data within a table.
DELETE Command DELETE commands is used to Delete all records from a database table.

1) MySQL INSERT Query/Command:

MySQL INSERT statement is a process of inserting single record or multiple records into a table in MySQL. Also It must have column(s) of the same type as that of the content you’d like to insert.
Syntax:Following are the SQL syntax of INSERT command to insert data into a MySQL table.

Insert data into Columns:

INSERT INTO table_name ( `column_name1`, `column_name2`,…`column_nameN` ) VALUES ( value1, value2,…valueN );

Parameters:

  • INSERT INTO `table_name`: This statement is the SQL keyword And for this keyword, database know that you want to add new row into a table named i.e `table_name`.
  • `column_name1`, `column_name2`,…`column_nameN` : insert one or more new row into the specific columns
  • value1, value2,…valueN added the new values into specifies rows.

2) MySQL UPDATE Query/Command:

MySQL UPDATE statement is a process of update existing records of a single row, a group of rows, or all rows in a table in a MySQL database. MySQL UPDATE statement is use WHERE clause to update selected rows, otherwise all the rows would be affected.
Syntax:Following are the SQL syntax of UPDATE command to update existing records in a MySQL table. UPDATE query with WHERE clause is as follows:

UPDATE table_name SET column1 = value1, column2 = value2…., columnN = valueN
WHERE [condition];

3) MySQL DELETE Query/Command:

MySQL DELETE query is used to delete the existing records from a table, User can delete one or multiple records at a time.
Syntax:Following are the SQL syntax of DELETE command to delete data into a MySQL table

a) DELETE data into Columns with WHERE clause is as follows.

DELETE FROM table_name WHERE [condition];

b) DELETE all the records from table, you do not need to use WHERE clause and DELETE query would be as follows:

DELETE FROM table_name;

4) MySQL SELECT Query/Command:

Select is the most frequently used statement in MySQL . The SELECT Statement in MySQL is used to retrieve or fetch data from one or more table. We can fetch either the entire table or column which is according to some specified rules.
Syntax:Following are the SQL syntax of SELECT command to fetch data from the MySQL table

a) Retrieving Individual Columns:

SELECT `column_names` FROM table_name

Description : Retrieving or fetching individual and more columns from table.

b) Retrieving All Columns:

SELECT * FROM table_name

Description :Retrieving or fetching individual and more columns from table.

Parameters:

  • SELECT: SELECT is the SQL keyword And for this keyword, database know that you want to retrieve data.
  • * : selected all the fields from the specified table name.
  • column_names: selected one or more fields from the specified table name.
  • FROM table_name : From table_name is mandatory and must contain at least one table or multiple tables must be separated using joined using the JOIN keyword.