0% found this document useful (0 votes)
3 views2 pages

Program 2

The document explains the implementation of DML (Data Manipulation Language) commands in SQL, specifically focusing on INSERT, UPDATE, and DELETE commands. It provides syntax examples for each command using a 'Student' table, demonstrating how to add, modify, and remove records. A summary table is also included to outline the purpose and examples of each command.

Uploaded by

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

Program 2

The document explains the implementation of DML (Data Manipulation Language) commands in SQL, specifically focusing on INSERT, UPDATE, and DELETE commands. It provides syntax examples for each command using a 'Student' table, demonstrating how to add, modify, and remove records. A summary table is also included to outline the purpose and examples of each command.

Uploaded by

danishprakash576
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Implementation of DML Commands in SQL

DML (Data Manipulation Language) commands are used to insert, modify, and delete data in
database tables.
Assume the following table already exists:

CREATE TABLE Student (


Student_ID INT PRIMARY KEY,
Name VARCHAR(50),
Age INT,
Course VARCHAR(30)
);
1. INSERT Command
The INSERT command is used to add new records into a table.
Syntax

INSERT INTO table_name (column1, INSERT INTO Student (Student_ID, Name,


column2, ...) Age, Course)
VALUES (value1, value2, ...); VALUES (101, 'Arun', 20, '[Link] IT');

INSERT INTO Student (Student_ID, Name,


Age, Course)
VALUES (102, 'Priya', 19, 'BCA');

Student_ID Name Age Course

101 Arun 20 [Link] IT

102 Priya 19 BCA

2. UPDATE Command
The UPDATE command is used to modify existing records in a table.
Syntax

UPDATE table_name UPDATE Student


SET column_name = value SET Course = '[Link] Computer Science'
WHERE condition; WHERE Student_ID = 101;

Student_ID Name Age Course

101 Arun 20 [Link] Computer Science

102 Priya 19 BCA

3. DELETE Command
The DELETE command is used to remove records from a table.
Syntax

DELETE FROM table_name DELETE FROM Student


WHERE condition; WHERE Student_ID = 102;

Student_ID Name Age Course

101 Arun 20 [Link] Computer Science

Summary Table

Command Purpose Example

INSERT INTO Student VALUES


INSERT Adds new records into a table
(101,'Arun',20,'[Link] IT');

UPDATE Student SET Course='[Link]


UPDATE Modifies existing records
Computer Science' WHERE Student_ID=101;

DELETE FROM Student WHERE


DELETE Removes records from a table
Student_ID=102;

You might also like