w3resource logo


MySQL exercises

MySQL Update Table - Exercises, Practice, Solution

Secondary Nav

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.

Click me to see the solution

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.

Click me to see the solution

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.

Click me to see the solution

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.

Click me to see the solution

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.

Click me to see the solution

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.

Click me to see the solution

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.

Click me to see the solution

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.

Click me to see the solution

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 by .10% .

Here is the sample table employees.

Here is the sample table jobs.

Click me to see the solution



Join our Question Answer community to learn and share your programming knowledge.

Help the community:

PHP: Loop

JavaScript: Delete duplicates in an array

Oracle: Round the number