Skip to main content

All Questions

-1 votes
3 answers
400 views

Are there existing term(s) for a 1-1 child-parent table anti-pattern?

NOTE: Please don't respond by telling me that I probably don't understand what I am looking at. You can't possibly know that and it's wrong. Just don't answer if that's all you have to say. I'm ...
JimmyJames's user avatar
  • 27.8k
1 vote
1 answer
112 views

Aggregating embedded documents in MongoDB

I'm designing a mongo database and I have a dilemma if I should go for normalization. Let's say that there is a database with images and descriptions. Many alternative descriptions can belong to one ...
Karol Borkowski's user avatar
4 votes
2 answers
1k views

Thoughts on database denormalization via short-circuit key

In the simplified database schema depicted below, I'm considering denormalizing by adding a short-circuit key (EventId, relation shown in red) on Appointment. One advantage is not needing a join to ...
scotru's user avatar
  • 238
52 votes
6 answers
11k views

Is denormalising a database for speed an anti-pattern?

I have a database with a 1:m relationship. I have to display a list of parents to the user rapidly on a home screen at startup. The parent shows a single piece of information that is a sum of a ...
tommytucker7182's user avatar
-2 votes
1 answer
84 views

How to set only one foreign key for every record where the table has 2 foreign keys?

I know that this question has been asked before and is the same or at least almost the same but I just want to know: Is it the only method or is there any other way to do it? I have these tables: ...
My Name Is In Your Heart's user avatar
0 votes
1 answer
562 views

Is it ok to have 3 foreign keys in a table from one only table?

So... Le's say I have 3 tables named: Member Bus AutorizeMember ID Member is referenced to Bus and ID Bus is referenced to AutorizeMember which is also referenced to Member 3 times. Thats is because ...
My Name Is In Your Heart's user avatar
2 votes
3 answers
268 views

What type of normalization is it if I "flip" columns to rows

Suppose I have this: ID A_Type B_Type C_Type 1 Y N N 2 N Y Y And I "flip" those columns into this: ID Type Value 1 A Y 1 B N 1 C N 2 A N 2 B Y 2 C Y I know this is fine to do. I ...
James Madison's user avatar
2 votes
5 answers
872 views

Applying Edgar Codd’s 1NF normalization procedure

In 1970, Edgar Codd published his landmark paper ‘A Relational Model of Data for Large Shared Data Banks’ where he defined relational databases as well as their normalization to first normal form (1NF)...
Géry Ogam's user avatar
1 vote
1 answer
117 views

Should I perform some minor denormalization to save myself several queries in the future?

I'm in charge of designing the entire backend for the REST API of an application that works more or less like an online browser game (think OGAME, Travian, and the likes). In this game, players are ...
neirenoir's user avatar
1 vote
1 answer
174 views

Denormalized history (ledger) table with tax - yes or no?

We are designing a system, in which we need to store amount of SalesTax applied as well as Tax percentage value. We decided that we will keep tax value in separate table (simplified example): Taxes ...
Maciej Pszczolinski's user avatar
-3 votes
2 answers
174 views

How to structure a database where a record can be a child of a parent or a grand parent record

I have these concepts for a database application: Session, Subsession and File A session can have multiple files A session can have multiple subsessions A subsession can have multiple files A session ...
Canol Gökel's user avatar
1 vote
1 answer
1k views

How/when to normalize during ETL?

Let's say you're loading a denormalized flat file of purchase transactions that looks like this: | location_name | location_zip | product | product_price | |---------------|--------------|---------|--...
seriestoo2's user avatar
2 votes
3 answers
4k views

Database : Does it make sense to choose the zipcode as a primary key for an address?

I was following a tutorial on the normal forms of SQL databases, and I got confused landing on this example : https://www.tutorialspoint.com/sql/third-normal-form.htm. From CREATE TABLE CUSTOMERS( ...
Ricola's user avatar
  • 279
0 votes
1 answer
123 views

Better to store miscellaneous metadata in database or calculate on each access

I have a number of attributes I need for various page loads and other backend tasks, and I'm debating on whether storing these things in a database or calculating them on the fly. For instance, if ...
user58446's user avatar
  • 327
1 vote
1 answer
60 views

Flexable Table, or multiple tables?

In my application, I have many things that use images in different ways. For example, a product may have a logo and many screenshots, a user can have a profile image, and a company can have a logo. I ...
Christian Pavilonis's user avatar

15 30 50 per page