Questions tagged [table-relationships]
220 questions
0
votes
0 answers
Database design - Solution to represent 100*100+ M:N relationships?
I'm trying to find the best solution for my database-design problem, I am open to any suggestions :
Database schema
I have a table Element composed of sub elements, the relation between them is M:N so I need an intersect table for each new sub…
0
votes
1 answer
Add Many Weeks to Record
I currently have application which allows users to upload an image.
Currently. each image belongs to a certain event, or in my case a certain week.
To reduce redundancy and server overload with the same image being uploaded multiple times, I would…

RubyNewbie
- 547
- 5
- 21
0
votes
3 answers
Is is necessary to link or join tables in MySQL?
I've created many databases before, but I have never linked two tables together. I've tried looking around, but cannot find WHY one would need to link two or more tables together.
There is a good tutorial here that goes over database relationships,…

Birrel
- 4,754
- 6
- 38
- 74
0
votes
1 answer
Can Rails Active Record understand two simultaneous relationships between two tables at once?
I have two tables, users and groups. A user can belong to many groups. A group can have many users.
So I have created a have_and_belongs_to_many relationship between users and groups using a join table, groups_users. This all works as expected.
What…

Greg
- 2,523
- 4
- 22
- 27
0
votes
2 answers
Grails: Domain model relationships based on legacy database
I'm creating a Grails application that takes data from an existing legacy database (that's can't be modified) and I'm trying to wrap my head around how to represent table relationships in the domain model classes.
Here's some sample data:
Table 1…

Harry Muscle
- 2,247
- 4
- 38
- 62
0
votes
3 answers
Dynamic relationships
For example look at tables below:
tblItems:
ItemName IDData Type
-------------------------
i1 1 1
i2 2 1
i3 1 2
tblData1:
IDData Name
-------------------
1 Data11
2 …

HaMeD
- 349
- 1
- 14
0
votes
1 answer
PHP (Phalcon Framework) and MySQL: Models Relationships vs JOIN
For example there are 3 tables:
products
product_images
product_specs
And there are one-to-one relationships in models of this 3 tables.
By showing 50 products on page - it get more +2 extra queries inside cycle, so in total there are 150 rows and…

Jeckerson
- 106
- 2
- 6
0
votes
2 answers
MySQL multiple table relational query
I am a MySQL newbie and need help with something I am trying to do. I have 3 tables eod-stock, company and share_percentage. company table has all data for the companies listed in stock exchange with the codes assigned by the stock exchange.…

Samia Ruponti
- 3,910
- 12
- 42
- 62
0
votes
0 answers
Ms-access. Several relationships possible?
I have a small database about a DVD rental with three tables "Customers", "Movies" and "Rentals".
I created the following relationships:
Customers - Customer ID to Rentals - Cusotmer ID
Movies - Movie ID to Rentals - Movie ID
I would like to add the…

Nina
- 11
- 1
- 1
- 4
0
votes
4 answers
Get results from two tables - asp.net/SQL Server 2008R2
I have a search form with 2 fields(first name and last name) from one table (Just has person's information) and 4 (Incident number, date, place, created by) from the other (has one or more incidents for the person in the first table) linked through…

Nita
- 195
- 3
- 8
- 20
0
votes
1 answer
retrieve data using model relationship laravel 4
I'm really confused why I keep getting a null value when retrieving data from my data model.
Here's my model:
class Supplier extends Eloquent {
public function purchase_orders()
{
return $this->hasMany('Purchase_order','supplier_id');
…

melvnberd
- 3,093
- 6
- 32
- 69
0
votes
2 answers
MYSQL / PHP - Efficient method for attaching users to a project
I'm building a system that has a user table and a project table. I'm trying to determine the most efficient way to connect users to a project.
I'm was thinking about a table that records the relationship, but I wasn't sure if a serialized list in…

Tim
- 962
- 3
- 9
- 25
0
votes
1 answer
MS Access - Linking to record through stored ID
I have a few tables set up in Access as follows (forgive the slightly redundant example content):
Table 1:
- ID
- FirstName
- SecondName
Table 2:
- ID
- Details
- PersonID -> Table 1[ID]
Table 3:
- ID
- Group
- PersonDetails -> Table 2[ID]
Table…

NoodleCollie
- 855
- 7
- 24
0
votes
2 answers
polymorphic relation backwards query laravel 4
I've been searching the web for the answer and haven't found any, so here's the problem:
I have 3 table:
Events
Tournaments
Leagues
Event table:
id
eventable_id
eventable_type (League or Tournament)
Tournaments table:
id
name
Leagues…

Ara Sivaneswaran
- 365
- 1
- 10
- 25
0
votes
1 answer
Cardinality and Relationship among tables
There is a table named Department, which shows the various departments of a University.
And there is a table named Branch, which shows various branches (such as electrical, computer science, mechanical, automobile, law, literature…

Rubbal Bhusri
- 69
- 1
- 4
- 15