DML – INSERT COMMAND TABLE - EMPLOYEE ID NAME PLACE DOB SALARY 1 ARUN DUBAI 2011-03-04 6000 2 VARUN SHARJAH 1998-05-06 8000 3 ALI 2012-02-01 9000 Write a command to insert the following values in a table employee. 6, govind,dubai,2000-03-05,7000. INSERT INTO employee values (6, ‘govind’, ’dubai’, ’2000-03-05’,7000);
DML – INSERT COMMAND TABLE - EMPLOYEE ID NAME PLACE DOB SALARY 1 ARUN DUBAI 2011-03-04 6000 2 VARUN SHARJAH 1998-05-06 8000 3 ALI 2012-02-01 9000 Write a command to insert the following values in a table employee. 6, govind,dubai. INSERT INTO employee(id,name,place) values (6, ‘govind’, ’dubai’ ) ;
DML – UPDATE COMMAND TABLE - EMPLOYEE ID NAME PLACE DOB SALARY 1 ARUN DUBAI 2011-03-04 6000 2 VARUN SHARJAH 1998-05-06 8000 3 ALI 2012-02-01 9000 1 ) Write a command to change the salary of Arun to 9000. UPDATE employee SET salary =9000 WHERE name =‘arun’;
DML – UPDATE COMMAND TABLE - EMPLOYEE ID NAME PLACE DOB SALARY 1 ARUN DUBAI 2011-03-04 6000 2 VARUN SHARJAH 1998-05-06 8000 3 ALI 2012-02-01 9000 2 ) Write a command to increment the salary of all the employees by 500. UPDATE employee SET salary =salary +500 ;
DML – UPDATE COMMAND TABLE - EMPLOYEE ID NAME PLACE Deptid SALARY 1 ARUN DUBAI 6000 2 VARUN SHARJAH 8000 3 ALI 9000 3 ) Write a command to change the salary to 10000 and deptid to 3 of the employees who are staying in dubai. UPDATE employee SET salary = 10000 , deptid =3 where place =‘dubai’;
DML – UPDATE COMMAND TABLE - EMPLOYEE ID NAME PLACE Deptid SALARY 1 ARUN DUBAI 6000 2 VARUN SHARJAH 8000 3 ALI 9000 4 ) Write a command to change the place to Abudhabi. UPDATE employee SET place = ‘Abudhabi’;
DML – DELETE COMMAND TABLE - EMPLOYEE ID NAME PLACE DOB SALARY 1 ARUN DUBAI 2011-03-04 6000 2 VARUN SHARJAH 1998-05-06 8000 3 ALI 2012-02-01 9000 1 ) Write a command to delete all the records of the table employee. DELETE from employee ;
DML – DELETE COMMAND TABLE - EMPLOYEE ID NAME PLACE DOB SALARY 1 ARUN DUBAI 2011-03-04 6000 2 VARUN SHARJAH 1998-05-06 8000 3 ALI 2012-02-01 9000 2) Write a command to delete the records of employees staying in dubai. DELETE FROM employee WHERE place =‘dubai’;