Questions tagged [relational]
526 questions
0
votes
3 answers
printf with relational signs
int i = 5, j = 10, k = 1;
printf("%d\n", k > i < j);
Why does it print out 1?

udjat
- 479
- 2
- 10
0
votes
1 answer
Complex query taking too long to run
I have a query (original question that has table structure too) that is perfect, but it creates a temporary table which unfortunately takes like 12 seconds due to amount of data. (1 table has 95k records, another 155k, and another 21k).
Is there…

zen
- 1,115
- 3
- 28
- 54
0
votes
1 answer
SQL - Check for dependents of a single table
Lets say you have a table(A) holding a limited amount of data, and one of the fields being a primary key is being referenced by not one, but many foreign keys from other tables.
The foreign keys of these tables have constraints against the before…

Flosculus
- 6,880
- 3
- 18
- 42
0
votes
4 answers
Ruby on Rails: One to many relationship view
New to rails and trying to get a one to many relationship up and running. I have it working in the Model and Controller, but I'm having trouble getting it up and running in the views.
class Project < ActiveRecord::Base
has_many…

easement
- 6,119
- 3
- 29
- 36
0
votes
1 answer
Difference between File System and Storage system on DB2 UDB server
We are having a DB2 database on a server. We are repeatedly getting file system full error which goes away when DBA temporarily increase file system capacity.
When we have database installed on , isn't the data stored on disk or storage system ? …

Vishal
- 279
- 3
- 8
- 18
0
votes
1 answer
relational type operation on key value storage
in my objects table i have
id | type | parent | order | created
and then in my data table i have
object_id | key | value
i want to get object of type 'x' where key 'y' === 'z' in the most optimal way possible.
ie. get user where slug ===…

Wayne Ashley Berry
- 539
- 5
- 13
0
votes
1 answer
sql query for student schema
I tried solving the below question. I just want to make sure if I am correct.
student(student-name, street, city)
offering(department, number, section, time, population)
titles(department, number, title)
enrollment(student-name, department,…

user1214208
- 93
- 8
0
votes
1 answer
Django relation doesnt work?
I have the following in models:
class Companies(models.Model):
ComName = models.CharField(max_length=255)
ComURL = models.CharField(max_length=1024,null=True)
class Products(models.Model):
PrName = models.CharField(max_length=255)
…

R0b0tn1k
- 4,256
- 14
- 46
- 64
0
votes
2 answers
How to find all documents in a database created by many different users?
I need to find all documents in a database which have been created by x number of users and the result must be a combined (sorted by date) list/collection of documents from all these users.
so I have a multivalue field that contain e.g 100 users, I…

Thomas Adrian
- 3,543
- 6
- 32
- 62
0
votes
1 answer
I need guidance to design a MySql database
Please, I need some help to design a database (as better as posible). I have a set of products made with diferent sizes and customers can create Orders asking for many products and variables quantities of each of their available sizes.
My doubt es…
0
votes
2 answers
Optimal storage of checkboxes / multi-select in MySQL
Situation: Users will select up to ~10 options via checkboxes / mutliselect. There may be as few as 1 or up to all 10 options selected. I am looking for the best method to store the data in a mysql database such that:
(1) Queries to pull this data…

peter986532
- 43
- 1
- 4
0
votes
1 answer
Adding a sub query to an already giant query
This question is kind of a follow up to this question I asked a month ago.
Here are my three tables.
Fighters
fighter_id | name
-----------------------
1 | John
2 | Steve
3 | Bill
4 | Bobby
Events
event_id | …

zen
- 1,115
- 3
- 28
- 54
0
votes
2 answers
Quick tips on relational database design for MySQL
I have a webapp I'm making that stores user information, and their preferences regarding the app. Is this something worth splitting into two databases? I was thinking one table "users" with fields "id, useridfromFacebook, facebookRealName" (so 1,…

Alex Mcp
- 19,037
- 12
- 60
- 93
0
votes
1 answer
Pulling in relational database fields
So here's my problem. I have three tables:
Person Table
person_id, name
Events Table
event_id, event_name, event_date
Matches Table
match_id, person_a, person_b, winner, event
So in the matches table, person_a, person_b, and winner are integers that…

zen
- 1,115
- 3
- 28
- 54
0
votes
2 answers
data structure for tables
If I have a table with each row representing a record, and there are several columns. I want to do fast queries and sorting on any of the columns. What data structures can I use?
I want to be space efficient. Otherwise, I could cache sorted results…

Qiang Li
- 10,593
- 21
- 77
- 148