作用與分類:
枚舉enum,多選一個
集合set,多選多
測試
create table teacher(
id int,
name char(16),
sex enum('male','female','others'),
hobbies set('play','read','music','piao') #set集合多選多 要選多個的時候要用逗號隔開
);
如:
insert into teacher values(2,'alex','others','piao,play,read');#這就是選擇了制作的表中的枚舉和集合的例子,
集合是多選的就用了逗號隔開