Questions tagged as 'modelo-relacional'

4
answers

Constraint on table change with subquery

MySQL's documentation says:    You can not change a table by selecting data from it in a subquery This applies to DELETE , UPDATE and INSERT operations. The solution is usually to replace the subquery with something...
asked by 09.09.2017 / 04:56
4
answers

Do I really need to define constraints in the database?

Ruby on Rails seems to have been thought of since it is not necessary to define constraints (like Foreign Keys ) in the database, / p> Normally the only constraint that is created in this case is the primary key of the id column, o...
asked by 13.05.2014 / 20:30
1
answer

What is the difference between the relationships between tables?

I know there are three types of relationships between data from different tables: 1: 1 (one-to-one); 1: N (one for several); N: N (several to several); But what would be the difference between relationship types and their use in a rel...
asked by 10.08.2016 / 04:03
4
answers

How does the relation between the same table work

Does the performance change? (Compared to different tables) In which case could this be used? Is it recommended?
asked by 07.03.2014 / 12:57
1
answer

Object-relational impedance difference

Basic question about object-relational impedance mismatch , a topic with which I have little experience. Does it really exist? (Certainly, Martin Fowler > and Ted Neward already talked about the problem, but does it really occur in...
asked by 04.11.2014 / 00:29
3
answers

Create database on the server via mysql-workbench template (.mwb) via command line

I'm trying to build a bat to create the database in the mysql server from a mysql-workbench EER (.mwb) model, that is, in command line, is it possible to perform this process? Could someone give a light? Editing: Opening it in cmd I have...
asked by 02.06.2015 / 19:05
4
answers

Foreign key can become primary key?

For example, I have two tables: client and contact. The Contact table contains the customer's phone column as the primary key, fax column, and email column. The client table contains the customer's phone column as the primary key and foreign...
asked by 07.03.2014 / 05:11
2
answers

Is it good practice to keep foreign key columns redundant?

Consider that we have the models A , B , C and D , each referencing the previous one, ie A has many B s, B has many C if C has many D s: No redundancy A | id | ... | ------...
asked by 23.06.2014 / 19:56
1
answer

Relationship between state, city, municipality and district

I downloaded an IBGE xml file with data from states, cities, municipalities and districts. I made the split for 4 tables and made their relationships. Follow SQLFiddle My question is: Is this relationship right? Can you still imp...
asked by 15.04.2014 / 05:38
2
answers

Queries between tables with Eloquent - Laravel 5

Well, I have the following problem when using Laravel 5 in the table relationship: I have these 4 tables (hypothetical names to illustrate the problem): UsingtheLaravel5templatesI'velistedthemtogether:CompanyTemplatepublicfunctionpessoa(){...
asked by 21.03.2015 / 22:04