MySQL Update Table - Exercises, Practice, Solution
MySQL Update Table [ 9 exercises with solution]
1. Write a SQL statement to change the email column of employees table with 'not available' for all employees.
Here is the sample table employees.
2. Write a SQL statement to change the email and commission_pct column of employees table with 'not available' and 0.10 for all employees.
Here is the sample table employees.
3. Write a SQL statement to change the email and commission_pct column of employees table with 'not available' and 0.10 for those employees whose department_id is 110.
Here is the sample table employees.
4. Write a SQL statement to change the email column of employees table with 'not available' for those employees whose department_id is 80 and gets a commission is less than .20%
Here is the sample table employees.
5. Write a SQL statement to change the email column of employees table with 'not available' for those employees who belongs to the 'Accouning' department.
Here is the sample table employees.
Here is the sample table departments.
6. Write a SQL statement to change salary of employee to 8000 whose ID is 105, if the existing salary is less than 5000.
Here is the sample table employees.
7. Write a SQL statement to change job ID of employee which ID is 118, to SH_CLERK if the employee belongs to department, which ID is 30 and the existing job ID does not start with SH.
Here is the sample table employees.
8. Write a SQL statement to increase the salary of employees under the department 40, 90 and 110 according to the company rules that, salary will be increased by 25% for the department 40, 15% for department 90 and 10% for the department 110 and the rest of the departments will remain same.
Here is the sample table employees.
9. Write a SQL statement to increase the minimum and maximum salary of PU_CLERK by 2000 as well as the salary for those employees by 20% and commission percent by .10.
Here is the sample table employees.
Here is the sample table jobs.
More to Come !
Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework