DML Commands Documentation
DML Commands Documentation
Title:
Demonstrate the data manipulation commands in SQL with the following table.
Procedure:
Step-1:
Create the student table using create command with the above requirements.
SQL> create table student (sno number (3),
sname varchar (20),
course varchar (10),
adate date);
Table created.
Step-2:
To display the structure of student with “desc” command as follows:
SQL> desc student;
Name Null? Type
----------------------------------------- -------- ----------------------------
SNO NUMBER (3)
SNAME VARCHAR2(20)
COURSE VARCHAR2(10)
ADATE DATE
Step-4:
The table after inserting record is viewed using select command as follows:
SQL> select * from student;
SNO SNAME COURSE ADATE
---------- -------------------- ---------- ---------
10 SURESH BCA 30-JUL-24
20 RAMESH BSC 02-JAN-24
30 SWETHA BBA 03-MAR-24
40 KAVERI BBA 04-FEB-24
50 RAJU BCA 09-MAY-24
... up to 13 records...
Step-5: Delete Command:
Delete command is used to delete a record or records from a table.
Syntax:
Delete from <table_name> where condition;
Example:
To delete a record from student table using delete command as follows:
SQL> delete from student where sno=130;
1 row deleted.
SQL> select * from student;
SNO SNAME COURSE ADATE
... remaining rows...
Result:
Demonstrating the data manipulation commands using SQL has been successfully done.