Question: For all countries whose government form is a 'Federal Republic' and whose official language is either 'English' or 'German', add 100,000 to their population, set their GNPOld to be equal to their current GNP, then increase their current GNP by 10,000
So, I am given the above ERD as reference and while trying to answer the question I am wondering if I need to select the columns from the table before updating.
After some search on https://dev.mysql.com/doc/refman/8.0/en/update.html I tried this
UPDATE country
SET Population = Population + 100000,
GNPOld = GNP,
GNP = GNP + 10000
WHERE GovernmentForm = 'Federal Republic' AND (Language = 'English' OR Language = 'German') AND IsOfficial = true;
AND
WITH GovernmentForm = 'Federal Republic' AND (Language = 'English' OR Language = 'German') AND IsOfficial = true
UPDATE country
SET ...
Both does not work. I am guessing the structure of my code to be wrong for this kind of query. A pointer or a tip will be greatly appreciated. Thank you !