I need to create a table where I have columns country and city.
If I put the country as 'USA', the city must be 'New York'. How to impose this constraint?
I tried but this affects data in other rows too:
UPDATE table1 SET city = IF(country = "USA", 'New York', '');
Also, if possible the constraint should be added while creating the table.