SQLite composite key (2 foreign keys) Link table

前端 未结 4 1136
再見小時候
再見小時候 2020-12-28 18:45

I\'ve read the rather cool styled BNF grammar for the SQLite create table statement

found here: http://www.sqlite.org/lang_createtable.html

I was wo

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-28 19:13

    There is no prohibition about a PRIMARY KEY not also being a FOREIGN KEY for those designs that require this kind of relation. Your problem isn't one of those, however, since the natural PRIMARY KEY in the linking table is a composite of the two columns, each a FOREIGN KEY back to one of the other tables.

提交回复
热议问题