What is the best way to enforce a 'subset' relationship with integrity constraints

前端 未结 12 1349
一个人的身影
一个人的身影 2020-12-10 18:11

For example, given 3 tables:

  • gastropod
  • snail
  • slug

and assuming we want to enforce that

  1. every row in \'gastropod\
12条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-10 18:52

    I know this problem as a supertype/subtype issue. I've written about it several times on SO. In this post, it's presented as a solution to a problem with staff, customers, and suppliers. But this post has the most extended discussion behind the rationale and how the constraints work. It's written in terms of online publications.

提交回复
热议问题