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

-4
votes
0answers
17 views

Calender recurrence logic with daily/weekly/mothly patterns [on hold]

I'm working on a Webapplication, which stores the data of Fueling system in a periodical manner. i have fuel table in my Sql server DB, which normally stores the fueling details. ...
2
votes
1answer
27 views

Time attendance module design

I am working on time attendance module and I managed to read the data from the timing machine in the following format: Id CheckIn Type Status 0000142 5/15/2015 6:00 PM 2 OK ...
-1
votes
0answers
48 views

Student Attendance Database - Circular reference [on hold]

I would like to store student attendance in table where I have created two attendance_master and attendance_detail tables. Similarly I have enrolled_master and enrolled_detail tables where students ...
-1
votes
0answers
60 views

Database design in Python? [closed]

I need to design a teaching staff timetable database. The times for all subjects are fixed: my job is to assign staff to classes. There are plenty of database modules and staffing apps available, ...
-2
votes
1answer
58 views

How to design database to keep list of special members among all members? [closed]

I want to design Database which works as below explained. We have some members and they are listed in many categories. Among members, some have special privileges. We have Memeber Table We have ...
1
vote
1answer
29 views

How to structure a reservations system in a document based database?

I really don't know if this is the right forum for this but I need help designing my database. Also I apologize for the horrible title: I don't know how to summarize the issue below in a single title. ...
2
votes
1answer
86 views

What is the best way to store a formula in a database for a table driven formula? [closed]

So I am changing my code over to a table driven formula system to make it sustainable in the long term. So basically I have 5 foreign keys that will get me to a single formula to use. However I'm ...
0
votes
0answers
94 views

Should I ask for the state in a registration form for new clients who live in the USA? [migrated]

Basically, on almost every international site, they ask for the united state you live in, once you selected that you live in the USA. Right now I'm programming a registration form for an Austria ...
2
votes
2answers
121 views

Handling insertion to database with Repository pattern

I have a design question for working with databases in object-oriented PHP. I have a table in my database called products. Then I have 2 classes for this table in my PHP project. ...
2
votes
2answers
81 views

One table for all transaction VS. Table for each user

I'm making a website which has to do with money transactions. Everything was okay untill I came across the dilemma Should I have one table to store all transaction history or I should have a ...
2
votes
2answers
76 views

How to design a relational database for user following other users?

I want to design my relational schema to store information about users following other users. So if user1 is following user2 the schema will be as below user_follow ------------ |user1|user2| -> ...
2
votes
3answers
63 views

Table design for holidays

I'm creating a system to store holidays and events. I have a basic understanding of the schema for the static dates (every 23rd of march for instance). My trouble lies with the relative dates (i.e. ...
1
vote
3answers
112 views

DB Schema design : single table with more columns vs multiple tables with fewer colomns

What would be better DB design for a social network website. A single table with more columns and less rows or multiple table with fewer columns but more rows. For example: User can post an update on ...
-2
votes
1answer
38 views

How to design task assignment system?

I want to design a system which is similar with stackoverflow review feature. That is to say: There are n tasks, which should assign to users (users count is unknown). At one time, one task should ...
0
votes
2answers
144 views

Why should I use lookup tables at all?

This question confirmed, what I was already aware of -- instead of directly storing strings in table, I should rather use integers or enums and join them with lookup table, to get, as a result, ...
2
votes
3answers
120 views

At which point using string-based enums can become a real problem?

This is a direct follower to this question. An answer given to that questions says (my understanding), that nowadays using string-based enums instead of integers isn't a much problem, because hosting ...
1
vote
3answers
85 views

Using auto-increment clustered key and guid primary key together

