About 59,600 results
Open links in new tab
  1. mysql - Add Foreign Key to existing table - Stack Overflow

    I want to add a Foreign Key to a table called "katalog". ALTER TABLE katalog ADD CONSTRAINT `fk_katalog_sprache` FOREIGN KEY (`Sprache`) REFERENCES `Sprache` …

  2. sql - Foreign keys in MySQL? - Stack Overflow

    The foreign key column isn't exactly the same data type as the primary key column in the referenced table Unfortunately, MySQL gives no message that it has failed to create the …

  3. How to remove constraints from my MySQL table? - Stack Overflow

    Jan 2, 2013 · As of MySQL 8.0.19, ALTER TABLE permits more general (and SQL standard) syntax for dropping and altering existing constraints of any type, where the constraint type is …

  4. How can I add a foreign key when creating a new table?

    Oct 27, 2008 · From the MySQL Reference: For storage engines other than InnoDB, MySQL Server parses the FOREIGN KEY syntax in CREATE TABLE statements, but does not use or …

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

    Apr 6, 2016 · Use of the constraint syntax enables you to name a constraint, making it easier to alter and drop at a later time if needed. InnoDB enforces foreign keys, MyISAM does not.

  6. MySQL Syntax in creating Foreign Key - Stack Overflow

    Is this syntax correct in creating a Foreign Key? create table department ( departmentID int not null auto_increment primary key, name varchar(30) ) type=InnoDB; create table employee (

  7. sql - How to add a column and make it a foreign key in single …

    In mysql, can I add a column and foreign key in the same statement? And what is the proper syntax for adding the fk? Here is my SQL: ALTER TABLE database.table ADD COLUMN …

  8. mysql - Foreign Key Syntax - Stack Overflow

    Nov 29, 2015 · mysql database database-design edited Mar 6, 2013 at 14:27 echo_Me 37.2k56181 asked Mar 6, 2013 at 14:19 Amol 363212 1 Answer Sorted by: 16

  9. sql - Drop a foreign key from a table in mysql - Stack Overflow

    Jun 3, 2015 · The output from that will show the foreign key constraints, as well as the columns in the table. You should be able to figure out the name of the foreign key constraint you want to …

  10. mysql - SQL keys, MUL vs PRI vs UNI - Stack Overflow

    Walkthough on what is MUL, PRI and UNI in MySQL? From the MySQL 5.7 documentation: If Key is PRI, the column is a PRIMARY KEY or is one of the columns in a multiple-column …