Questions tagged as 'chave-estrangeira'

1
answer

Error in adding foreign key

I'm having trouble creating a foreign key. I am doing the project in MySQL Workbench. The generated SQL script is as follows: DROP TABLE IF EXISTS 'comercio'.'cliente' ; CREATE TABLE IF NOT EXISTS 'comercio'.'cliente' ( 'cliente_id' INT(1...
asked by 26.01.2017 / 01:17
1
answer

Inserting foreign keys by Kettle

I need to load some data that is in spreadsheets into a relational database, but I have been facing some challenges with regard to inserting foreign keys. In these images you can see that I enter the project data first, the auto increment of...
asked by 27.08.2018 / 00:37
2
answers

Problem inserting data into a table containing foreign keys

Hello, everyone! Well ... My problem is this: I have a MySQL database that has 3 tables (Client, Event, Equipment). The event table has two foreign keys, the first one referencing the id of the Customer table (customer_id) and the second re...
asked by 30.07.2018 / 03:46
1
answer

Best way to register two foreign keys in a table

I have 3 tables, which are: personal_person , personal_juridica and address . Both tebela pessoa_fisica , and tebela pessoa_juridica use the endereco table. I would like to add two foreign keys in the endereço t...
asked by 04.12.2017 / 18:29
1
answer

Foreign Key Circular

I often see database modeled so that foreign keys close a circular reference, for example I used a template with cidade , bairro , and cliente . Here's the ER model: I understand that in this format, the data may be in...
asked by 18.08.2017 / 18:41
1
answer

Tags in a table for each?

I have the table "noticia" and I'm going to make a system of tags, these tags will have to have a table for each or just a table?     
asked by 30.07.2017 / 18:13
2
answers

How To Reference Foreign Key Alternating Tables

I have a Database of City, State and Country. But I want to add Cities to my table and it does not always contain a State to be referenced. However, every city is located in one country. My question is: can I create a relationship in which...
asked by 05.08.2015 / 21:07
1
answer

Foreign keys in database modeling

Can a primary key have two foreign keys in different tables? For example:     
asked by 01.07.2015 / 08:54
1
answer

Doubt with foreign key

To register the games of a football league the following tables have been defined: Time ( id int primary key, nome char(20), pontos int, nroVitorias, golsMarcados int, golsSofridos int ) Jogo ( idTime1 int,...
asked by 30.11.2018 / 19:48
0
answers

Foreign Keys Are "Breaking" Lines in Export

Good morning! I'm having difficulty exporting a SELECT that I created, it happens that when using INTO OUTFILE the file that is exported is breaking the lines where "Join" exists. So I ask your help so that I can solve this problem. Note: Whe...
asked by 10.04.2018 / 15:28