Best practice for unique constraint: multiple columns VS generated column
I have several tables in which “whole” items are stored across multiple columns for each of their “parts,” and I wish to ensure that the “whole” is unique. These tables each contain a generated column that return the “whole” in its proper format.
How to prevent MySQL table from accepting multiple rows with NULL column value
How can I configure a MySQL table to prevent multiple rows having NULL in a given column when all other column values are equivalent?