Questions tagged [normalization]
Normalization refers to transformations which aim to reduce variation of various types of data and thereby allow more consistent processing, searching, sorting, comparison, etc.
61 questions
-1
votes
3
answers
542
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 ...
1
vote
1
answer
150
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 ...
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 ...
52
votes
6
answers
12k
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 ...
-2
votes
1
answer
104
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: ...
0
votes
1
answer
677
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 ...
4
votes
5
answers
3k
views
What is the normal form of JSON? What is theory that you can't automate normalizing?
What is the normal form of a typical JSON object?
We often need to convert JSON objects to some set of tables. Once they are tables, the tables have measurable normal forms based on all the usual ...
2
votes
3
answers
314
views
What type of normalization is it if I "flip" columns to rows [closed]
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 know it ...
2
votes
5
answers
973
views
Applying Edgar Codd’s 1NF normalization procedure [closed]
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)...
-1
votes
1
answer
75
views
Equivalent attributes and normal forms
A relation R(A,B,C,D) is given.
C and D are equivalent (C is the course ID and D is the course name, one implies the other).
C and D are prime attributes.
Does that violate the requirement of 1NF ...
1
vote
1
answer
144
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 ...
-2
votes
1
answer
76
views
Simple OO/normalization question - common fields in new table/separate object?
I am working on an app and creating models now. I think this is a basic 1N normalization question but am not sure. Should I break location/address out as a separate table?
Let's say I have Parents ...
1
vote
1
answer
197
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 ...
-3
votes
2
answers
191
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 ...
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 |
|---------------|--------------|---------|--...
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(
...
0
votes
1
answer
125
views
How do I normalize a database to decrease duplicate entries?
I am designing a database system + application that deals with pipe objects who are part of a larger grid network. There are about 1000-5000 pipes for each network. Let's assume each pipe can have 2 ...
0
votes
1
answer
167
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 ...
4
votes
2
answers
360
views
Is it okay to structure a non-normal table in relational database to achieve a fast query?
Let's say we've got 3 entities here, User, Tag, Track and a single associative entity called Tagged.
I need to count a tag frequency of a track and the common way is to count the record of tagged, but ...
1
vote
1
answer
69
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 ...
2
votes
2
answers
2k
views
Should I worry about normalizing address data?
I am requesting information about a Users address and as is good practice when collecting information, I validate the input and respond accordingly where appropriate.
Assuming valid input is received,...
1
vote
1
answer
2k
views
Normalisation Vs Join , trade-off
In RDBMS, goals of Normalization:
Free the database of modification anomalies
Minimize re-design when extending
Avoid bias toward any particular access pattern
First step involves avoiding redundancy ...
6
votes
2
answers
10k
views
OLTP vs OLAP - MongoDB
RDBMS design often emphasizes data normalization (especially 3 NF) for the sake of efficient transaction processing (OLTP). OLTP is the predominant use case for an RDBMS.
Goals of Normalization in ...
3
votes
1
answer
68
views
Post and Stats - Should normalization or keep it together?
I have posts table:
id (int) index
uid (int)
text (text)
created (int)
is_deleted (tinyint)
and a table to store post stats:
post_id (int) index
comments (int)
shares (int)
views (int)
Now when I ...
1
vote
1
answer
150
views
How to model shared and unique options for a family of products for a relational database?
I have a family of products that currently houses 3 product lines. All 3 product lines share the same 4 options, but on top of those, each product line has 1, 2, or 3 different options respectively, ...
2
votes
1
answer
171
views
Given an entity that can have a parent, or can stand on its own, what is the best way to represent it in a relational database
Lets assume we have to model the following entities:
Application : Application submitted by users
Application Study: the study to determine if the Application should be accepted
Consultation : A ...
16
votes
4
answers
4k
views
Does it ever make sense NOT to condense one to one relationships?
If we have Table A that has a one to one relationship with Table B, does it ever make sense to keep them apart? Or does it never hurt to combine them into a single table? Do either of these scenarios (...
2
votes
3
answers
8k
views
How to design ER diagram to allow for retrieving of product option pricing data?
I'm looking for a way to organize database tables when it comes to handling product option pricing retrieval and also storing pricing history for my use case.
What I have
I have a custom-made ...
244
votes
17
answers
107k
views
Is it good practice to always have an autoincrement integer primary key?
In my databases, I tend to get into the habit of having an auto-incrementing integer primary key with the name id for every table I make so that I have a unique lookup for any particular row.
Is this ...
2
votes
1
answer
734
views
Best approach to store huge amount of denormalized/dynamic data with relational database
Here I have a very basic ILS (Integrated Library System) done a long time ago (made with C#/SQL Server), in production for years. But now I have a demand of make this system MARC 21 standard compliant,...
2
votes
2
answers
1k
views
How should I structure a DB schema to include multiple market segmentation data?
A client has recently expressed a wish to assign their market segmentation labels to their customers, so that they can sort by market segmentation in their dashboards ("show me all the VIP customers ...
1
vote
3
answers
2k
views
Multiple items in a single column SQL
I'm creating a charter database structure. I'm trying to figure something out, I have read on here that databases should be normalized. Now, I'm a bit confused on this because I believe I have ...
4
votes
2
answers
371
views
How to represent a collection with capacity in a database?
Concerning normalization of a one to many relationship, I am not sure how to represent a collection with a specified capacity in a database. I can think of two ways to represent an entity A with a ...
1
vote
0
answers
311
views
Compiling data from multiple API sources, multiple languages, into a single database (MySQL or Mongo)
I'm thinking about a database schema, and would really appreciate if some of you could look at where I'm up to and offer some advice..
The mission - We have to write a program that will fetch data ...
0
votes
1
answer
270
views
Time elapsed between two 8-bit timestamps
So I have a sets of numbers representing some timings.
This is how they look like:
[sec] [msec]
100 75
100 200
101 60
101 233
102 255
104 21
First column contains the ...
1
vote
0
answers
233
views
How to implement partial normalization while keeping data integrity across documents
I've been researching how to properly design a mongo schema and came across this blog post on their site: http://blog.mongodb.org/post/87892923503/6-rules-of-thumb-for-mongodb-schema-design-part-2
...
70
votes
4
answers
40k
views
Is it wasteful to create a new database table instead of using enum data type?
Suppose I have 4 types of services I offer (they are unlikely to change often):
Testing
Design
Programming
Other
Suppose I have 60-80 of actual services that each fall into one of the above categories....
2
votes
3
answers
1k
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
...
3
votes
3
answers
6k
views
Database design: manage permissions on multiple applications resources
Overview
A central web application to supports other web applications(A) for user and its role/permission management. Applications (A) call the central application via API to get the user roles/...
2
votes
2
answers
2k
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 ...
8
votes
3
answers
315
views
Database Normalization vs dependencies
I am developing 3-4 interdependent programs. Call them foo bar baz and auth. I want them to be independent of each other. Imagine if I were to license out each program to other companies. Some ...
4
votes
1
answer
689
views
What happens to database design process when ORM tools are used?
I have learned about database design, including normalization during my undergraduate course. When we have to model a database for a system, we can start with an ER model and then convert it to the ...
0
votes
1
answer
848
views
Tags DB structure - tags table using one join and GROUP BY, or pivot (join) table using two joins?
I'm implementing tags into my question and answer application. Users will be limited to the tags available by the app, so they can't choose their own. So maybe only 30-50 tags will be available. This ...
2
votes
1
answer
710
views
Normalization 3NF and BCNF [closed]
If I have the following relation R = (A, B, C, D)
And the functional dependencies:
A -> B, B -> A, CDB -> A, CDA -> B
The candidate keys are CDA and CDB.
The third normal form says that there ...
5
votes
2
answers
388
views
Database Normalisation - stuck with "categories"
Context:
I'm working on a database of museums and Categories will be one way the user will be able to search. e.g click on "Music" and a list of music related museums turn up. Pretty simple.
Problem:...
3
votes
4
answers
968
views
Is this database design sound and fully normalised?
I'm creating a database to store words. The intended usage is to query the database to find a word matching a set of filters. E.g. if I wanted to find a word with < 10 letters, < 3 syllables, ...
1
vote
1
answer
75
views
How to represent one special related record
I have two tables, project and photo. photo has ID,projectID,path : each project has multiple photos.
Now one of these photos is the one that has to be displayed. The question is how to represent ...
6
votes
4
answers
6k
views
DDD and the persistence of value objects; must we denormalize?
I've been reading up a lot on Domain-Driven Development, and I came to the question of how to preserve lack of distinct identity with value objects (VOs). While in the DDD world, this is a requirement ...
0
votes
1
answer
1k
views
How does this normalized example work?
I had the following DB schema:
Customer Car Rental
------- ---- ------
Name Name Car_ID
ID ID Customer_ID
Date
This is said to be non normalized ...
7
votes
1
answer
2k
views
Why normalization improves numerical precision?
I was reading the following article:
Polynomial interpolation of GPS satellite
coordinates, Milan Horemuz and Johan Vium Andersson 2006
and it states the following:
"The estimation procedure of the ...