result management system report for college project
SQL Queries - DML Commands
1. Program No. # 02
Object :- Write SQL Queries for DML (Data Manipulation Language) Statement.
DML Commands:-
INSERT Query
SELECT Query
UPDATE Query
DELETE Query
1. INSERT Command:- INSERT command is used to insert data into a table.
Following is the syntax:-
Example:-
COMMIT is a transactional control key word that saves the entered data.
2. SELECT Command:- SELECT statement is used to retrieve data from one or
more objects within a database.
INSERT INTO table_name VALUES (data_1, data_2,….data_n);
INSERT INTO STUDENT VALUES (9002, Monish , 23)
INSERT INTO STUDENT VALUES (9003, Shubham, 19);
INSERT INTO STUDENT VALUES (9004, Shubham Kumar, 19);
INSERT INTO STUDENT VALUES (9005, Sumit Kumar, 21);
COMMIT;
2. Following is the syntax:-
Example:-
3. UPDATE Command:- UPDATE command is used to update any record of data
in a table.
Following is the Syntax:-
Example:-
4. DELETE Command:- DELETE command is used to delete data from a table.
Following is the syntax:-
Delete all Records from table:-
SELECT column_name FROM table_name ;
SELECT AGE FROM STUDENT ;
UPDATE table_name SET column_name = ‘Input_Value’
WHERE condition ;
UPDATE STUDENT SET AGE = 21
WHERE Roll_No. = 9005 ;
DELETE FROM table_name ;
3. Example:-
Delete a particular Record From Table:-
Syntax:-
Example:-
DELETE FROM Student ;
DELETE FROM table_name WHERE Condition ;
DELETE FROM STUDENT WHERE Roll_No = 9002;