Activity 6.01 – updating the data in a view
One of the Automobile Clubs members, Darby Mariella Collins (member ID 7), has noticed that his DOB is incorrect in the system and has asked for it to be adjusted; it should be January 11, 1990. Since we have a view that shows information about every member, the best way to update this is by using the vw_members_all view
function.
In this activity, you will adjust Darby Mariella Collins' date of birth in the system by doing the following:
- Confirming the date is incorrect by examining the DOB for member ID 7 in the members table directly. Remember that MySQL stores dates in the YYYY-MM-DD format.
- Creating an update query to adjust the date while using the
vw_members_all
view as the base record source for your query. - Confirming the date was adjusted by examining the record again in the members table.
Views are a simple way of saving commonly used SQL queries and are reusable, resulting in less code redundancy...