Most voted "relational-model" questions
Relational model is based on two concepts: Entity and Relationship. Entity that is the one that contains the data and relation that is the way these data are associated.
Learn more…125 questions
Sort by count of
-
24
votes4
answers453
viewsTable change constraint with subquery
To documentation mysql says: you cannot Modify a table and select from the same table in a subquery you cannot change a table by selecting data from it in a subquery This applies to DELETE, UPDATE…
-
18
votes3
answers437
viewsDatabase should follow the OO standard?
Object Orientation According to the Rules of Pure O, we have: "The Object must manipulate methods and attributes belonging only to it" That is, what does not strictly belong to class should be an…
-
16
votes1
answer1078
viewsWhat 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 for several); But what would be the difference between…
-
14
votes4
answers1643
viewsIs it really necessary to define constraints in the database?
Ruby on Rails seems to have been thought of considering that it is not necessary to define constraints (as Foreign Keys) in the database, just define them via application. Usually the only…
-
11
votes4
answers3989
viewsHow the relationship between the same table works
Performance changes? (Compared to different tables) In which case it could be used? It is recommended?
-
11
votes1
answer35768
viewsWhat is the difference between conceptual, logical and physical modeling?
In a relational database, what is the difference between conceptual, logical and physical modeling? Could you give an example?
-
11
votes1
answer18212
viewsWhat are the types of Scade in JPA?
I’m looking for information on the types of Scade that exist and how they work in JPA relational modeling. The guys I found explanations for were: NONE = Does nothing with the object (default) MERGE…
-
10
votes2
answers8715
viewsWhat is the use of using foreign keys?
I’ve been learning about foreign keys and I’m having a hard time understanding what they’re useful for. Its purpose would be to "divide a table into several tables, leaving its data always atomic",…
-
9
votes1
answer422
viewsObject-relational impedance difference
Basic questioning about Object-Relational impedance Mismatch, a topic I have little experience with. It really exists? (I’m sure you do; Martin Fowler and Ted Neward already talked about the…
-
9
votes1
answer22460
viewsNon-relational Database vs Relational Database
Some time ago I was in doubt about the differences between these two models, I even looked on the Internet but I did not find anything to take away the doubt so I will ask some questions. 1 - What…
-
8
votes4
answers15597
viewsCan foreign key become primary key?
exemplifying, I have two tables: customer and contact. The contact table contains the customer’s phone column as primary key, fax column and e-mail column. The client table contains the customer’s…
-
8
votes3
answers2208
viewsCreate database on server via mysql-Workbench (.mwb) template via command line
I am trying to assemble a bat to create the database in the mysql server from an EER (.mwb) mysql-Workbench model, that is, in the command line, is it possible to perform this process? Someone could…
mysql relational-model batch mysql-workbench command-lineasked 9 years, 6 months ago Artur_Indio 1,093 -
8
votes3
answers241
viewsBest way to keep data that depends on a condition
Hypothetically I have a table publicação that has, by default, attributes autores (derives from a relationship table),titulo, edição, editora and ano. However, depending on the type of publication…
-
8
votes2
answers430
viewsDeadlock at Conceptual Design Level, Entity-Relationship Modeling (MER)
At conceptual design level we can use the approach (relationship entity modeling (MER)) to describe the behavior of future tables that will appear in the logical project. Within that context a doubt…
-
7
votes1
answer1593
viewsRelationship between state, city, municipality and district
I downloaded an IBGE xml file with data from states, cities, municipalities and districts. I separated it into 4 tables and made their relationships. Follow the Sqlfiddle My question is: It’s right…
-
7
votes2
answers577
viewsIs it good practice to keep foreign key columns redundant?
Consider that we have the models A, B, C and D, each one referencing to the above, ie, A has many Bs, B has many Cs and C has many Ds: Redundancy-free A | id | ... | ------------ | ... | ... | B |…
-
7
votes2
answers4496
viewsConsultations between tables with Eloquent - Laravel 5
Good, I have the following problem when using Laravel 5 in the relationship of tables: I have these 4 tables (hypothetical names to illustrate the problem): Using the Laravel 5 models I connected…
-
6
votes1
answer2281
viewsModeling for user permissions
I think this question is more of modeling analysis actually do not know if it fits the pattern of questions discussed by meta.pt.stackoverflow.com. I need to make my system in a way that almost…
-
6
votes1
answer2994
viewsModel "Product" table for multiple different product types
How to model the Table Product from a data bank? This table should store the following information: id, product name, quantity, price, status (if it is in stock, if it will be returned) and…
-
5
votes1
answer167
viewsDoubt with relational modeling
I’m setting up a land registry, where these properties belong to an address, which belongs to a neighborhood that belongs to a city. Ex tables: Imoveis: id, endereco_id, etc... Enderecos: id, nome,…
-
5
votes2
answers263
viewsIn a MVC structure, can we create a model that represents a View (SQL)?
I was arguing with a friend of mine about using views (I mean Mysql, not Mysql Pattern MVC). Hence a doubt arose in the following sense: A Model is used to represent a data structure, and you can…
-
5
votes1
answer72
viewsWhat is Big Data and what is its relationship to the relational model?
I was reading about big data, However, I still can’t understand what the big data would actually be in its essence. I have always used the RDBMS model for data storage and manipulation and at this…
-
5
votes2
answers604
viewsRelationship on-to-one in auxiliary table using Laravel
In the application I am working the database is built on the part of users, as follows: user 1 -------> 1 user_address 1 <-------- 1 address In the user table there is no column referencing…
-
5
votes2
answers1731
viewsConceptual model
I was looking at the conceptual model diagrams, I saw some that contain the attributes and entities like this: And others who only have the Entity: Which model is correct? or are both? Is it…
-
5
votes2
answers396
viewsHow to play relationship in Objects?
According to the definition of this website: CARDINALITY Is the maximum and minimum number of occurrences of an entity that are associated with the occurrences of another participating entity…
-
5
votes2
answers240
viewsSpecialization and generalization in databases and application development
I have a table Livros and I know that the specialization/generalization of books are Livros de Ficção, Livros de Drama and Livros de Suspense, for example. However, in the logical model, I don’t…
-
4
votes1
answer580
viewsTender relationship with a foreign key not mandatory
I have a database with three entities that relate: user, process and courses. The goal is to model the bank to meet the following requirements: The user can sign up for several selective processes…
-
4
votes1
answer462
viewsWhat is the foreign key (SQL) for
For what I’ve been researching, when pulling the information of two tables in a database, JOIN is used, which has nothing to do with foreign key. So what’s the point of declaring a field as Foreign…
-
4
votes1
answer526
viewsNode.js Sequelize Error Relationships
In this relationship, A Questionnaire can have MANY Questions, when I run it in return I don’t get the ID of Questionário on the table of Questão, but both are created. Why this occurs? Here’s the…
-
4
votes1
answer232
viewsUse of Generalization/Specialization in Data Modeling
I’ve read some articles about Generalization/Specialization in data modeling, but some questions have arisen: Is the primary key to generalization also the primary key to specializations - that is,…
-
4
votes1
answer142
viewsModifications to model and relational database
The requirements for the development of a system in general change over time. Several approaches to software development such as agile methods and Domain-Driven Design even encourage an iterative…
-
4
votes1
answer171
viewsHow to map two equal entities with Hibernate
I have a scenario where I have the entities Pedido and Usuário. The Pedido is composed of some attributes, among them the requester that is mapped as follows: @ManyToOne(fetch = FetchType.EAGER)…
-
3
votes2
answers99
viewsSet roles for users stored in Database
How to structure in the database a structure of user roles (ordinary users, entrepreneur, site_amdin), each user will have different functionalities, different powers in the application that will…
-
3
votes1
answer89
viewsProduct Table Database (problem with product size)
Good morning before everything, let’s imagine that my products table would have the fields (product code, name, gender, price , size), by having the size field in this table would involve that by…
relational-modelasked 8 years, 7 months ago PKyoshi 79 -
3
votes2
answers116
viewsHow to create a template with just a few table fields?
I have some tables with several fields. For example, the table (X) has some 20 fields of which I will only use 2 or 3. In this situation I have to create the templates with all fields and ignore the…
-
3
votes1
answer919
viewsModeling Categories and Subcategories
I am modeling a database related to e-commerce and I have a question in the modeling of the tables of categories and subcategories of products. At first I created two tables one of Categoria and…
-
3
votes2
answers3205
viewsModeling database of a system of friends
Hello, I am developing an application where there will be an option to add friends,is very simple, it is not social network, but have to add friend. I have the user table. What tables and…
-
3
votes2
answers1023
viewsDatabase modeling problem
I created a system that has control of sales (id, id_vendedor, produto), salesman (id, nome, id_equipe) and team (id, nome) in a company. Example: "John has id: 1 and belongs to the team: Blue; in…
-
3
votes0
answers418
viewsWhat database structure should I use for a process (business Rules) that is dynamic?
When we are developing software we always come across this question: "Is software forged by processes or are processes forged by Sofwtare? Or both?" Case Study - I work at a company where business…
-
3
votes2
answers13959
viewsWhat is the difference between Associative Entity and the Intermediate Table of relationships N for N?
What’s the difference between Associative Entity and the Intermediate relationship table N to N? Is there any notable difference in the model translation ER to the relational model? In the ER model…
-
3
votes2
answers334
viewsIs "inheritance" table a bad practice in this case?
In my database I need to store employees, customers and suppliers. Since all these share data in common, but not all the data, I decided to create a table pessoas with the columns in common: id //…
-
3
votes2
answers144
viewshas_many through association [RAILS 3.2]
I’m having trouble with an association has_many, through on a project I’m working on. In case I need to model a relation that adds the attribute order to relation table. To try to model the…
-
3
votes1
answer88
viewsIs it possible to have a list as an attribute of a table in a relational database?
I’m doing a Java project using Sqlite as a relational database. Basically the project is a database of passwords, where a User can have several registered platforms and each platform having its…
-
2
votes3
answers2007
viewsSelect records from a table where the record of a related table is a specific value
I have a table of technical calls and a table of appointments. Each 'CALL' has several 'CALLS' and it is in the calls that is the field that defines the status of the call (Open, Closed, In…
mysql codeigniter select relational-model active-recordasked 10 years, 9 months ago EdnaldoNeimeg 109 -
2
votes1
answer649
viewsHow to Import a . er1 File into CA Data Modeling
I need to import an . er1 file from an older version of Erwin in CA Data Modeling (Community Edition). This is possible ? I tried to open direct and the options of "Import" unsuccessfully. Grateful…
-
2
votes2
answers159
viewsWhen should an attribute be a table or vice versa?
Example: I have an Orders table, the order has some status, new, delivered, canceled etc. When the status is canceled I will give the option of the user to tell the reason that was canceled, this…
-
2
votes1
answer275
viewsCreate a conditional using the relational model
I’m trying to create a conditional "or" just using the relational paradigm: Having the tables pessoa, cliente, funcionario and considering that a person may be a client or an employee (a 1:1 ratio,…
-
2
votes1
answer366
viewsTables with columns always null
Is it considered wrong to create tables with mutually exclusive columns? For example, I have tables Texto, Trecho and Linhas, whereas Texto and Trecho has many Linhas, the table Linha is holding the…
-
2
votes1
answer278
viewsHow to update the pivot in LARAVEL 4 using the UPDATE method?
I have two models that are linked, through the belongsToMany, a relationship table N:N. So the structure is arranged as follows: class Permissao extends Eloquent{ public function niveis() { return…
-
2
votes1
answer1016
viewsPopulate tables with multiple foreign keys
I have a database with the following tables: Airport ( Iata PK, airport, city, state, country, lat, long) Causa_cancellation ( code PK, description) Manufacturer (Idfabricante PK, manufacturer name)…