one to many relationship in database - design concept

前端 未结 5 1219
日久生厌
日久生厌 2020-12-30 11:46

A one to many relationship between two tables should be implemented with two or three tables? For example should we have:

author(id,otherAttributtes)
books(i         


        
5条回答
  •  盖世英雄少女心
    2020-12-30 12:26

    one to many is two tables.

    the second one is many to many.

    Authors
    1 Larry Niven
    2 Jerry Pournelle
    
    Books
    1 Integral Trees
    2 King David's Spaceship
    3 The Mote in God's eye
    
    AuthorsBooks
    1 1
    2 2
    1 3
    2 3
    

提交回复
热议问题