How would you go about creating a table with a constraint in MySQL that only applies to 1 particular table where you want 1 field to be unique for each unique record?
For example, let's say that I have a table called "person" with the following fields:
- person_social_security (primary key)
- person_id
- person_name
- person_phone_extension
For each record, I want to make sure that field #3 (person_phone_extension) is also always unique for every person_id. In other words, a person_id should never have a duplicate person_phone_extension. However, a different person_id can have the same person_phone_extension as another person_id. There can be multiple instances of person_id in this table.
person_idis not unique it can not beprimary key