About 13,500,000 results
Open links in new tab
  1. mysql - Can a table have two foreign keys? - Stack Overflow

    Mar 14, 2012 · The foreign keys in your schema (on Account_Name and Account_Type) do not require any special treatment or syntax. Just declare two separate foreign keys on the …

  2. How to Create a Table With Multiple Foreign Keys in SQL?

    Sep 26, 2021 · In this article let us see how to create a table with multiple foreign keys in MSSQL. Syntax: column_name(non_prime) data_type REFERENCES table_name(column_name(prime)

  3. mysql - Adding multiple foreign keys to single table - Database ...

    I'm trying to add multiple foreign keys to the same table; however, the error code 1215: Cannot add foreign key constraint keeps popping up. I've read other people's posts on this same topic …

  4. How to Create a Table with Multiple Foreign Keys in MySQL

    Aug 7, 2024 · In this article, we will implement a many-to-many relationship. For simplicity, we will create two foreign keys in one table. We need two different parent tables for primary keys. …

  5. MySQL FOREIGN KEY Constraint - W3Schools

    ADD FOREIGN KEY (PersonID) REFERENCES Persons(PersonID); To allow naming of a FOREIGN KEY constraint, and for defining a FOREIGN KEY constraint on multiple columns, …

  6. MySQL Create Table with Multiple Foreign Keys - Stack Overflow

    Nov 11, 2017 · I would like to create a table that has multiple foreign keys to multiple different tables (as the relationship is many to many).

  7. How to add a foreign key using ALTER in MySQL - GeeksforGeeks

    Apr 8, 2021 · In this article, we will discuss the overview of foreign keys and will discuss how to add a foreign key using ALTER in MySQL step by step. Let's discuss it one by one.

  8. Multiple-column foreign key in MySQL? - Stack Overflow

    Jun 4, 2009 · MySQL requires foreign keys to be indexed, hence the index on the referencing columns; Use of the constraint syntax enables you to name a constraint, making it easier to …

  9. sql - Multiple foreign keys? - Stack Overflow

    Jan 11, 2016 · CREATE TABLE SHIPPING_GRID( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'Unique ID for each row', shipping_vendor_no INT(6) NOT NULL …

  10. mysql - How to add multiple foreign keys into one column of a …

    Jan 6, 2015 · If you have 1-to-1 relationship, you can put the foreign key (student id) right into the lecture table. but since each lecture may have many students, and each student may have …

  11. Some results have been removed
Refresh