0% found this document useful (0 votes)
19 views11 pages

SQL DML Commands Presentation

Sql presentation

Uploaded by

Kesar Bhandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views11 pages

SQL DML Commands Presentation

Sql presentation

Uploaded by

Kesar Bhandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

SQL DML Commands

Understanding Data Manipulation in


SQL
Kesar
Introduction to SQL DML
• • What is DML?
• • DML stands for Data Manipulation
Language.
• • Purpose: Used to insert, update, delete, and
retrieve data in a database.
Key DML Commands
• • INSERT: Adds new records to a table.
• • UPDATE: Modifies existing records in a table.
• • DELETE: Removes records from a table.
• • SELECT: Retrieves data from one or more
tables.
INSERT Command
• Syntax:
• INSERT INTO table_name (column1,
column2, ...)
• VALUES (value1, value2, ...);

• Example:
• INSERT INTO Employees (EmployeeID,
FirstName, LastName)
• VALUES (1, 'John', 'Doe');
UPDATE Command
• Syntax:
• UPDATE table_name
• SET column1 = value1, column2 = value2, ...
• WHERE condition;

• Example:
• UPDATE Employees
• SET LastName = 'Smith'
• WHERE EmployeeID = 1;
DELETE Command
• Syntax:
• DELETE FROM table_name
• WHERE condition;

• Example:
• DELETE FROM Employees
• WHERE EmployeeID = 1;
SELECT Command
• Syntax:
• SELECT column1, column2, ...
• FROM table_name
• WHERE condition;

• Example:
• SELECT FirstName, LastName
• FROM Employees
• WHERE EmployeeID = 1;
Practical Examples
• • Multiple Commands in Action:
• - Insert multiple records.
• - Update a specific record.
• - Delete a record.
• - Select specific data with conditions.
Best Practices
• • Use WHERE Clause: Always use a WHERE
clause with UPDATE and DELETE to avoid
unintended data changes.
• • Test Before Executing: Test your queries with
SELECT before applying UPDATE or DELETE.
Conclusion
• • Summary: Recap of the key DML commands
and their uses.
• • Next Steps: Hands-on practice with sample
databases.
Q&A
• Any questions or doubts?

You might also like