For questions about structuring the data within a database. How to lay out tables, whether to use a relational DB or not, etc.

learn more… | top users | synonyms

5
votes
7answers
848 views

Priority list of tasks stored in a database

I am trying to think of the best way to do the following: I have a list of tasks stored in the database. A task has a priority assigned to it. You can change the priority of a task to reorder the ...
1
vote
1answer
65 views

Designing tables for recording rounds in a game

I'm working on website for the game of bridge and I am process to designing the table to store the bidding. Shortly about the bidding. 4 people at a table will bid clockwise until 3 players has ...
1
vote
1answer
71 views

Inventory Management System Design Problem “Items Packages”

I am developing a retail management system with inventory management module, I am facing a logic design problem and I don't really know how to address the problem in an easy way, so I wrote an example ...
3
votes
2answers
63 views

How to handle unexpected schema changes to production database

Is it a common or normal practice to encounter schema changes, especially renamed or removed columns, in a production database, without having been notified of the change? If unexpected schema ...
1
vote
1answer
96 views

Design Application to “Actively” Invite Users (pretend they have privileges)

I am designing an application where users message one another privately, and may send messages to any Entity in the database (an Entity may not have a user account yet, it is a professional database). ...
0
votes
3answers
58 views

Maintaining indices for location in a sorted list in database rows

