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
-
1
votes1
answer109
viewsUsing Strong Attributes with Rails 4 and has_one relationship
I have a relationship has_one similar to its where a :person has a :address. It turns out that the relationship is generated but the street that I put in input :street (address attribute) is not…
-
1
votes1
answer359
viewsRelating various data from one table to another with SQL
I needed to list, with SQL, a person’s father, mother and spouse along with their general data (e.g.: name, address, telephone, email, father, mother, spouse, status). This data is in another…
-
1
votes1
answer4041
viewsHow to select all tables containing the field with the same name?
I need to search all fields "id_category" in a given database, and bring a list of the tables that contain this field in common, which in this case is the foreign key of the table "sis_category".…
-
1
votes1
answer196
viewsRelation N x N in Java objects
I have an item table (item_id (pk), descrição, ...), A supplier table (fornecedor_id (pk), nome, ...) and for being an Nxn relation I have an item_vendor intermediate table (item_id (fk),…
-
1
votes1
answer1512
viewsRelationship (0.1) in mysql Workbench
I’m doing a project and I started by modeling the bank was all right up to the point of users that I got confused. Rules: general admin (access to all), admin company(access to all company events)…
-
1
votes2
answers286
viewsCan you get the value of an autoincrement column before it is saved in the database?
I have three tables: preco, estabelecimento and precoXestabelecimento. The id of price is autoincrement and there is a relationship N:N between the first two tables, which is represented by the…
-
1
votes1
answer375
viewsSoftware to Create Mysql DB Relationship and Structure
I have a project in mind and would like to map the data and create the relationship of the tables, even if only visually before developing the pages, could refer me a software (I think the concept…
-
1
votes2
answers146
viewsTreating Query Many-to-Many
I got a question about Many-to-Many relationship and I hope I’m not asking a repeated question, but I haven’t found the solution to my doubt in any corner. I happen to have a table of images, a…
-
1
votes1
answer84
viewsRelationship Through Many-To-Many Activerecord
I have the following configuration in Rails: Company has_many :company_products has_many :products, :through => :company_products Product has_many :company_products has_many :companies, :through…
-
1
votes1
answer465
viewsLaravel 5.2 - Relationship Many To Many between records of the same table
The tables: The table users, records users who may have N functions that are stored in the table funcoes (student, responsible, teacher, etc). The table funcao_user is pivot that makes the…
database laravel laravel-eloquent relationship laravel-5.2asked 8 years, 2 months ago Julio Alves 83 -
1
votes1
answer47
viewsWhat kind of relationship for this case?
I am a programmer beginner in C# and would like to help my company get off the paper, is an Ice Cream Factory. We make available freezers for clientes. I am developing a system that manages the…
-
1
votes1
answer426
viewsRelationship between tables in SELECT - SQL SERVER
I’m having a question on how to add a relationship between tables. Example: I am using this command to get the data. However, it returns me with the ID’s of the other tables. I would like to return…
-
1
votes1
answer38
viewsRelating 3 Standard Tables
Hello. I have a small model attached here. My task is from users, to get the records of Orders that have some record in the payment with the id of that order and the id of that user. Basically, an…
-
1
votes1
answer464
viewsMysql: Query Table N:N
Create database Banco default character set utf8 default collate utf8_general_ci; use Banco; create table Cadastrados( Nome varchar(50), Sexo enum('M', 'F'), Matricula varchar(9) unique, Curso…
-
1
votes2
answers508
viewsSearch in Table of Values in excel
Hello! I’m doing a cost chart for my company and I’m needing to do a search on a value chart, but the only way I currently know how to do it is through various chained Ses, which will take a lot of…
-
1
votes1
answer162
viewsRelationships Laravel Onetoone?
I’m doing some exercises, but there is one but I can’t understand why it’s not working when I do it with another name in the method. I have a method in the Model Location, where he does the…
-
1
votes1
answer156
viewsBelongstomany Laravel 5.4 Class 'Department::class' not found
I have several 4 tables Starting with Users -> Departments -> categoria_departamento -> category -> posts; Where the categoria_department table it serves as pivot for relation Many to…
-
1
votes1
answer787
viewsInsert Many To Many Laravel 5.4
I have a situation as follows. I have 4 user tables -> department -> categoria_department -> category -> posts Where in my view I have a select where it shows a data relation on ex…
-
1
votes1
answer1236
viewsCan I use select in Relationship on the Windows?
I have a model that takes the data with a with in the Standard, to take correlated data, there is form of these correlated data come only some specific fields and not all the data of the table? I…
-
1
votes1
answer724
viewsExample and illustration about redundant relationships (MER)
Context Consider the sentence below: It is claimed: Relationships that are the result of a combination of other relationships between the same entities are called: redundant relationships Doubt…
-
1
votes0
answers213
viewsInserting data in the 1:N - Laravel 5 ratio side 1
I have the following tables, Condominios and CondominiosTaxas, that are a relationship 1:N , respectively, my relationship in the model Condominio: public function Taxas() { return…
-
1
votes1
answer44
viewsHow to Create an N:N Table where one of the keys does not belong to a table of the same database
Context: The application has a module for record of calls and we use another application handle the incident record, both are in different database. Each call can be related to one or more incidents…
-
1
votes0
answers49
viewsquery with Many-to-Many polymorphic Laravel?
I have a polymorphic m-m relationship in my bank where: class(id, name) student(id, name) Lesson(id, name) classeable(classe_id, classeable_id, classeable_type) a class has several Students and…
-
1
votes0
answers22
viewsSearch in 3 tables
I have the following tables: CREATE TABLE alunos ( id_aluno int not null, nome VARCHAR(255), PRIMARY KEY (id_aluno) ) CREATE TABLE aulas ( id_aula int not null, nome VARCHAR(255), PRIMARY…
relationshipasked 6 years, 7 months ago Cardozo 11 -
1
votes1
answer56
viewsRails Cancancan - Doubt about table of Roles
Good afternoon, I have the following models: User.Rb class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and…
-
1
votes0
answers43
viewsRelationship no Laravel
Speak guys, I’m starting to use the Standard and I’m having a problem selecting some data. I have the following tables: users, jobs, projects, job_user. The list of users and jobs is of many to many…
-
1
votes1
answer559
viewsCardinality in Database - Relationship One to ONE
I’m studying databases, and at the moment beyond bank definitions, type of models I’m seeing Cardinality! I’m having doubts in this exercise below: My doubts are as follows How I identify the origem…
-
1
votes1
answer334
viewsCreate a new table for optional values
Do you have a problem creating a new table for fields that are not mandatory ? For example in the address table (cod_addressee, path, zip code, number, complement) where add-on is an optional field,…
-
1
votes1
answer82
viewsRelationship 1x1(or not)
I have 2 entities: Itempedido and Product... Using the Fluent API as I say to my Itempedido entity that she has a Product? Note: The product entity cannot have dependencies, although 1 product can…
c# entity-framework entity-framework-6 relationshipasked 6 years, 3 months ago Márcio Sebastião 769 -
1
votes1
answer115
viewsI can’t make research work with eloquent and relationship!!! Laravel 5.5 and mysql
I’m doing a search taking a piece of word and playing a search like LIKE for fields fields. Use the Eloquent and relationships, but does not bring the data. { $pesquisa = $dataForm['pesquisa'];…
-
1
votes1
answer205
viewsIntermediate relationship between two Laravel tables
Good evening I have the following tables in my application. Doacao -id -nome -doador_id Instituicao -id -nome Doador -id -nome I need to carry out the relationship, in a third table among the…
-
1
votes1
answer481
viewsHow to Relationship in Seeds and Factories in Adonisjs
I have the following question regarding Seeds and Factories. I have the following scenario: When the user is created automatically I need to create a settings record in the Userconfig table with the…
-
1
votes0
answers32
viewsProblem in the logic of a tab system with relationship between tables
Personal I have two tables that relate to each other. Are they: Category: public function up() { Schema::create('categories', function (Blueprint $table) { $table->increments('id');…
-
1
votes1
answer121
viewsHow to perform a consultation in the bank applying "exceptions" with a relationship?
I need to get all users with "Exceção" those of the function containing the id=2, it is possible? You can fit a Where in that consultation? I have the following consult at the bank Laravel which…
-
1
votes1
answer144
viewsHow to do this kind of relationship in Django?
I have the models "Subscriber": class Assinante(models.Model): name = models.CharField("Nome", max_length=32, null=False, blank=True) phone = models.CharField("Telefone", max_length=11, null=True,…
-
1
votes1
answer140
viewsHow to relate 2 json tables to php?
Good afternoon, my friends. I’m developing a plan system where I need to link 2 json tables to filter the data. But I’m not succeeding. I tried to relate them by creating 2 foreachs and trying to…
-
1
votes0
answers90
viewsSeparate related models in Sqlalchemy
I have a model of relational tables: models/Base.py from collections import OrderedDict from src.config.database import db class Base(db.Model): __abstract__ = True models/Model.py from .Base import…
-
1
votes0
answers35
viewsCopy tables to another bank while maintaining relationships
I’m trying to send some records from one bank (bank A) to another (bank B) that contains the same structure. They are records of 3 tables, 1 table(patient) contains MAIN records and the other 2(file…
-
0
votes2
answers265
viewsHow to automatically initialize has_many attributes in Rails
Currently I have 3 model class Regiao < ActiveRecord::Base has_many :tipofretes has_many :valorfretes, through: :tipofretes end class Tipofrete < ActiveRecord::Base has_many :regiao has_many…
-
0
votes1
answer131
viewsMore of a relationship in the same model
My client class has a relationship one-to-one with endereco and one-to-Many with contacts. How would be the functions in Cliente to function? and in Migrate?…
-
0
votes1
answer60
viewsHow to create a new associated template in Rails
Assuming I own the user Admin, the Admin has a login_user, as system_user, and this relationship is polymorphic, because other types of users also have login_user. When creating the Admin, I must…
-
0
votes1
answer103
viewsHow to work with 1 to 1 relationship in core data?
How do I perform operations relating entities in Core Data? These operations will relate data between 2 entities, being of type 1 to 1. I want to relate the image attribute of table 1 to the…
-
0
votes1
answer583
viewsForeign keys in database modeling
A primary key can have two foreign keys in different tables? For example:
-
0
votes2
answers94
viewsSave Related Models (One to One) - Laravel 5.1
I have a Model Info and a Model Complement that are related one to one. The relationships are already working properly, I can pull the data and such, but I need to do an update and do not know how.…
-
0
votes1
answer26
viewsFilter and count related model data
Enterprise hasMany Setorempresa Setorempresa belongsTo Enterprise Setorempresa hasMany Functionary Functionary belongsTo Setorempresa With this data in hand, how do I count how many id_status = 1…
-
0
votes1
answer144
viewsSelf Relationship
I have a schedule of medications. In it I have: code of the medicinal product (PK) description code ans There is the possibility that we have more than one drug code for the same ans code. I need to…
-
0
votes1
answer126
viewsRelationship in database table
I have a registration form where contains personal information, professionals, additional, financial and production, my doubt, as it gives many columns, I believe that more than 50 fields. Is it…
-
0
votes1
answer266
viewsHelp With Relationship Between 3 #Rails Tables
I would like your help in this problem below I have 3 tables: Product Purshase Supplier supplier_id product_id name class Purshase < ActiveRecord::Base belongs_to :product end class Product <…
-
0
votes0
answers87
viewsPHP: TXT for Multilevel Array
Guys, yesterday I had asked for help on the subject here that, promptly friends helped me, but I faced another problem: Only later I realized that the file . TXT has several levels, and not just 2…
-
0
votes0
answers554
viewsUsing Foreignkey to save to BD Django
I cannot do Data’s relationship with Teacher, I have to save Teacher and pass his id to Data foreign key and save, when I execute the code id is not passed Forms.py class…