My boss is the db administrator in a new software project and he came up with that design where every table will have both a auto-increment clustered key and a guid primary key (or possibly composite ...
1
vote
0answers
32 views

Adding fields a good use case for EAV? [duplicate]

Is being able to add fields quickly to a system a good use case for EAV? What would be the frequency or number that would justify using an EAV model?
2
votes
1answer
79 views

An approach to multilingual db design

My boss is planning on a new db and wants to support multilingual data in this manner: LocalizedDescs (Guid / LanguageGuid being the primary key) Cluster Guid LanguageGuid Desc ProductCategories ...
0
votes
1answer
45 views

Generation of ids in offline/online application

I'm a bit confused about how to identify the elements in my application. I have a rest backend with an sql database. I'm currently using numeric (autoincrement) ids as primary key and use these for ...
0
votes
1answer
36 views

Storing Multi-select and Single-select data together

I've got a database with some multi-select fields. To keep it simple, let's just say those fields are MatchGender and Interests. I want users to be able to find people who match (hence Gender is a ...
1
vote
1answer
95 views

CMS with unknown data structure [closed]

I am looking to build a sports small application, but I would like to build it so other people/organizations could use it as is. These would be separate apps, not one app that caters for all. For ...
1
vote
2answers
197 views

NoSQL or MySQL? [closed]

I'm developing an app that requires to save data that is not consistent across all rows. These database entries represent different kind of sport activities. Let's take an example: In football the ...
0
votes
1answer
60 views

How to handle rating? [closed]

I want to implement like/dislike system, but I don't know how to achieve best performance. I have to tables: blog posts and comments that need rating. Should I store all data in one rating table? Or ...
1
vote
2answers
139 views

One Enum vs Multiple Enums

I am developing an application where a user submits a mission and other users accept the mission. Pretty simple. I want to keep a track of the mission progress status and store it into a database. ...
0
votes
1answer
50 views

Database design for linking parent & child relationship

Currently i have requirement saying user from an UI creates there own forms which has types textbox,choicegroup etc.. Does anyone have a any idea on how to architect the database to store all data? ...
2
votes
1answer
71 views

Use of tenant_id in multi-tenant database

We are building a SASS web application where every company will be using its own database schema. Using postgresql, there is a table 'companies' in the public schema that holds the name of the company ...
2
votes
2answers
100 views

Is normalization all that's needed to ensure data integrity and quality reporting?

I've gotten out into the real world recently, and for the first time have had to really think about database design, as I've been developing across the entire Java stack. With that I've realized that ...
0
votes
0answers
26 views

Cascading ACL and drill-down data architecture

I want to implement a drill-down data architecture based on the data and the ACL permissions of a user. Lets say we have data of employees of an organization and lets consider the hierarchy as ...
4
votes
1answer
123 views

How to store data that is recorded with different frequency?

I'm writing a metallurgical web application, that must store data (electrical parameters) recorded at different frequencies. For example: six parameters recorded with frequency of one measure per ...
11
votes
2answers
512 views

Why store flags/enums in a database as strings instead of integers?

I've been browsing SQL dumps of some famous CMSes, including Drupal 7, Wordpress (some quite very old version), and some custom application based on Python. All of these dumps contained data with ...
1
vote
1answer
102 views

Is there a valid symbol for “two or more” with Crow's Foot notation?

I have a database design for which one entity of Class A always has at least two entities of Class B. Can I express this with valid Crow's Foot notation? One possible idea I had was this: Excuse ...
1
vote
1answer
63 views

SQL - Designing a Threshold value table

I need to design an SQL table to be used for "threshold" or special values, which in general would have the following properties: - key - value - comparer (less than and greater than as a start, ...
0
votes
1answer
77 views

How to represent a Model with a 1:N relation?

I have a task to associate 1:N documents to a record in my hardware table. This file could be a warranty, or whatever. In SQLServer I set up a FileStream group and made a table for only the file and ...
1
vote
3answers
242 views

Are there any good reasons to use ER Diagrams instead of UML Class Diagrams for data modeling? Is ERD the COBOL of data modeling?

Are there any good reasons to use ER Diagrams instead of UML Class Diagrams for data modeling, given the fact that class diagrams subsume ER diagrams? Or is it just for historical reasons because ...
3
votes
1answer
43 views

Architecting a SaaS for backwards-compatibility in regards to data and business logic

I have a SaaS platform where the user fills out a form and data entered into the form is saved to a database. The form UI has a large amount of config (originates from the DB but ends up in ...
11
votes
5answers
438 views

Version controlling a database's contents

I'm working on a web project that involves user-editable content, and I'd like to be able to do version-tracking of the actual content, which lives in a database. Basically, I want to implement ...
0
votes
0answers
45 views

MySQL Database normalization for a user model

I currently have a MySQL Relational Database with a users table with the following attributes: ID (Primary key) Name Username (Unique) Password Email (Unique) Description Profile Picture File Path ...
1
vote
1answer
28 views

Recording many data items and retrieving time-based snapshots

I have a .Net Windows application that continually receives data from a hardware device. Additionally, the user can change various settings and parameters from within the software. I would like to ...
1
vote
2answers
173 views

Database Design for Inventory

I am starting to design a typical product based MySQL database but I keep running in circles on how to design the tables. I have many types of products Jeans Tshirts Dresses Which have many of ...
4
votes
3answers
227 views

Fine grained search over a large dataset

I have roughly 4 million records per day and have to keep 7 years worth online, so we are looking at 10.2 billion records that I need to be able to search through. The users are expecting that the ...
0
votes
2answers
38 views

Groups relationships - Detailed or Direct?

Current design I have a Person model: PersonId Name ----------- ---------------- 1 Jessica 2 Jennifer Then I have a ShareModel which have the ...
47
votes
7answers
5k views

How can I argue convincingly against duplicating database columns?

I've started working at a new organization and one of the patterns I've been seeing in the database is duplicating fields to make writing queries easier for the business analysts. We're using Django ...
1
vote
1answer
100 views

Likes / Stars / Following - same or separate data structures? [duplicate]

I am building a social network, which will have standard features of 'likes' (upvotes) for posts, 'following' between users and 'stars' for favorite posts. These might reasonably expand in the future ...
1
vote
1answer
178 views

Am I planning my database/backend correctly?

I'm an iOS developer and to be honest I'm not really looking to become a database expert right at this moment, but I do need to know how to properly plan out what I believe to be a pretty cookie ...
4
votes
1answer
47 views

Modular Database, Inheritance of Schema

Consider multiple relational database schemas that have an inheritance dependency structure as known from OOP systems: Tables are just a placeholder for arbitrary database objects such as Views, ...
2
votes
1answer
56 views

Is it good practise to have the class name as a prefix in Django model?

I wrote a model in this format in Django: class Block(models.Model): block_id = models.AutoField(primary_key=True) block_name = models.CharField(max_length=200) block_code = ...
2
votes
2answers
102 views

Notifications table design?

I'm trying to create a notification system for my social network. But I'm stuck on the database design. so when a user comments on another user I want to display "X commented on your post." or when ...
3
votes
3answers
99 views

Secure DAL Design using Stored Procedures

I normally avoid sProcs as much as possible. I dont like the language be it TSQL or PL/SQL; they seem archaic against Java/Dot-Net which I use. I go for them when a routine needs to fetch a lot of ...
1
vote
1answer
53 views

Object Storage where Object Type is variable

From time to time, we come across a problem where we must store an object, but we don't know in advance what kind of object we're going to store. I'm going to give a very simple example. Requirement: ...