Question: Update a Value
Understand how to update a specific employee's salary in a database using basic SQL update statements. Learn to identify the correct record and modify the salary value with precision.
We'll cover the following...
Question
Given the following Employees table structure:
Employees
EmpID | EmpName | Salary |
1 | Susan Lee | 50000.00 |
2 | Alexa Smith | 60000.00 |
3 | Dana Amberson | 45000.00 |
4 | Sarah Ronald | 47000.00 |
Additional information
You are provided with a table named Employees that contains the following columns:
EmpID: Unique identifier for each employee.EmpName: Name of the employee.Salary: The salary of an employee.
Let’s say you’re in charge of managing employee data for your company, and you’re tasked with performing an SQL update on Sarah Ronald’s salary in the company database to reflect her outstanding performance. Can you write a straightforward update query in SQL to make this adjustment? Sarah’s new salary would be $55,000.
Let’s see how you do it!
Expected output
The expected output is shown below:
EmpID | EmpName | Salary |
4 | Sarah Ronald | 55000.00 |
Try it yourself
You can try to write a query in the following playground: