Do you need a different name in mySQL external keys?



  • There are two tables that refer to the main link many to many. For each, the connector is assigned. I understand correctly that when the external key is created, it is not the same as the external keys that belong to the same field in the main table? In this case scientist_id

    And the question is:

    How to create a Primary Key from two fields to avoid creating a new one? Just mark Pk on both fields? ♪ summary_field scientist_id and field_id Like what?

    Скриншот =)



  • Tables may be called the same. There's no criminal record. I don't know what interface you're using, but in order to create a composite key, try to separate all the PK columns and then act like a simple one.

    Write on SQL:

    Alter table summary_scientific_work
    add constraint PKkk Primary key(scientist_id, scientist_work_id);
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2