SQL: Advantages of an ENUM vs. a one-to-many relationship?

后端 未结 7 2076
独厮守ぢ
独厮守ぢ 2021-02-07 04:14

I very rarely see ENUM datatypes used in the wild; a developer almost always just uses a secondary table that looks like this:

CREATE TABLE officer_ranks (
id in         


        
7条回答
  •  别跟我提以往
    2021-02-07 04:57

    I don't see any advantage in using ENUMS.

    They are harder to maintain and don't offer anything that a regular lookup table with proper foreign keys wouldn't allow you to do.

提交回复
热议问题