DML (Data Manipulation Language) Queries

DML (Data Manipulation Language) Queries

Data Manipulation Language (DML) is a family of computer languages including commands permitting users to manipulate data in a database. This manipulation involves inserting data into database tables, retrieving existing data, deleting data from existing tables and modifying existing data. DML is mostly incorporated in SQL databases.

 

  1. In this type command you can work with the data.
  2. Using these types of queries you create new records/data, modify existing data, delete the data, get/retrieve the data.
  3. This is also known as CURD (Create Update Retrieve Delete)
  4. There are different type of queries
    1. Insert: You can create or add new data into the table
    2. Update: Can update/modify existing data
    3. Delete: Can delete the records
    4. Select: can get the records
  5. Insert Query

    1. SyntaxINSERT INTO <tableName>(Column1, Column2,….) VALUES(val1, val2, val3,…);
      1. Example:

      INSERT INTO employee(id, name, contact, salary, gender, isActive, doj) VALUES(1,’A’,’9988778787′,3124534.43,’M’,true,’2022-01-12′);

       

      INSERT INTO employee VALUES(3,’C’,’9943124432′,1124534.43,’F’,true,’2022-03-12′);

       

      In the above syntax column name is not provided, it is optional only in the case where the sequence and the values for all columns are provided.

       

       

      INSERT INTO employee VALUES(6,’F’,’8923224432′,1824534.43,’M’,true,’2002-05-10′),

      (7,’G’,’7713224432′,2824534.43,’F’,false,’2012-01-22′),

      (8,’H’,’6723224432′,1224534.43,’M’,true,’2017-02-11′);

       

      You can insert multiple records a t a time using this syntax.

  6.  Select Query

    1. This query is use to get the data store into the database.
    2. Select query can be use with clauses, operators, function(Date, String, arithmetic function), Joins.
    3. Syntax:Select column1, column2, column3,… from <TableName>

      Select * from <TableName>

       

  7. Update Query

    1. Using update query you can update the data from existing row.
    2. You can update multiple rows or single rows at a time
    3. Syntax:UPDATE <tableName> SET column=value;

      UPDATE <tableName> SET column=value where condition

  8. Delete Query

    1. Using delete query you can delete a specific record or all the records.
    2. Syntax:DELETE FROM <TABLENAME>;

      DELETE FROM <TABLENAME> WHERE  condition;

      1. Example:

      DELETE FROM employee WHERE id = 2;

 

Join Telegram : Click Here

 

All Full Stack Java Study Material

 

Structured Query Language

 

Job’s For Fresher

 

Share This Information To Your Friends and Your College Group’s, To Help Them !