CBSE Class 12 Computer Science
Question 34 of 42
Solved 2024 Sample Question Paper CBSE Class 12 Computer Science (083) — Question 5
Back to all questions 5
Question Consider the table Personal given below:
Table: Personal
| P_ID | Name | Desig | Salary | Allowance |
|---|---|---|---|---|
| P01 | Rohit | Manager | 89000 | 4800 |
| P02 | Kashish | Clerk | NULL | 1600 |
| P03 | Mahesh | Superviser | 48000 | NULL |
| P04 | Salil | Clerk | 31000 | 1900 |
| P05 | Ravina | Superviser | NULL | 2100 |
Based on the given table, write SQL queries for the following:
(i) Increase the salary by 5% of personals whose allowance is known.
(ii) Display Name and Total Salary (sum of Salary and Allowance) of all personals. The column heading 'Total Salary' should also be displayed.
(iii) Delete the record of personals who have salary greater than 25000.
(i)
UPDATE Personal
SET Salary = Salary + Salary * 0.5
WHERE Allowance IS NOT NULL;(ii)
SELECT Name, Salary + Allowance AS
"Total Salary" FROM Personal;(iii)
DELETE FROM Personal
WHERE Salary > 25000;