Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
70 views

The project is a database for an online clothing store. Which tables are well normalized and which need to be normalized? DB schema of all the tables before doing any normalization: https://i.sstatic....
Renad Aiad's user avatar
0 votes
0 answers
47 views

We’re building a system where an offer can be redeemed until a global limit is reached. For example, an offer may allow a maximum total redeemable amount (e.g., 10M), or/and only allow each user to ...
tusharRawat's user avatar
Best practices
0 votes
2 replies
122 views

I’m designing a domain model where some entities evolve over time, and I need to keep a historical record of their state that can be retrieved later. A simplified example: A Credit Line represents a ...
MABC's user avatar
  • 605
Best practices
0 votes
5 replies
97 views

I'm developing a desktop application for gym management. One feature is a store for selling memberships and products. My client sometimes wants to sell something that is not in the inventory or ...
kitt51's user avatar
  • 11
Best practices
1 vote
1 replies
103 views

Our team manages a SQL Server 2019 data warehouse that’s grown to over 10 TB. It currently uses a single database with multiple schemas (clinical, financial, hr, operations, staging, etc.). Our DBA is ...
Raja's user avatar
  • 68
Best practices
3 votes
1 replies
115 views

I am creating an E-Commerce app. It has Category and Product classes. Both have multilingual descriptions, so, tables with title, description, meta-*, etc. and unique key (id, language_id). To add ...
qarabala's user avatar
  • 178
0 votes
0 answers
114 views

I have a table CREATE TABLE Person ( id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, home CHAR(2) NOT NULL ); where I would like the values of home to be either a country code or a ...
SBGO's user avatar
  • 9
0 votes
1 answer
62 views

I’ve been working on a React/Firebase app for the past 10 months, and things have been smooth so far. Recently, I decided to do some refactoring. I switched from using user-generated fields as unique ...
Emi Buliga's user avatar
3 votes
1 answer
138 views

