Questions tagged [table-relationships]

220 questions
0
votes
1 answer

Conditional statement to determine which table to Select from in Access 2013

I am trying to come up with a query to show the purchase and product information made by a member, and I was wondering if there is a way create a conditional statement to determine whether the product the member bought was from the Clothing table,…
Jerryq27
  • 159
  • 1
  • 14
0
votes
2 answers

Rails database relationships

I have three models that I want to interact with each other. Kase, Person and and Company. I have (I think) setup the relationships correctly: class Kase < ActiveRecord::Base #HAS ONE COMPANY has_one :company #HAS MANY PERSONS has_many…
dannymcc
  • 3,744
  • 12
  • 52
  • 85
0
votes
0 answers

Relationship between two tables

I have 3 tables all related to chain by foreign keys Table1: ID name -------- Table2: ID name T1_ID ------ Table3: ID name T2_ID Let's say i need to select All tables names i would write a query: select Table1.name, Table2.name, Table3.name…
0
votes
1 answer

Method missing when calling an method associated with another class (:belongs_to relationship)

We've attempted a has_many, belongs_to relationship: we've created a class - ArticleCategory - that belongs to Article. Articles have many article_categories. ArticleCategory has one attribute - sport:string We are unable to call…
jpn
  • 285
  • 2
  • 15
0
votes
2 answers

one to many relationship based on date

I wrote an windows form app in c# that makes a presence/delay log for employees and now I'm trying to add a feature to that app which does the following : Takes the log of that day (who is present and who came late to work) from it's database and…
Sam Nasser
  • 311
  • 5
  • 13
0
votes
1 answer

Database table relationships: Always also relate to specified value (Linq to SQL in .NET Framework)

I really can not describe my question better in the title. If anyone has suggestions: Please tell! I use the Linq to SQL framework in .NET. I ran into something which could be easily solved if the framework supported this, it would be a lot of extra…
sinni800
  • 1,451
  • 14
  • 29
0
votes
2 answers

How to configure One-to-One Relationship in Entity Framework, Code First

First of all, I followed the example from this link: http://blog.bennymichielsen.be/2011/06/02/entity-framework-4-1-one-to-one-mapping/ which seems solid, but when I try to create the scaffold, it crashes giving me the error that I have no…
0
votes
0 answers

Many to many relationship in Laravel 4.1 get the same result

please help i'm currently working on a real estate project and I have the following table as many to many relationship on Laravel 4.1 table categories table services table category_service when I tested on PHPMyAdmin with the following query…
Daroath
  • 382
  • 3
  • 16
0
votes
4 answers

Different Key in Table relations

I have a database with this structure TASKs SubTasks ============================= Id (pk) Id (pk) Name Name TaskCode ParentTaskCode Now I need to connect SubTasks Table to Tasks using Tasks.TaskCode…
Ayman
  • 1,387
  • 4
  • 20
  • 35
0
votes
1 answer

Database design - table relationships - prefer minimum relationships or "time saving" relationships

Looking for opinions and feedback for where relationships should be defined between database tables. Specifically, whether to prefer direct relationships where they conceptually make sense and need to be used, or to prefer using the minimum number…
0
votes
2 answers

SQL Relation, one-to-many with a current used row

in sql i have a table of items. An item can have multiples prices. But when i come to using the data, most of the time i only need the currentPrice that i can find with the date. My question : Would it be wrong to have 2 relation on price where and…
0
votes
1 answer

Hibernate MS SQL Join issue

I have two tables in the clients mssql database. The first is a job table - so I created an Job entity which contains the load type and load weight and all that stuff - works fine. My problem now is that there is a second table that includes…
user212926
0
votes
1 answer

Eloquent relationships in Laravel 4

I'm trying to make a mini CMS-type component and I have three models: Page.php class Page extends Eloquent { protected $table = 'pages'; public function content() { return $this->hasManyThrough('Content', 'PageGroup'); } …
Jon McIntosh
  • 1,263
  • 8
  • 14
0
votes
2 answers

Which relationship type to choose in Laravel Eloquent ORM on multiple relationships case

I am new to Laravel and a bit confused about some definitions of ORM. I am currently working on a simple Trouble ticket management system, and here is my question : (table: column, column,...) tickets : id, description, equipment_id equipments:…
gugabguerra
  • 635
  • 1
  • 5
  • 8
0
votes
2 answers

Relational Database Advice For Queries

I am working with EPICOR and designing BAQ Reports. My basic reports are always fine. Now that I've moved on to building more complex queries, I wondered if there are any tips to help them work. While my syntax is correct, verified by the program,…
Eliza
  • 3
  • 2