Most voted "foreign-key" questions
It is usually used to describe a problem or question directly related to the link between tables in databases. DO NOT USE THIS TAG simply because your table has a foreign key, but when the key is part of the core of the question.
Learn more…120 questions
Sort by count of
-
0
votes0
answers215
viewsRelate field to mysql table
I need to do a test crud for a company. In this test, I had to create the Name, Email, Phone and Address fields, and it should be possible to enter more than one address by name in this CRUD. I…
-
0
votes1
answer58
viewsInsert data in multiple related tables
I started a project at the same time that I started studies in a database. I created a customer phone only table and another table for all customer data, including phone as Foreign key. in the phone…
-
0
votes1
answer200
viewsForeign key breach error only in inclusion via API, via insertion bank is correct
I have a . NET Core API that connects to a Postgres database using Entity Framework. For each table that needs to do some insertion I have the model with the right fields (created by hand because I…
-
0
votes1
answer528
viewsMysql - Cannot add or update a Child Row: a Foreign key Constraint fails (`areas_knowledge`. `sub_areas`,
Hello, I am doing a job that consists in developing a system to manage projects and etc. In this system I need to have a table with the knowledge areas of cnpq. I’m taking the Grande Areas, Areas,…
-
0
votes1
answer84
viewsMysql key creation error
I’m making the following mistake: Error Code: 1005. Can’t create table bravo.tb_gerenciador (Rrno: 150 "Foreign key Constraint is incorrectly Formed") follows the script: -- MySQL Script generated…
-
0
votes0
answers28
viewsFK Ismatch sqlite
Good afternoon I have an error of FK Ismatch on Sqlite that is already bothering me but I can not see the problem, follows the skeleton of the bank: CREATE TABLE CEST_Item ( CIT_ID integer primary…
-
0
votes1
answer31
viewsHow to show the path of Filefields linked to a specific object in the template?
Good afternoon! I have a web application being made in Django, and I don’t know how to show in the template the path of all Filefields that are linked to an object. I own two models. One for a…
-
0
votes1
answer141
viewsHow to reference multiple foreign keys in a MYSQL field
I have a problem that I can not find a solution, I am making a database for a school system, in this system there is the table of materials, which has an ID and a NAME, and teachers who have an ID a…
-
0
votes0
answers41
viewsERROR 1136 PROCEDURES + INSERT + FOREIGN KEY
This error is appearing and I am not managing to solve it: ERROR 1136 PROCEDURES + INSERT + FOREIGN KEY The number of parameters is equal. Did I do something wrong on constraint? Follows the Code:…
-
-1
votes1
answer273
viewsCannot add Foreign key Constraint! but syntax and pks are correct
I’m trying to create a FK for a table, I don’t understand syntax error, but the TOAD returns the message that cannot create FK. Tables are created in the database, and Pks are right. ALTER TABLE…
-
-1
votes1
answer46
viewsFOREIGN KEY Mysql PHP
I’m a beginner in this world and I have a question. How do I access only a single row of an SQL table by ID? I have a "company" table that has a foreign key with the id of another table: table…
-
-1
votes1
answer33
viewsHow to add a new table 1:N (one for many) in an existing database via Migration Laravel?
Hello! I need to add a new table in an existing comic. I use the Laravel Framework and I would like to do this via Migration, but every time I try it makes a mistake and I don’t know what I might be…
-
-1
votes1
answer47
viewsHow to register a foreign key that is on another screen in php?
How do I save the user’s id_user who is logged in, and the address class’s id_address in the denunciation table? OBS: class primary keys are automatic in the database Login class: <!DOCTYPE…
-
-2
votes1
answer99
viewsHow to auto fill a column based on another column’s value? MYSQL
I have a table of users where have the columns: id_usuario, name, id_company among others. And I have another table where I save other information of this user, and I also have the columns name and…
-
-2
votes1
answer34
viewsSELECT works in phpMyAdmin but in php application the same SELECT does not work
I have an order table with two foreign keys, sender and recipient which is the primary key of the person table. When I do SELECT in phpMyAdmin the result is correct. But in my application the name…
-
-2
votes1
answer1014
viewsError when adding FOREIGN KEY in already created table
I have a table that I need to change to have a foreign key ALTER TABLE bancocliente.product ADD CONSTRAINT fk_fabPro FOREIGN KEY (cod_fab) REFERENCES bancocliente.fabrica (code); I get the error…
-
-2
votes3
answers78
viewsQuestions about database modeling, ID duality
I am creating a system aimed at law firm, and in the middle of the development emerged the following situation: There are the following tables (summarized): TB_PROCESSO possessing: IDPROCESSO…
-
-2
votes1
answer1670
viewsINSERT conflicted with FOREIGN KEY constraint
I have a problem when performing INSERT in a table in my BD because whenever I try to perform INSERT SQL Server return me this : The INSERT statement conflicted with the FOREIGN KEY constraint…
-
-2
votes0
answers25
viewsTable with foreing key does not send data to Phpadmin
I’m still a beginner in mysql and php but after some studies I’m trying to create a system and in case I’m having trouble with FOREING KEY, I have two tables a 'tb_students' and 'tb_notes' but I’m…
-
-3
votes0
answers30
viewsSQL: I need my 2nd table with FK of the 1st automatically updated
I have a Sales_order table with Order Number and other information and created a table with FK of the 1st. I want every time a new order automatically falls in the 2nd (Requested) with the column…