Advertisements
Advertisements
प्रश्न
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:
- Increase the salary by 5% of personals whose allowance is known.
- Display Name and Total Salary (sum of Salary and Allowance) of all personals. The column heading ‘Total Salary’ should also be displayed.
- Delete the record of Supervisors who have salary greater than 25000.
कोड लेखन
Advertisements
उत्तर
- UPDATE Personal
SET Salary=Salary*1.05
WHERE Allowance IS NOT NULL; - SELECT Name, Salary+Allowance AS
"Total Salary" FROM Personal; - DELETE FROM Personal
WHERE Salary>25000
shaalaa.com
SQL for Data Definition
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
