create table sales(
order_date DATETIME not null,
-- Other columns omitted
)ENGINE=InnoDB PARTITION BY RANGE(YEAR(order_date))(
PARTITION P_2017 VALUES LESS THAN(2017),
PARTITION P_2018 VALUES LESS THAN(2018),
PARTITION P_2019 VALUES LESS THAN(2019),
PARTITION P_catchall VALUES LESS THAN MAXVALUE
);