1 Reply Latest reply on Sep 14, 2014 6:03 AM by SteveMartino

    Multi one-to-many, one-to-one relational questions

    JohhnyHilly

      Title

      Multi one-to-many, one-to-one relational questions

      Post

      I've got 3 tables and I am not sure how I should be relating/connecting them. They are Properties, Leases and Tenants and I would like the following:

      One property can have many leases and many tenants.
      One lease can only have one property and one tenant.
      One tenant can have many leases and many properties.

      Can someone show me how this will look with the relational database? I want to make sure it's all right before moving forward.

        • 1. Re: Multi one-to-many, one-to-one relational questions
          SteveMartino

          I would think, for starters, based on your description:

          Tenants----------------->Leases<--------------------Property

          __pkTenID (in Tenants) = _fkTenID (in Leases) [for the relationship between Tenants & Leases]

          __pkPropID (in Property) = _fkPropID (in Leases) [for the relationship between Leases & Property]

           

          edit:  wanted to add   __pk means primary key, and _fk means foreign key.  The arrow   ----------> is one-to-many and the arrow

          <---------is many-to-one.