I have a fairly simple data structure like this: create table project (id int auto increment primary key, name text); create table item (id int auto increment primary key, name text, project_id ...
0
votes
0answers
28 views

Redmine - Database Structure/Normalization

I am using redmine for project management and issue tracking. I was looking at the database tables and the underlying structure and was wondering if anyone who is experienced with database ...
0
votes
1answer
123 views

Best way to implement database design for a set of entities

Lets say I have a scenario like so: I have many claims to get money from another entity and this claim has to go through two gateways. This claim is sent from an origin system and can possibly be ...
0
votes
1answer
40 views

Whats a good structure to save and retrieve locations of images?

I got a java-ee application, where I collect informations about movies. Im my backend I provide data like the name, description, genre and a random uuid. I also got lots of related files, which are ...
0
votes
1answer
56 views

Relationships in a Chen ERD

I am working on a Chen ERD to model our organizations merchandise. Our central entity is a Style. We have supplemental entities of Color and Season. I am defining our assortment as the ...
0
votes
1answer
17 views

Place measurement data in database (access)

In a software I use records of measurement data. Each record contains basic information like a name, some parameters and the actual measurement data in the form of three arrays of double values that ...
1
vote
1answer
71 views

Database Schema Data Independence [closed]

I'm currently reading about database schemas about how the three-level ANSI-SPARC architecture works and i'm a bit confused about a concept it's talking about. My question is what would happen if an ...
1
vote
1answer
65 views

How to choose data storage method for user generated data?

In a program I am writing, I have 3 different ways to store user generated data: (a) XML Files for each object (.Net Serialization) (b) SQL Database (MSSQL) (c) Massive terrifying blob of data in 1 ...
0
votes
1answer
55 views

Dividing database between MySQL and NoSQL

Mine is a typical website developed with LAMP stack. Due to scalability issues we are planning to incorporate NoSQL for the application. For the implementation, we are planning to implement hybrid ...
-1
votes
1answer
93 views

Should We Use Surrogate Primary Keys for Every Table? [duplicate]

We are developing a data model for a marketing database that will import transaction, customer, inventory, etc. files and the directive is ONE process that works for every client. We have been told ...
0
votes
1answer
72 views

Examples of designing a database that handles point tracking?

I'm attempting to expand my knowledge of how database designs and concepts work. I'm working on a hobby web/mobile app for practice that will challenge me. However, I am running into an issue. What ...
0
votes
0answers
29 views

What is a good way to store geographical data for distance calculations

What would be the best way to store data in a database for geographical calculations? Say I have an ItemsForSale table paired to a Users table which holds their geo location. I know I can use latitude ...
0
votes
0answers
8 views

Globalizing geographical information in data design

I am building my database/models/viewmodels right now and can't think of a good variable name to define for the equivalent of a "state" in other countries. I currently have Country and City which are ...
1
vote
1answer
70 views

Database design: circular reference but dynamically created

I am trying to design database for this case: Assignments have vectors, relation is 1:N Assignments have submissions, relation is 1:N Submissions have executions, relation is 1:N Every execution ...
2
votes
1answer
76 views

Refactor an old model of a LastUser Modification on every Object?

I have a software requirement, that needs to store the user that made the last modification to another object, for every object (assume that all objects are already mapped and into a BD). So we have ...
9
votes
2answers
1k views

What is the difference between collation and character set?

I have a general question about databases. We usually use the term collation with databases. I would like to know how its different from character set. I guess collation is a subset of character set. ...
1
vote
3answers
63 views

What are the use cases for these relationship types?

Use Case What are the use cases for creating a one-to-one relationship where the parent points to the child compared to a child pointing to the parent? If there is no difference, is one preferred ...
0
votes
0answers
41 views

Database Design for Web based RSS Feed Agreegator

I am working on an open source application which can allow users to add RSS feeds. All users of the site can read the content of those RSS feeds. It's not just for user's own feeds. Using PHP and ...
3
votes
2answers
154 views

Is it right to persist a computed property to the DB?

I would like to know what do you think about persisting an "autocomputed property" to the database. For example I have these properties decimal Price {get;set;} decimal Tax {get;set;} decimal ...
2
votes
2answers
147 views

Implementing bussiness logic with a large number of business rules and processes

We are currently working on a project that heavily relies on a database. Among many tables the main focus is on table "data" which is linked to another table "data_type" as many-to-one, which is then ...
1
vote
2answers
264 views

What must I take into consideration when designing a UI around a 0..1:1 relationship?

I'm designing the database schema for a new product feature. In my current design I have some related optional data. Rather than have nullable fields I have a separate table with a 0..1:1 relationship ...
0
votes
1answer
69 views

Database design grouping many tables with their common fields [closed]

Is this a valid DB design? A user can create an organization, link as many offices to it, have an inventories that host items linked to organization or office, have clients for his business etc. | ...
1
vote
1answer
45 views

Design: Mixed XML / Relational or Pure Relational?

Is it acceptable to model a very complex object graph using XML in the database, but leave the rest of a system in relational tables? I'd like to gauge opinion on this as I've hit a bit of a ...
12
votes
4answers
511 views

Is it bad practice to allow user defined fields?

Generally speaking, is it considered bad practice to allow for user created fields in a database for a webapp? For example, I am making a home inventory webapp for my wife, and she is going to want ...
1
vote
0answers
73 views

Should I really need to implement event sourcing is this case?

An example of use case when event sourcing is applicable here whose excerpt is: Say, something went wrong in your app and as a result, a user gets blocked for abuse but that user claims to not ...
1
vote
2answers
82 views

in multi-tenant systems what is the correct practice for segregating each tenants data from each other?

I am a first-time azure developer and I am taking over a single-tenant cloud system and have been tasked with converting the system to multi-tenant. What is the correct practice to separate each ...
0
votes
0answers
24 views

Using a single table for identity and metadata

I'm in the early design phase of a project to provide an e-commerce platform that will require several entities to be modelled, products, customers, orders, CMS pages, etc. They will all have a few ...
2
votes
1answer
91 views

Is it substandard if I have multiple tables in my database yet there's no relationship at all? [closed]

I have multiple tables in my database. Some tables have relationship to others and some don't have. My friend told me that it is not advisable to have a table that is not related to others. Is it ...
0
votes
1answer
170 views

Ruby on Rails database using static lookup tables or constant strings

In some ruby on rails projects, I have seen instances where strings are used instead of a foreign key reference to a lookup table. I usually code in C#/SQL Server and use lookup tables, but am not ...
13
votes
7answers
1k views

What special considerations are needed when designing databases to hold financial records?

I hope this question isn't too broad. In the future I may need to add some accounting and financial-tracking systems to some applications (mostly web-based applications, but my questions pertains to ...
0
votes
0answers
39 views

Avoiding pitfalls of a naturally recursive relationship between tables

I'm developing a system to manage "cases". There will eventually be many different "kinds" of cases, so I've started with a "CaseTemplate" table that can be used to define what a case looks like and, ...
1
vote
1answer
37 views

How to represent one special related record

I have two tables, project and photo. photo has ID,projectID,path : each project has multiple photos. Now one of these photos is the one that has to be displayed. The question is how to represent ...
0
votes
0answers
54 views

What's the best way to hold features in a database?

taking for example an application that holds Companies and as we move along time, more and more features are needed. I do tend to hold everything in the Companies table, but I rather get some input ...
0
votes
2answers
45 views

Store the result of a complex but frequent database query, in another temp persisting table

I have a slightly complex SELECT query which uses a number of JOINs and variables inside it and the query is run frequently throughout the application. The result varies when one column is updated. ...
0
votes
4answers
93 views

should I store common data between two tables in a third separate table in my database?

If I have 2 tables in my database, let's say for instance 'buyers' and 'sellers' but I collect a common set of data for both for instance telephone number, email address, address etc. Is it better ...
3
votes
3answers
372 views

Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?

I have some JSON data in this format (5,000 instances for now): {"id":"123456","icon":"icon.png","caseName":"name of case"} I am allowing the user to search for the name of the case and then return ...
0
votes
0answers
19 views

database design for Media company in SQL 2008

I have to make the report for one of the client. There are three sources from I will get all raw data, so eventually I will have to marry those all data from different sources and make one report. ...
2
votes
1answer
61 views

Data Model for selling groups of products as one product

Say I have an e-commerce with a data model like the following, which allows a Sale to describe how a single Product is sold. This division allows a product to be sold multiple times in different ways ...
1
vote
2answers
102 views

How to store currency ranges in a Postgres table?

I am using Postgres 9.3. I have to store range data like <$250K, $250K-$4M, etc which we will display in a dropdown. now I am making a table for all possible options that can be configured from ...
2
votes
2answers
150 views

single table w/ extra columns vs multiple tables which duplicate schema

I am working on a project where at some point, I needed to make a decision on whether or not, in the database, I should have a single table with multiple columns that not every record uses, or ...
2
votes
3answers
163 views

Tracking correct order details in commerce database when modifying 'products'

I am implementing an ecommerce database. This is slightly different than most as the 'products' that are for sale are for services provided. For example a user (vendor) of the system may define a ...
2
votes
3answers
286 views

Which database schema should I pick?

I am planning a database scheme and I hesitate between two designs, which one should I choose? For the purpose of the question, assume we want to prepare a database scheme for an application managing ...
1
vote
1answer
40 views

How to validate (and group) User Listings in Marketplace

I am building a hobby marketplace (comic books). Users are able to list comic books they own for trading with other members. The problem I'm running into is that I would like to standardize the ...
4
votes
3answers
194 views

Designing a fitness / weight lifiting routine database

I'd like to create an app similar to Barbell Pro for Android, for practice / interest / educational purposes really. Or even as another example for database purposes, Fitocracy The problem is, I ...
3
votes
4answers
264 views

When should a database table use timestamps?

First a note, I thought maybe this question belonged in the database exchange, but I think it is more broadly related to a programming solution as a whole than to databases. Will move to database ...