How to set up a create function with a condition?

I have a master table that takes in data about a customer. I’m reading their car number.

I need to check if that exact car number entry already exists in the database (Master Data collection), and if it does, I need an automatic boolean entry (or any kind of entry) in the collection to track that the particular customer entry is duplicated.

If anyone’s got the solution please help me out :)))