DML Statements in SQL

 DML Statements in SQL
Okunuyor DML Statements in SQL

Hello for everyone, the lesson is about the DML Statements in SQL, I hope this lesson useful for you.

DML

DML stands for Data Manipulation Language. These statements are used for adding, modifying or removing data from the database.

  • DML STATEMENTS:
    • 1. INSERT
    • 2. UPDATE
    • 3. DELETE

INSERT

The INSERT statement is used to insert new records in a table.

There are two ways to write INSERT statement as shown below:

INSERT INTO table _name (column1, column2, ...) VALUES (value1, value2, ...)

INSERT INTO table_nameVALUES (value1, value2, value3, ...)

UPDATE

The UPDATE statement is used to modify the existing records in a table

UPDATE table_name
SET column1 = value1, column2 = value2, ... 
WHERE condition;

Use this carefully and always with a WHERE clause.

If there is no WHERE clause it will update all the rows of the specified table.

DELETE

The DELETE statement is used to delete existing records in a table.

DELETE FROM table_name
WHERE condition;

Use this carefully and always with a WHERE clause.

If there is no WHERE clause it will delete all the rows from specified table.

SELECT

The SELECT statement is used to select data from a database.

SELECT is DQL Statement (Data Query Language). It is the only DQL statemetn. Hence we covered it in this post itself.

SELECT column1, column2 
FROM table_name;

Or

SELECT * FROM table_name;

RECAP

In this lesson, you have learned DML Statements in SQL along with one DQL Statement.

The below I put the mention Soruce of instagram page, you can visit the instagram page. Thank you for reading.

Source: https://www.instagram.com/dotnetcrunch/

Yapılan Yorumlar

Bir Cevap Yazın

This site uses Akismet to reduce spam. Learn how your comment data is processed.