All Questions
Tagged with database database-design
9,372
questions
0
votes
0
answers
25
views
represent things that share some basic characteristics and have custom data in a database [duplicate]
I'm working on an application that needs to keep track of physical places in the world that are hierarchically related - berth, terminal, port, country. They all share some basic characteristics, like ...
0
votes
1
answer
63
views
Is it good practice to duplicate the connections to the grandparent in the parent and son in SQL? [closed]
I've seen different database designs in different projects. Some of them claim that from son to grandparent one should go through the parent (intuitively correct); in others there is a lot of ...
0
votes
1
answer
184
views
Explicit many-to-many relation Prisma schema syntax for MongoDB
The following is my Prisma Schema for 3 models --> User, Cart and Item.
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
email ...
1
vote
0
answers
166
views
Multiple feature branches that need to introduce their own migrations - Alembic
Our team is using Python's Alembic in conjunction with SQLAlchemy as our DB migration tool. Say there are two developers and two feature branches are created from a parent branch called feature1 and ...
-1
votes
3
answers
98
views
How to generically model many to many entity relationships in SQL? [duplicate]
I have a SQL database for maintaining D&D games which has tables for things like Characters, Items, and Locations. I want to start modelling the relationships between all these different entity ...
0
votes
1
answer
33
views
Best way to handle page numbers in MySQL bibliography?
I’m trying to work out the structure for a bibliography database with three basic entities: text (essays, articles, etc.), publication (the books, journals, etc. that contain those texts), and maker (...
-1
votes
1
answer
279
views
Mapping EER to Relational model. Mandatory participation of superclass with (Mandatory; Disjoint) subclasses
I have a Superclass A that has a 1:* (one-to-many) relationship with another entity (X) and the participation of A is mandatory. A has two subclasses with their own distinct attributes, B and C. The ...
0
votes
0
answers
52
views
relationships for storage of working hours in a database divided into multiple points of sale
I'm creating a management system for the company in Laravel. I'm doing the part that concerns the management of employee schedules and our various sales points.
I have a user table, a front offices ...
1
vote
1
answer
74
views
Normalize a table with a non-prime attribute and a multivalued dependency within the candidate key to 4NF
I will extend the 4NF example from Wikipedia with a Cost attribute.
Define the relation from Wikipedia as R(Restaurant, Pizza, Area). By the original definition of R, there are multivalued ...
-3
votes
1
answer
42
views
Database Scheme for User made Online Election
I'm currently working on a web project "Online Election" where users can create Election as they need.
I can not think of any idea how the Database should be, For the database, every time ...
1
vote
1
answer
43
views
Delete unreferenced row automatically in many-to-many relationships
Suppose I have a table artists and a table tracks, with a many-to-many relationship between the two.
When I delete an artist, I also want to delete all the tracks that have no corresponding artists ...
1
vote
0
answers
43
views
Best Practices for Efficiently Writing Time Series Data to MongoDB Collections with Dynamic Variables
I am currently working on a project involving MongoDB with three collections: datasources, variables, and a time series collection values. The values collection stores time-stamped data for various ...
0
votes
0
answers
48
views
Synchronization of tables in the database
I am in a scenario where I have 2 applications (Rest API), and each of them has its own database. Application A with database A, and application B with database B. Database A has a table X that I need ...
-1
votes
1
answer
27
views
Table 'shopping_cart', which contains 2 foreign key as primary key and other foreign key, have an error with relationship while importing data
While importing data, I have
Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (`mydb_innodb`.`shopping_cart`, CONSTRAINT `fk_shopping_cart_order_payment1` FOREIGN KEY ...
-2
votes
2
answers
268
views
Difference between entity and relation in UML and SQL
Just wanted to make sure that I'm understanding this right:
designing UML-diagram we are talking about the relations between entities?
in the context of SQL a table is a relation?
I can remember ...