SQL DML Commands Presentation
SQL DML Commands Presentation
• 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?