Dml




DATA MANIPULATION LANGUAGE COMMANDS

INSERT COMMAND:

INSERT SINGLE RECORD:

SQL> Insert into employeee values (100,'preethi', 29,66666.66,'28-jan-00');

1 row created.

SQL> select * from employeee;

ENO ENAME AGE SALARY DOJ
---------- --------------- ---------- ---------- ---------
100 preethi 29 66666.66 28-JAN-00

INSERT MORE RECORDS:

SQL> Insert into employeee values (&eno,'&ename', &age, &salary,'&doj');
Enter value for eno: 101
Enter value for ename: swathi
Enter value for age: 30
Enter value for salary: 66655.55
Enter value for doj: 20-dec-1999
old 1: insert into employeee values (&eno,'&ename', &age, &salary,'&doj')
new 1: insert into employeee values (101,'swathi', 30,66655.55,'20-dec-99')

1 row created.

SQL> /
Enter value for eno: 102
Enter value for ename: deepika
Enter value for age: 28
Enter value for salary: 54432.22
Enter value for doj: 20-feb-2001
old 1: insert into employeee values (&eno,'&ename',&age,&salary,'&doj')
new 1: insert into employeee values (102,'deepika',28,54432.22,'20-feb-01')

1 row created.

SQL> select * from employeee;

ENO ENAME AGE SALARY DOJ
---------- --------------- ---------- ---------- ---------
100 preethi 29 66666.66 28-JAN-00
101 swathi 30 66655.55 20-DEC-99
102 deepika 28 54432.22 20-FEB-01

UPDATE COMMAND:

SQL> Update employeee set salary=salary*0.05+salary where doj<='01-jan-00';

1 row updated.

SQL> select * from employeee;

ENO ENAME AGE SALARY DOJ
---------- --------------- ---------- ---------- ---------
100 preethi 29 66666.66 28-JAN-00
101 swathi 30 69988.33 20-DEC-99
102 deepika 28 54432.22 20-FEB-01

DELETE COMMAND:

DELETE WITH CONDITION:

SQL> Delete from employeee where age>29 and age<32;

2 rows deleted.

SQL> select * from employeee;

ENO ENAME AGE SALARY DOJ
---------- --------------- ---------- ---------- ---------
100 preethi 29 66666.66 28-JAN-00
102 deepika 28 54432.22 20-FEB-01


DELETE WITHOUT CONDITION:

SQL> delete from employeee;

2 rows deleted.

SQL> select * from employeee;

no rows selected


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: