Most voted "relationship" questions
An entity-relationship relationship model (MER) is an abstract and conceptual representation of data, information aspects of a business domain or its process requirements. Lately MER is being much implemented in database.
Learn more…161 questions
Sort by count of
-
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…
-
11
votes3
answers3726
viewsWhat good is a "self Join"?
I would like an example for me to understand why I use a self relationship on the same table? I have intermediate knowledge in SQL but still do not understand Self Join.
-
7
votes1
answer1339
viewsA Product in Multiple Categories - PHP
I would like to know how to relate a product in several categories ? For example: A shirt can be in the Categories : "Green / Blue / Yellow" and when I filtered by category the product should appear…
-
7
votes2
answers12161
viewsDifference between RIGHT JOIN and LEFT JOIN
I have a little knowledge in relationship tables, read the answers to the question about What is the difference between INNER JOIN and OUTER JOIN?, and understood, theoretically. LEFT JOIN Returns…
-
6
votes1
answer54
viewsRelationships Does EDMX only affect performance?
I have a question about the Entity Framework. Here at the company where I work, the tables are generated in the bank without any relationship, until the fields are created that will be foreign keys…
-
6
votes1
answer102
viewsDoubt Relationship Rails
I’m learning Rails still, and I’m in doubt if I’m doing it right. I have a Table Animal and a table Reproduction, each animal may have one or more reproductions and each reproduction will only have…
-
5
votes1
answer219
viewsConsultation in a Relationship Many to Many in Laravel 4
Guys, I’m "stuck" on a problem concerning a customer report. I have the following relationship: Module (id, name) Associate (id, name, superior_id) Association_modulos (modulo_id, associado_id,…
-
5
votes3
answers1261
viewsSelf Relationship with Laravel
I have the following problem trying to make a self relationship with Laravel 5. I want to make a user registration, where users may have other users linked, creating an autorelationing N x N,…
-
5
votes2
answers1573
viewsWhat is the advantage of a 1:1 relationship?
I have a database (Mysql), and in a table I’m having about 80 columns. I am thinking of separating this information into other tables, and maintaining a 1:1 relationship. But this can impact a…
-
5
votes2
answers2069
viewsDoctrine: Manytomany’s Relationship with Extra Fields
I have a many to many relationship between two tables: Products and Orders. The Doctrine then generates a third table. So far quiet. But wanted to generate in this third table more fields (Qtde and…
-
4
votes1
answer128
viewsDistant relationship with Laravel
I have this table structure and would like to know if who posted the thread or the reply is Member or moderator, but I couldn’t structure a relationship that works, someone can help me? forum id -…
-
4
votes1
answer1925
viewsCake PHP Relationship - 3 Tables
I have the following 3 tables: Table State: id nomeEstado Table City: id idEstado //(que busca da tabela estado) nomeCidade Participating Table: id Nome idCidade Now I want to put on the page Nome,…
-
4
votes3
answers107
viewsDoubt with relation of tables
Good evening I have the following BD in Mysql CREATE TABLE IF NOT EXISTS `cad_cliente` ( `id_cliente` smallint(5) unsigned NOT NULL, `nome_cliente` varchar(45) NOT NULL, `nome_dr` varchar(45) NOT…
-
4
votes1
answer1008
viewsStackoverflow in bidirectional relationship at JPA
I’m facing this problem with a bi-directional relationship, when I put in a question to create an answer it makes persistence, even then beauty, but if I try to get a get or even in the answer the…
-
4
votes1
answer1002
viewsSave Relationship 1:1 on Laravel 5.3
In my scenario, I have tables of users and teachers, where a teacher has a user, so I have a relationship 1:1. Migrations: create_users_table Schema::create('users', function (Blueprint $table) {…
-
4
votes1
answer654
viewsIs it possible to list 2 tables from 2 different banks?
I’m looking to relate 2 different database tables. I’m using SQL Server SSMS 17.9.1. TBL1 in DB1 TBL2 in DB2 Scenarios: Both banks are on the same server; Database 1 is on my server and database 2…
-
4
votes1
answer681
viewsMutually exclusive relationship (MER)
I know there are several ways to implement this conceptual model, but I would like to know the best way (if there is one that stands out) Caption PK : Primary Key (primary key); FK : Foreign Key…
-
3
votes1
answer4973
viewsWhat is the difference between the relationship with "identification" and the relationship with "non-identification"?(Mysql Workbench)
I have been learning Database for some time and do not know the difference. I would very much like to know. On the Internet I found answers, but they are not very enlightening.
-
3
votes1
answer83
viewsI can’t perform a Select
I’m having a question about how I should ride the SELECT for a particular function. The scenario is as follows: I have 4 tables: Tab_Pessoa - Tab_Cliente - Tab_Autorizado - Tab_Cliente_Autorizado.…
-
3
votes1
answer1148
viewsHow to structure Hibernate Entity relationship annotations?
I would like to understand the difference between Hibernate annotations with JPA: @Onetoone, @Onetomany, @Manytomany and @Manytoone from Hibernate, how it works?
-
3
votes3
answers145
viewsDER Student Question Theme
I am developing a learning control system, where I will have a database of questions that will be listed in an activity and subsequently answered by students. As soon as the student answers the…
-
3
votes1
answer226
viewsHow to force an Exception when trying to delete a Master record that already contains relationship in a Child Record?
I created the following structure in SQL Server: Using Entityframework with Code-First the classes stayed that way: [Table("Master")] public class Master { [Key]…
c# sql-server entity-framework entity-framework-6 relationshipasked 9 years, 8 months ago Severo 299 -
3
votes2
answers125
viewsImplementing relationship in C#
I have the following classes: The code is like this: public class Mae { public string Nome {get; set;} public List<Filho> Filhos {get; set;} } public class Filho { public string Nome {get;…
-
3
votes1
answer300
viewsSumming values of a column of a Ruby-related entity
I am trying to build an application in Rails. I have a resource where the user registers products and sales. The relationship is too much for many, to pass an array of products for sales made of the…
-
3
votes2
answers488
viewsBest way to relate two tables
I have two tables (groups and roles): Table groups: +----+------+-------+------+ | id | name | color | role | +----+------+-------+------+ Table roles: +----+------+-------+-------------+ | id |…
-
3
votes4
answers342
viewsLaravel 5.3 - Model that can be created by multiple Controllers
Good afternoon, use Laravel 5.3 as back-end of a project and I will try to explain in the most succinct way the problem. Problem: In my project I have the Duplicate model and the Contract. A…
-
3
votes1
answer2635
viewsSQL SERVER - RELATIONSHIP 1:N
I have two tables: books and publishers. Their relationship was defined as follows, a book may have a publishing house and a publishing house may be in several books, i.e., 1:N. I learned that the…
-
2
votes2
answers522
viewsRecovering value in the pivot table as property of a relationship part
I have the relationship manyToMany amid Grupos and Usuarios and a pivot table grupo_usuario which stores the keys and an extra field aprovador, boolean, which serves to indicate whether the user in…
-
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
answer173
viewsHow to Sort Related Model Data?
I have the following relationship in my application: Model Client: class Cliente extends Model { protected $table = 'clientes'; public function Usuario(){ return…
-
2
votes2
answers61
viewsDatabase overloads while deleting lines with relationships?
Good afternoon to all! I have a question, and I’d like to get some opinions. I’m building a system in php + Larable. I have relationships between tables, for ex: Users->Roles. They are supposed…
php database laravel table relationshipasked 8 years, 6 months ago Fernando Herique Rubim Pioli 285 -
2
votes1
answer46
viewsLarval Relationsships 5.4
I have 3 tables,[Users -> Departments -> Posts] where the Users table has many Departments that Departments has many Posts. My question is: How do I relate the 3 tables to the with() method…
-
2
votes1
answer440
viewsRelationship between Mongodb collections
I wonder if it is good practice to create a relationship between two collections (Collections) in Mongodb. Suppose I have a collection for users, with a scheme like this: { "_id": ObjectId(...),…
-
2
votes1
answer887
viewsLaravel Update With Relationships - Good Practice
I created an Update for a Products table that is related to another table that is the Article(product_info) of this product. Only when I do Update I change the Product information, delete the…
-
2
votes1
answer138
viewsMany Relationship for Many ASP.NET Entity Framework
I am having difficulties to make the relationship between my tables using EF. When creating an Order, I need to list the data recorded in other tables, such as Equipment, Tasks and Person, as I try…
-
2
votes2
answers258
viewsHow to save Django objects with quantity validation?
I’m still a beginner in Django and would like to know how I would do to save a certain amount of students in vacancies. Example: vagas = 5, how do I allow them only to be saved 5 students? class…
-
2
votes0
answers207
viewsRelationship between three tables - Postgresql
need to make a relationship between three tables in the database in Java, created the two entities and the methods of the two entities, now need to insert a relationship table that has only two…
-
2
votes1
answer91
viewsWhat are the terms Weak Entity, Weak Relationship and One Optional/Mandatory?
I’m using an online tool yEd Live to model a MER diagram. However, there are some elements that use terms in which leave me with some doubts. Those terms are: Weakentity (rectangle) Weakrelationship…
-
2
votes1
answer671
viewsConsultations with Laravel
I started recently with Laravel and I have a terrible doubt. I have done several searches on google that have only left me even more confused. I have a table of news and a table of photos. Each news…
-
2
votes1
answer26
viewsLarval Relationsships 5.4 accessing search data with?
I have a relationship of One To Many, wanted to know how to access data from the two tables. Behold: Album::with('imagemAlbums')->where('departamento_id', $id)->get(); Return of dd() now in my…
-
2
votes2
answers1954
viewsRelationship with 3 tables in Standard
I’m trying to make the relationship between three tables in the Latvian. With 2 tables I managed, thanks to the help of the forum, but I’m not able to make it work with 3 tables. the relationship is…
-
2
votes0
answers134
viewsTree 5.5 - categories of a tree
I have the following structure of a table "Categories": public function up() { Schema::create('categories', function (Blueprint $table) { $table->increments('id');…
-
2
votes0
answers47
viewsHow to load relationships on multiple levels?
Hello, I am trying to perform searches in 3 related tables as follows Contracts belongsTo -> hasMany -> company_addresses. I would like to display company_addresses data in the Contracts view.…
-
2
votes3
answers134
viewsView products from multiple categories
This is my first post, I’ve been trying to solve a problem for some time now, but without success. I have the CATEGORIES table and the PRODUCTS table I need to display the following ways: CATEGORY 1…
-
2
votes1
answer1085
viewsInsert into related tables
Eai personal, to create an SQL for Insert in related tables, are the following tables: tb_Customer(id_Customer INTEGER [PK], nm_Customer VARCHAR, cpf_cnpj NUMERIC) dm_address_type(cd_address_type…
-
2
votes1
answer99
viewsHelp with grandfather, father and grandson relationships
I am learning and enjoying using the Standard, but I have some doubts about relationships and how to get the result I want. have the tables: TB_FORMULARIO - ID_FORMULARIO - NO_FORMULARIO TB_CAMPO -…
-
2
votes2
answers36
viewsRelationship between Similar Tables
I have a Relational Database structure. I will illustrate more briefly my tables: Tab_client with fields (ID, Name, ETC...) Tab_company with the fields (ID, Name, ETC...) Image tag with fields (ID,…
-
2
votes0
answers23
viewsHow to update a subdocument in a mongoDB document with Findoneandupdateasync
I’m trying to add a subdocument to a mongoDb document, but even looking at the previous posts I couldn’t find a solution. My classes public class UserClass { [BsonId]…
-
1
votes3
answers169
viewsConditional relationships
I need your help I have following model: class User < Ac... enum user_type: [:normal, :admin] end And I also have the model "Department": class Department < A.... end What I need to do is make…
-
1
votes1
answer1310
viewsJPA - Two Onetoone and Onetomany relationships between the same class
I own a student class and she has two relationships with Pessoa one OneToOne and OneToMany and person in turn a relationship with Endereco, as shown below: Classe Estudante @Entity @Table(name =…