Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Do You Doubt Design Bd In Sqlyog?

forums forums SQLyog Query Builder and Schema Designer Do You Doubt Design Bd In Sqlyog?

  • This topic is empty.
Viewing 2 reply threads
  • Author
    Posts
    • #12217

      Hello Happy New Year…

      My doubt is the following one I have two tables with a relation one to many, but the table father has a primary key composed by several fields. Since one relates both tables? The reason is that the relation does not appear as one to many but many to many.

    • #31780
      peterlaursen
      Participant

      IF you have a multicolumn PK each column may have duplicated values – for instance the two columns may have vaules (a,:cool: and (x.y) combined like this.

      Code:
      a x

      b y

      a y

      b x

      Neither column can be guaranteed to be unique with such Primary key and that is why a Foreign Key from a 'child' table referencing either of the two columns defines a many-many relationship. That is why it is correct what the Schema Designer does here!

      If you want to define a many-one relationship without changing the Primary Key you can add a Unique Key on the 'parent' column alone.

    • #31781
      peterlaursen
      Participant

      the smiley should have been a 'b'!

Viewing 2 reply threads
  • You must be logged in to reply to this topic.