how to set Foreign Key in database?

Certified Associate Developer

how to set Foreign Key in database? mariadb

  Discussion posts and replies are publicly visible

Top Replies

Parents Reply
  • 0
    Certified Associate Developer
    in reply to krishnav9816

    when i use

    ALTER TABLE LMS_Aprrovals
    ADD FOREIGN KEY (Claim ID) REFERENCES lmscustomerdetails(id);

    this error gets

    Error

    SQL query: Copy

    ALTER TABLE LMS_Aprrovals
    ADD FOREIGN KEY (Claim ID) REFERENCES lmscustomerdetails(id);
    

    MySQL said: 

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ID) REFERENCES lmscustomerdetails(id)' at line 2

Children