How to make an extra field unique

Hi all! NOOB question here:

I have users and companies. I want to make sure that company names are unique. Is this logic that I have to ensure by checking the input varaibles or can I give the database field a unique property?


Just posting this in a different section,… hope someone can assist.