DML Overview
DML Overview
(DML)
Unit Three Summary
Overview of DML
• - DML deals with data operations (insert,
update, delete).
• - Commands range from simple to complex.
• - Key focus: manipulating database content.
Data Insertion
• - INSERT INTO: Add new rows to a table.
• - Syntax:
• INSERT INTO table_name (columns) VALUES
(values);
• - Example:
• INSERT INTO Customers (ID, Name) VALUES
(1, 'John');
Data Modification
• - UPDATE: Modify existing records.
• - Syntax:
• UPDATE table_name SET column = value
WHERE condition;
• - Example:
• UPDATE Customers SET Address = 'Pune'
WHERE ID = 1;
Data Deletion
• - DELETE: Remove records from a table.
• - Syntax:
• DELETE FROM table_name WHERE condition;
• - Example:
• DELETE FROM Customers WHERE ID = 1;
Practical Examples
• - Insert data into Student, Course, and
Grade_report tables.
• - Update birthdate for Electrical department
students:
• UPDATE Student SET BirthDate = '1984-06-04'
WHERE DeptName = 'Electrical';
Lab Task
• - Create a database: AB_Supermarket.
• - Design and populate Customers and
Customer_order tables.