Dbms 3
Dbms 3
Theory:
Data Manipulation Language (DML)
What is DML?
DML, or Data Manipulation Language, is a fundamental subset of SQL used to perform
operations on data within database tables. Unlike DDL (Data Definition Language), which
focuses on defining the structure of database objects, DML commands are used to insert, update,
delete, and retrieve data.
Key DML Operations:
INSERT: Adds new records to a table.
UPDATE: Modifies existing data within a table.
DELETE: Removes records from a table.
SELECT: Retrieves data from one or more tables (covered in a separate experiment).
DML Operations on Tables
1. Inserting Data:
The INSERT INTO command is used to add new rows (records) of data into a table.
Syntax:
INSERT INTO table_name (column1, column2, ...)
VALUES (value1, value2, ...);
Example:
INSERT INTO Students (StudentID, FirstName, LastName, GradeLevel)
VALUES (101, 'Alice', 'Smith', 10);
2. Updating Data:
The UPDATE command is used to modify existing data within a table.
Syntax:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
Example:
UPDATE Students
SET GradeLevel = 11
WHERE StudentID = 101;
3. Deleting Data:
The DELETE command is used to remove records from a table.
Syntax:
DELETE FROM table_name
WHERE condition;
Example:
DELETE FROM Students
WHERE GradeLevel = 12;
Code:
Conclusion:
This experiment has provided valuable insights into database management using Oracle.
Through the creation of a student database table and the execution of DML operations (INSERT,
UPDATE, DELETE, SELECT), you have gained practical experience in working with databases.