Home  >  Q&A  >  body text

字段命名 - mysql 字段太长,如何简要字段规范?

天蓬老师天蓬老师2743 days ago830

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 13:27:21

    Product type parent table, its primary key is "product_parent_type_id", why not just use "id"?
    When writing SQL, it should be written like this:
    `product_parent_type`.`product_parent_type_id`
    Don’t you think this The place is really too long.

    `product_parent_type`.`id`

    How clear.

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:27:21

    Is it better to call the primary key of the parent table of the product type product_category_id? Personally, I think that when the naming length is too long, you can try to see if there is an equally descriptive name (of course this requires accumulation and experience), but it really doesn’t work a little longer. Better than a short meaningless name.

    reply
    0
  • Cancelreply