Last answered:

11 Nov 2022

Posted on:

10 Nov 2022

1

Resolved: About the exercise

To solve this exercise I wrote:

update departments
set dept_name= 'Data Analysis'
where dept_name = 'Bussiness Analysis';

Is it a best practice?

1 answers ( 1 marked as helpful)
Instructor
Posted on:

11 Nov 2022

1

Hi Lizeth!

Thanks for reaching out.

Although the piece of code you shared should work, is quite legible and straight-to-the-point, I'd think one would rather use a reference to a primary key in the WHERE condition, rather than the previous value occupied in the field you are currently trying to change the data.
In our case, this would mean referring to the department number (dept_no).

Of course, in such cases one could follow company coding and/or formatting guidance and for the completion of this course, you don't need to focus so much on this aspect. Nevertheless, you must constantly be aware of it. Therefore, your question is very on point.

Hope this helps.
Kind regards,
Martin

Submit an answer