Mysql – Does it make sense to define a new “Data type”? Is there a way to do so

aciddatabase-designMySQL

I'm basically new to SQL, and I was making my own project when this question came to my mind.
I'm making a database that has an entity where an attribute would be a "number" and a "year".
In many programming languages one would create a new object or data type that takes both the number and the year. (say a tuple with INT, YEAR)
I wanted to know if this makes sense in SQL or I should just go with an INT and YEAR attribute.

To put more details into the project, I'm creating a DB for my mom who runs a business that goes with "campaings" (the INT value) directly associated with the "Year", so one would put the campaign 09 for year 2020, and so on.
I wanted to create a new Data Type for the attribute so then I don't have multiple "campaign 09" with different years.

I hope my question is clear, thanks!

EDIT: Read the comments for the answer.

Best Answer

This isn't something that requires a custom data type to solve.

If the requirement is Campaign 09 can only be associated with one year, then Year is simply an attribute for Campaign (although I'd argue perhaps StartDt or something similar, from which year can be derived might be more appropriate).

To illustrate:

CREATE TABLE Campaign
(
  CampaignNbr  INT   NOT NULL
 ,StartDt      DATE  NOT NULL
 /* Everything else */
 ,CONSTRAINT PK_Campaign PRIMARY KEY (CampaignNbr)
)