Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [database-design]

The development of the conceptual schema and/or the logical model and/or the physical settings of a database.

-2
votes
0answers
23 views

it is fine to create DB table per player or game? [on hold]

Agents takes multiples input from different players Every Agent can view logs of records and plays the inputs can readable and can find minimum repeated and maximum repeated also non repeated values. ...
-2
votes
0answers
34 views

how to employee leave application days mentioned in attendance table? [on hold]

I am first time working on employee leaves management system.so need help that if employee take leave from 01-01-2019 to 05-01-2019 means 5 days then how these days will mentioned in attendance ...
-1
votes
1answer
28 views

Is it efficient to design chat/likes/relationship database in separate table per user? [on hold]

The specs: there would be about 1 billion users there would be probably 1 million topics each topics has subtopics stored at the same level as topics user has many to many relationship with topics (...
2
votes
0answers
29 views

How To Query Databases in Subject-Predicate Format?

I have csv data in this format: id fieldname fieldvalue -- --------- ---------- 1 fieldA A1 1 fieldB B1 2 fieldA A2 2 fieldA B2 If I upload this to MySQL, how can I ...
0
votes
0answers
21 views

How do I force a selection of items to a specific user/database row?

I have a database that allows a company to register, then the user of the company can register individual "user" accounts. The company administrator (who sets up the company account) can log in with ...
0
votes
0answers
17 views

is there Better way to do this kind database schema design, mysql

P.S. Hopefully I am not posting in the wrong place. If I am, please let me know where to post. I am currently using laravel with query builder instead of eloquent for a small self project. I am ...
0
votes
0answers
13 views

Model multiple 1-m relationship to a single entity

I have an entity called Box. This box has a from property which could be from a variety of different entities. It could be from a user, office, import, storage and many more. So far I can think of ...
1
vote
1answer
18 views

Subset of Unordered Pairs of Distinct Primary Keys With Normalization

I am currently in the process of designing a database. I have one table as follows: CREATE TABLE Set ( id INT PRIMARY KEY AUTO_INCREMENT, -- other values ); Now I wish to create another ...
0
votes
2answers
40 views

A table with many null values VS many tables

Basically my level of DB knowledge enables me to create, select, delete and some simple things. When it comes to designing for performance, I have absolutely 0 knowledge. So my question here is let ...
1
vote
0answers
25 views

Basic company and user registration database - Pulling my hair out

I have now created a partially working database, although I feel I have over complicated things, and also, not sure where to add the extra tables/relationships required. First off all, I have a ...
0
votes
2answers
31 views

Postgres jsonb vs composite type performance differences

What considerations are involved in choosing between a jsonb column and a composite type column of the same structure? For example, consider a column like that used in the Postgres documentation: ...
1
vote
2answers
52 views

Poor SQL Server Performance With Nested “OR” Conditions In LEFT OUTER JOIN

I have a tricky bit of SQL that's giving me a bit of trouble. I'd like to introduce several new columns to a key table whose components may or may not be used based on user configuration (Dimension's ...
-3
votes
0answers
15 views

Object Model Question [on hold]

-3 Fluffy and Bushy (F&B) is a US based veterinary clinic that treats animals in the US. There are several clinics throughout the country. They assign each clinic a clinic ID, and they need to ...
1
vote
1answer
27 views

Converting (a) an entity-relationship diagram about an airline booking scenario to (b) a relational schema

I am currently following notes on a certain "7 step strategy" to transform an ERD to a relational schema and was wondering some points about step 4, converting one-to-many (1:N) relationships. The ...
1
vote
0answers
15 views

Cardinality with specialization in enhanced entity-relationship diagrams

I'm currently taking an introduction course to databases and I've come across a problem not described in the textbook. I'm wondering about the use of cardinality with the use of specialization in ...
0
votes
0answers
29 views

Multiple JOINs of possible properties in a 'flower' arrangement - acceptable design?

I have a functionality that has multiple (7+) potential properties to be added via a central 'hub' table. In most cases there will only be one property assigned, but it's possible the user will want ...
0
votes
1answer
45 views

Ensuring unique value for group of rows in table with trigger and concurrent transactions

I've seen similar variations of this question asked, but nothing that tackles this particular implementation and I was wondering if it was possible to do with sql/plpgsql. Take this as more of a ...
4
votes
0answers
51 views

Which data model/schema to apply to a timeseries datastore for data sources with varying fields

I'm asked to develop a data-storage for time-series data, yet despite significant research I'm unsure about the data model and storage technology to chose. About the data The source data which is ...
2
votes
2answers
50 views

Which database management system type to choose for price tracking? [on hold]

I'm writing a price tracking application. Every day I need to store price information about ~15M products. (So it's about 15M * 365 = 5.5B records per year). One product has many prices over ...
0
votes
0answers
20 views

Need an efficient mysql database schema to store points/ratings

I have four main tables- 1.user(user_id, name,...) 2. post(post_id, description, ...) 3.comment(comment_id,user_id,comment,...) 4.reply(reply_id,user_id, reply,...) and 5.user_post(user_id,...
1
vote
1answer
53 views

SQL Database structure to store calculations

I am in the process of designing a database structure to store some calculation information. Information about the problem: Each "calculation" is a collection of scripts allowing to calculate value, ...
0
votes
0answers
35 views

[MongoDB]See Collections (and Files) created in a Shard on the Cluster

My structure: A Sharded Cluster with multiple Shards. Each Shard contains 1 Collection, which is pinned to it by tags. Every Shard is at the same time a ReplicaSet Secondary. It receives data from a ...
-1
votes
0answers
42 views

Database Design for Study Hall Reservation (with shared chairs) [closed]

Suppose we have a study hall that we want to implement a reservation system for it. Users could reserve specific time-span as "fromDate" and "toDate" by a calendar. Every Valid selected time span ...
-1
votes
1answer
19 views

What does it mean, when database is said to be using real-world entities in its design? [closed]

I'm currently beginning to study database management system and I always encounter this problem i.e. how these real-world entities are stored in database. Also, I don't understand in what form a ...
1
vote
0answers
13 views

Best practise for data dump 'entry point' in DB processing chain - PostgreSQL

I need to implement a process chain to transform and analyze potentially large sets of data, inserted both programmatically and manually (e.g. CSVs). In either way, the input data is standardized in ...
-2
votes
0answers
61 views

3 question about database. i hope any one help me. i will be so gratefuel [closed]

hello i hope everyone is fine. may i ask for help please? i am beginner in the programming filed. i try to build my own app and i got confused in the database so i hope anyone helps me i will be so ...
0
votes
1answer
23 views

Uncertainty about number format in MySQL

In Oracle Database, fields like this: example number(6,4) not null; Indicate that I'm reserving 6 digits for this column, 4 that are being used from the point to the right and 2 for the point ...
0
votes
0answers
17 views

Database Design to Store Events Which Have Different Required Attributes

I am building a billing database for my office. I am planning to write a set of queries to determine time overlaps because my users get billings per minute. In order to do this each user will have a ...
0
votes
1answer
41 views

Is it Possible to have a database table table of morethan 3000 fields [closed]

I have a form of more than 3000 fields and i want to create a table without splitting it into two. Is it okay? Or it will have problems?
-1
votes
1answer
32 views

Default value for new LastModifiedBy column? [closed]

We want to add a new column LastModifiedBy to all tables in an existing schema. Value is updated by the application platform on all inserts/updates and is populated with the application user (not ...
0
votes
1answer
43 views

Database Design - multiple tables

I am trying to build a database that has all of our employees, their skills, and the level of their skills. The idea is that a manager could go in, type in a skill, and relevant employees are returned....
0
votes
2answers
33 views

How to model very flexible referencing relationships between many tables?

I have various different entity types in my database. For purposes of example, consider an IMDB database: Movie Person Actor Director Translation and 20 more tables My application enables free-form ...
1
vote
0answers
15 views

redesign database around selecting rows by time range

I currently have a MySQL database that grows about 50,000 rows a day. When querying data out of the database, I query information from the info table and use a subquery on the session table to refine ...
1
vote
2answers
37 views

database design for song position under play-list

I have a music streaming application where I have playlists. Each playlist has maximum 100 songs. I have a mapping table called PlaylistSongMapping which has the following schema +------+------------+...
0
votes
1answer
38 views

Table with only one column because of many-to-many relationship?

Right now I have three tables: person, alias, and person_alias. As suggested by the names of tables, one person can have multiple aliases and one alias can be used by many people, and hence I add a ...
1
vote
1answer
50 views

Hierarchical / tree data - which type of database to use & design?

For querying (and writing to) a hierarchical structure (like a folder containing files and other folders, up to n levels deep, where n is pretty small, probably around 10, and there would be lots of ...
1
vote
0answers
25 views

How can I store data with unpredictable data types in a table?

I'm currently working on a Headless CMS project and was wondering what approach would be the best for storing "fields" data in the database. Basically, users would be able to create a content model ...
-3
votes
1answer
25 views

Database design for multiple tenant application

I am building a web application where we have the concept of groups. A group can be roughly thought of like a Facebook group where you have a number of people attached to it. The DB for the app is ...
0
votes
1answer
67 views

Conversion failed when converting date or time from character string error?

i have a problem with this error i don't know why but i try many thing and search about it bout i didn't find any thing to solve this problem ( i want to make a query to calculate the age for the ...
1
vote
1answer
30 views

Should I create seperate referenced table or go with serialized data in a column?

I have a table with name app_client with the below fields id, user_id, name, age, phone, gender, related_entities_json (long text datatype), created_at, updated_at I have 200k+ records in this ...
4
votes
3answers
155 views

No Primary Key in some sql server tables

I have downloaded WorldWideImporters Database as a standard db (Microsoft Sample Database for SQL Server). In this db, some of the tables don't have primary keys but clustered indexes can be seen. Can ...
0
votes
1answer
18 views

Why the Accounting DB Schemas do not allow to maintain a clean Products Table?

As far as I know, the database schema of the vast majority of Accounting Systems follows this architecture: Considering all the FKs, I know that the product table is going to grow in time and, if I ...
0
votes
0answers
39 views

Database Design - multiple table for different types of transactions

Considering a trading system as an example. Would it make sense to have two different tables for credit transactions and asset transactions? creditTrans : table id userId transType status amount ...
-1
votes
1answer
39 views

Design with new table and old tables

I have to add a new table according to some new requirements, the model currently consists of two tables: DETAIL and SUMMARY. The relation is that every detail has associated one summary, so now I ...
2
votes
1answer
30 views

Prevent a user from making changes to some columns in a MS SQL Server database

I'd like to prevent a user from making changes to some columns in a MS SQL Server database. I cannot lock the column as READ ONLY as there will be changes made to that column. Let me explain as best ...
0
votes
1answer
47 views

Designing a data model for a survey; building the relationships

Let's say I have a survey that will be handed out to many people. I have a hypothetical diagram with User, Question, and Response entities. Should my relationship be one-to-one from question to answer?...
2
votes
0answers
59 views

Need help designing golf pro scheduling into POS [closed]

I have an existing Point of Sale app that is used for golf courses. I have a new feature request from one of my courses that would allow users of my POS to sell golf lessons to customers. Here are ...
0
votes
0answers
16 views

Saving records in MySQL that does not pre-exist

I have asked this question on SO but believe this is the right forum to ask, so here it is Let say, I have a pre-defined table called cities, with almost all the cities in my country. When a user ...
0
votes
2answers
29 views

How to model a relationship with different roles of users

I am creating a new project and currently modeling the relevant business domain. I am hesitating to choose one solution over another. Consider the following case. There is an order, the order has a ...
0
votes
0answers
40 views

I have a strange DB structure is this correct?

I have the below scenario, i want to confirm that is there any better way then this db structure or is there any need of improvement for my current database table strucutred? I have 3 modules 1) ...