Questions tagged [table-structure]
59 questions
1
vote
2 answers
How to set a calculated column using a subquery
I have a table to which I would like to add a calculated column. The query I want to set it to is more complex than a standard arithmetic operation and I am unsure how to set up the calculated column using the query. I attempted to use an ALTER…

D.Yvel
- 39
- 2
- 6
1
vote
0 answers
How should I setup my mySQL tables for this simple php points system?
Hello I am trying to figure out the best way to setup my two mysql tables for a simple points system?
What I have:
1 - users table with id (unique),name,email,etc
1 - points table with id (auto incrementing),user_id (corresponds with id field in…

DigitalMediaGuy
- 421
- 1
- 5
- 18
1
vote
2 answers
Ruby on Rails - error running server
am currently working on a rails project. When i tried to start rails server its throwing the following error:
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to…

Abhiram
- 1,459
- 14
- 23
0
votes
1 answer
Database table structure Guidance
I am trying to build a web application that enables users to refer people to the site. A user can refer up to 10 people to the site and can have up to 7 generations, meaning that each person referred to the system by a referred user will be related…

Syma
- 574
- 1
- 4
- 11
0
votes
1 answer
PHP / MySQL PM System with multiple recipients table structure?
I'm currently developing a PM system for a website, in which users must be able to send PM's to multiple recipients. Naturally, this means that if a message has been sent to user A, B and C, user C could delete the message while user A and B…

carlo
- 700
- 2
- 9
- 25
0
votes
0 answers
Is it okay to store multiple data types in a single varchar column in SQL?
Are there any problems with creating a long table in the format below where the "Value" column contains multiple data types stored as a varchar(max). I'm trying to avoid infinitely many columns and in this format I can avoid that, especially when we…

learning2cod3
- 13
- 3
0
votes
1 answer
PostgreSQL query and table structure improve performance
I have a table daily_data to save entries, sales, hours(can be 100 types) of stores. My plan is to calculate conversion, entries/hour, sales/hour, ... of many stores(can be 1000 stores).
It can be data of 1 day, 2 days or months,…

sontd
- 397
- 2
- 4
- 15
0
votes
0 answers
mysql dump file missing table structures and data
I'm running the following command in mysql to dump a database:
mysqldump --login-path=bc --single-transaction --routines my_database > /tmp/my_database
The dump file that is generated only contains variables, and no table structures and data.
-…

ComputersAreNeat
- 175
- 1
- 1
- 11
0
votes
3 answers
SQL - how to keep track of "simple relations"
I hope somebody can edit my title to better describe what I mean, because I don't know exactly what this would be called. However, consider this setup: I want to create a notification system, where a message is displayed to a user until he clicks…

Mala
- 14,178
- 25
- 88
- 119
0
votes
1 answer
Laravel the right way for Many to Many table structure
I'm having a many to many relation. Lets say that I have Many users that can be in Many groups and the other way around.
I wan't to make a table that contains the following columns
group_user
id / name / user_id / group_id
Since I have only 3 groups…

Kristian Vasilev
- 504
- 8
- 26
0
votes
1 answer
Many employees have many courses which have expiry dates
I'm looking for the best way to store this information. Not every course has an expiry date.
The easiest way I've found so far is:
tblEmployee
-----------
ID (pk)
Expiry1
Expiry2
tblCourseCatalog
----------------
CourseID(pk)
Name
For every course…

Scott
- 37
- 5
0
votes
1 answer
Excel lookups function to find a structured table and column
I have a worksheet with a bunch of tables. The tables are structured, however the Titles (TABLE1, TABLE2) are not part of the actual table. I am trying to make a function that finds which table corresponds to the Title and then looks up at COLUMN3…

Thomas Price
- 81
- 7
0
votes
1 answer
SQLite Table Structure for Creating a 1:Many Index Relationship
Problem
Can't create a table with an index column that references multiple rows in a table. Picture example below of what I'm trying to create.
Overview
Imagine an (SQLite) table will hold stock dividend payments. The index column is set to the…

Adestin
- 153
- 3
- 15
0
votes
0 answers
Output a table structure for posting on SO
Forgive me if this is a meta question - if so I'll quickly move it.
I would like to be able to output a table structure in the format often used on SO, so that when I post questions, I don't have to do time consuming reformatting. I've often seen…

mseifert
- 5,390
- 9
- 38
- 100
0
votes
1 answer
Asking opinion about table structure
I'm working on a project to make a digital form of this paper
this paper (can't post image)
and the data will displayed on a Web in a simple table view. There will be NO altering, deleting, updating. It's just displaying (via SELECT * of course)…