Database Languages – DML (Data Manipulation Language) with Oracle Examples

Database Languages – DML (Data Manipulation Language)

Includes Oracle SQL examples for INSERT, UPDATE, DELETE, and SELECT operations.

DML is a set of SQL commands used to manipulate data stored in the database. Unlike DDL, which defines structure, DML operates on the data inside tables.

1. What is DML?

  • Allows adding, updating, deleting, and retrieving data.
  • Changes are transactional and can be rolled back.
  • Requires proper privileges: INSERT, UPDATE, DELETE, SELECT.

2. Common DML Commands

CommandPurposeOracle Example
INSERTAdd new rows
INSERT INTO student VALUES (101, 'Ahsan', 'DBMS');
UPDATEModify existing rows
UPDATE student SET course='AI' WHERE student_id=101;
DELETERemove rows
DELETE FROM student WHERE student_id=101;
SELECTRetrieve data
SELECT * FROM student;

3. Oracle Examples in Detail

INSERT Example

INSERT INTO employee (emp_id, emp_name, dept_id)
VALUES (101, 'Ahsan', 10);

UPDATE Example

UPDATE employee
SET emp_name = 'Ahsan Arif', dept_id = 20
WHERE emp_id = 101;

DELETE Example

DELETE FROM employee
WHERE emp_id = 101;

SELECT Example

SELECT emp_id, emp_name, dept_id
FROM employee
WHERE dept_id = 20;

4. Key Points

  • DML commands manipulate data only, not structure.
  • Changes can be committed or rolled back.
  • Proper privileges are required for all operations.

5. Summary

DML (Data Manipulation Language) is essential for working with table data. Commands include INSERT, UPDATE, DELETE, SELECT. Supports transactions to ensure data integrity.

DML, Data Manipulation Language, Oracle SQL, INSERT, UPDATE, DELETE, SELECT, DBMS tutorial, database data manipulation

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন