In the below-mentioned example, there is an EMP Table having records of EMP_NAME, EMP_NO, SALARY, MANAGER_ Dep.
Now, you have to perform the following operations by using the commands INSERT INTO, DELETE, UPDATE and SELECT in detailed SQL code by following the main steps:
⦁ Firstly, you insert the data by using the command INSERT INTO.
⦁ Then, you have to update the SALARY record of Saqib by 80,000 to 85,000 by using the command UPDATE.
⦁ Finally, and delete the record of Shahid from the table by using the command DELETE.
EMP_NAME EMP_NO SALARY MANAGER_ Dep
Haseeb 1 70,000 Marketing
Saqib 11 80,000 Accounts
Shiraz 12 65,000 HR
Shahid 13 80,000 Supply chain
INSERT INTO EMP (EMP_NAME, EMP_NO, SALARY, MANAGER_ Dep)
VALUES ('Haseeb', 1, 70000, 'Marketing)';
INSERT INTO EMP (EMP_NAME, EMP_NO, SALARY, MANAGER_ Dep)
VALUES ('Saqib', 11, 80000, 'Accounts');
INSERT INTO EMP (EMP_NAME, EMP_NO, SALARY, MANAGER_ Dep)
VALUES ('Shiraz', 12, 65000, 'HR');
INSERT INTO EMP (EMP_NAME, EMP_NO, SALARY, MANAGER_ Dep)
VALUES ('Shahid', 13, 80000, 'Supply chain');
UPDATE EMP SET SALARY = 85000 WHERE EMP_NAME = 'Saqib';
DELETE FROM EMP WHERE EMP_NAME = 'Shahid';
Comments
Leave a comment