Which column is prioritized in MySQL for unique constraint errors?

42 Views Asked by At

Lets say I have 2 varchar columns first_name and last_name (both have unique constraints on them - not together but separately). So every person in my database has a unique first_name and a unique last_name.

Now, If I try to insert Donald Trump into the database when there is already a conflict for both columns (either another Donald Trump or Donald Diaz and Scott Trump).

Does anyone know which column would MySQL scream out that there is a conflict in? first_name? last_name or would it tell me both in the exception?

0

There are 0 best solutions below