I have two tables in Postgres with a parent/child relationship: CREATE TABLE table_a ( id SERIAL PRIMARY KEY, type TEXT NOT NULL, rundate DATE NOT NULL ); CREATE TABLE table_b ( id ...
AcrKnight's user avatar
  • 486
1 vote
2 answers
69 views

We have entities Teacher and Student; there are two relationships between them, supervision and teaching: Supervision is one-to-many, but teaching is many-to-many, which is a problem. To fix it, I ...
Sim's user avatar
  • 19
0 votes
1 answer
82 views

I have these tables in my PostgreSQL database: CREATE TABLE companies ( id INT PRIMARY KEY, name VARCHAR(255) NOT NULL UNIQUE ); -- Employees belong to one company CREATE TABLE employees ( ...
Rohit Menon's user avatar
-1 votes
1 answer
121 views

I have a table Languages: ID | ISO639 | NAME ---+--------+--------- 1 | EN | English 2 | DE | Deutsch 3 | TR | Türkçe (etc.) I have another table Headlines: ID | EN | DE | ...
rhavin's user avatar
  • 1,804
0 votes
2 answers
153 views

I want to create a database for my blog website where I have many posts and categories. A post can have many categories and a category can have many posts. I couldn't figure out how to implement it in ...
Hau Khua Lian's user avatar
-1 votes
1 answer
71 views

Why isn't it possible to add a column to a partition? From my point of view, the partitioning feature introduced in PostgreSQL is much more useful than table inheritance. Table inheritance shoots at ...
rela589n's user avatar
  • 1,224
0 votes
1 answer
59 views

I have an application that represents user-defined data in two views: A hierarchical view (parent-child nodes) A flat view (a table where all attributes are listed in a row) In PostgreSQL it handles ...
Oskan's user avatar
  • 21
-1 votes
1 answer
103 views

Table1 has roughly 50k rows, like this: Id Name Dob Device 1 Bill 09/30/1987 bira1 2 Kayle 06/12/1967 kale2 3 Gill 05/23/1976 bira1 4 Kane 01/30/1963 bira3 5 Hena 02/12/1978 kale1 Table2 has 200 rows: ...
HaiY's user avatar
  • 207
0 votes
0 answers
36 views

I'm designing a time-series application using GridDB Cloud to store sensor data from IoT devices. Each device sends temperature and humidity readings every 10 seconds. device_id (string) temperature (...
nazia ghous's user avatar
0 votes
1 answer
92 views

I would like to save objects like this to a local database. The object is a dictionary with various entries. For instance, the first entries are like: "id": "https://openalex.org/...
robertspierre's user avatar
0 votes
1 answer
63 views

I have an entity "MyEntity" which has some fields - "StartDate", "EndDate", "Color". It can have multiple records, and each record is sometimes updated. I need ...
user2957592's user avatar
-1 votes
2 answers
168 views

I am designing a database for a music player. I am already using SQLite to store music tracks in a table called tracks, containing a unique id. I need to add very standard playlist functionality: ...
goose_lake's user avatar
  • 1,637
0 votes
1 answer
87 views

I'm working on a SAAS product where we have a multi-tenant data model with multiple fields that are specific to tenants. I am using Kafka as a message queue and PostgreSQL as datastore. The way I ...
Farhaan Shaik's user avatar
0 votes
0 answers
167 views

I have a Trino that reads Parquet (which was converted from JSON) and wants to insert that data into a PostgreSQL database. When defining the Trino schema and creating a table, it is ok. But after ...
Prof.Plague's user avatar
-1 votes
1 answer
89 views

I'm trying to figure out how to balance security, performance, and best practices in the validation process of the data of a REST API and its interaction with the database. Say you have a book table ...
Observable Stone's user avatar
3 votes
3 answers
109 views

UserID First Middle Last Type CreatedAt 123 John Henry Doe Mage 03-28-2025 Let's say I have the following table above. I would like to create index to help speed up my queries. All queries would like ...
Alan Chen's user avatar
1 vote
0 answers
115 views

I have two transactional systems that is used for the same operational business activity: purchase order transactions. One system is legacy and the other is a new modern one. They have different ...
user121's user avatar
  • 801
0 votes
0 answers
65 views

I'm trying to implement real-time analytics on aggregated blockchain data. My database stores swap events (SwapEvent table) with information about tokens traded, amounts, and USD values. Currently, I'...
cjc02's user avatar
  • 1
0 votes
1 answer
201 views

From the book Fundamentals of Database Systems (7th edition) by Elmasri et al., pages 475-476: A multivalued dependency [MVD] X ↠ Y specified on relation schema R, where X and Y are both subsets of R,...
showkey's user avatar
  • 375
0 votes
1 answer
44 views

The server I developed with golang is divided into two categories when accessing the database. One category is data with redis cache, which is generated very frequently, but inserted into the database ...
progquester's user avatar
  • 1,896
0 votes
2 answers
207 views

I am working with SQL Server 2019 and have a TVF that retrieves products based on a list of categories. However, I noticed that when I use SELECT *, the query results in a table scan, whereas ...
Ron537's user avatar
  • 1,006
0 votes
2 answers
81 views

In our current PostgreSQL DB, primary keys are Ints. However, in almost all of the communications between services another candidate key is used, a GUID. While I am not the original author of the ...
Nour Salman's user avatar
0 votes
0 answers
39 views

I am trying to use sqlalchemy to model a database consisting of two classes A and B. The B class has two fields: B.a (1 to n) and B.alist (n to n). I am trying to follow the Setting Bi-Directional ...
msampaio's user avatar
  • 3,463
1 vote
2 answers
272 views

I've inherited a code base with an associated database schema. The schema has numeric, auto-incrementing primary keys. It does pagination with queries like this: WITH params AS ( SELECT id ...
Tom's user avatar
  • 8,171
1 vote
3 answers
161 views

I use an Oracle sequence of the form: CREATE SEQUENCE MY_SEQUENCE INCREMENT BY 1 START WITH 1000000000 MAXVALUE 9999999999 MINVALUE 1000000001 NOCYCLE CACHE 20 NOORDER; This sequence is used in an ...
Till Glöckner's user avatar
0 votes
1 answer
39 views

I'm using a two-collection approach (userChats and chats) for quickly accessing a user's group chats as opposed to the use of an extremely long participant array of user IDs. However, I am struggling ...
George Assan's user avatar
-1 votes
1 answer
104 views

I’m working on a web application where users can select multiple preferences (e.g., favorite foods, music genres, hobbies, etc.). A user can have many preferences, and I need to store this information ...
Freddy Alexander's user avatar
-1 votes
1 answer
78 views

I'm trying to model the economy of a resource management game. Processes turn one type of resource into another, at varying rates. For example, process A turns 1x item A into 1x item B. That's simple, ...
user1021379's user avatar
1 vote
1 answer
642 views

I am trying to set up a simple but large DuckDB database with a single column of unique values as read from a parquet file. For faster inference of single-point existence checking (WHERE id = test_id),...
Bram Vanroy's user avatar
  • 28.8k
-2 votes
2 answers
77 views

I have two tables: Product Columns: Product ID (PK), Product Name Order Columns: Order ID (PK), Order Name I would like to store which Product Id for each order. Is it better to create another table: ...
developer's user avatar
  • 1,621
-1 votes
1 answer
71 views

In an entity relationship (ER) diagram, is the relationship between Order and Cart considered a weak entity relationship? Because order depends on the cart. I analyzed the relationship between Order ...
Mohammod Shihab Hossain's user avatar
-2 votes
1 answer
76 views

What does the # mean when placed before an attribute in a relational database schema? Umbrella(ID,Lido, Cost, Type) Lido(ID, Name, #Spots, Manager) Manager(FiscalCode, Name, Surname) Client(#Card, ...
Rbn's user avatar
  • 21
-2 votes
1 answer
59 views

I have a table called Device, and another table called Action. I link them with my junction table DeviceActions on both PKs. Here's a simplified ERD model: If each action is only recorded once for ...
GH DevOps's user avatar
  • 512
-2 votes
2 answers
47 views

I have a database about bicycles. One table is for the construction of the whole bike and one is for the construction of each wheel. There can be multiple rows for each bike since it can be other ...
Mårten Wikman's user avatar
1 vote
0 answers
13 views

When design the tables I get doubt (below is the pseudo-code) : Node Table { id: number, label: string } Comb Table { id: number, label: string } Link Table { source: // Here it can be an ...
lustre's user avatar
  • 129
0 votes
1 answer
65 views

SQLite schema: CREATE TABLE Lots ( Id INTEGER PRIMARY KEY ); CREATE TABLE Parts ( Id INTEGER PRIMARY KEY, LotId INTEGER NOT NULL REFERENCES Lots ); CREATE TABLE Inspections ( Id ...
relatively_random's user avatar
1 vote
1 answer
57 views

I have a table that keep records that can be added and then updated by a user. Record has many fields. Some fields can be logically grouped, some have similar or the same data type. I need to keep in ...
Yola's user avatar
  • 19.4k
0 votes
0 answers
127 views

I am developing an auto parts quoting and pricing application for a company that sells auto parts. The client wants the application to handle their internal daily operations, such as calculating parts ...
Gemechis Worku's user avatar
-1 votes
1 answer
93 views

My CRUD application's data models: What is the proper way to set up the FilmGroup model? It has a one-to-many relationship with Film and a one-to-one relationship with FilmOrder. My models for the ...
FlameDra's user avatar
  • 2,107
0 votes
1 answer
69 views

I have a database for animal rescues which has a medication section. I'd like to have the stock automatically deduct when it is used. The challenge is the opened bottles. For something like an ...
Dan Lindley's user avatar
3 votes
1 answer
114 views

For my database design, I have to options for storing timestamp ranges and preventing overlaps using a gist exclude constraint: Option 1 create table example ( id bigserial primary key, kind_id ...
Code4R7's user avatar
  • 3,156
0 votes
2 answers
106 views

I have a form with multiple fields to upload data and fetch the member's data to the front end. In the front end, some sections have multiple points so I have created separate tables for them. To ...
user avatar

1
2 3 4 5
485