📅  最后修改于: 2022-03-11 14:57:57.348000             🧑  作者: Mango
create table users (
user_id bigint unsigned not null auto_increment primary key,
name varchar(255) not null,
description varchar(255),
marital_status enum('single', 'married'),
favorite_color enum('red', 'green', 'blue'),
hobby1 enum('painter', 'doctor', 'lawyer'),
hobby2 enum('painter', 'doctor', 'lawyer'),
hobby3 enum('painter', 'doctor', 'lawyer')
);
You want to avoid extra tables and joins unless really needed. This is exactly what enums are for. enums internally store as integer and in usage look like strings with constrained values.