1,460 questions
1
vote
2
answers
212
views
Mutually exclusive columns and violating 3NF [closed]
CREATE TABLE foo
(
id SERIAL PRIMARY KEY,
a TEXT,
b TEXT
)
Column a can take a value only when column b is empty and vice versa:
id | a | b
---+-------+------
1 | NULL | 'abc'
2 | '...
-1
votes
2
answers
92
views
How to Normalize data in snowflake to include column names
I have a dataset for daily sales that looks like this,
Product_ID
Mon_Sales
Tue_Sales
Wed_Sales
A001
30
40
50
A002
10
20
30
A003
30
60
90
I want to change the data to look like this,
Product_ID
...
-4
votes
1
answer
75
views
What design shows parent id and child-specific data in the same table without violating normalization? [closed]
I am designing a system that records stock transactions for a product. Some product types record items by serial number for traceability, some products types do not serialize items.
I record the ...
0
votes
1
answer
93
views
I'm trying to normalize this Json structure
I'm finding an error message when I try to normalize a Json structure that follows.
I pasted the JSON structure and the python code to normalize that is giving the ERROR message
GOAL: Normalize ...
1
vote
1
answer
84
views
Why does a database table expressing all possible combinations of values of 2 attributes violate 4NF?
Sometimes a database table is supposed to contain every possible combination of two (independent) things. I know such a table is subject to deletion anomalies of the kind that 4NF is supposed to ...
0
votes
1
answer
104
views
Enterprise data model design for small business
I work at a small company that buys inventory and resells either the raw inventory or packages it up into bundles for resale. We have an in-house software and are redoing our data model for an ...
-1
votes
2
answers
73
views
Database Normalization [Separating Tables]
When normalizing data from an application form, each applicant will have one spouse. The "Applicant Code" serves as the primary key. Creating a surrogate key seems unnecessary due to their ...
-1
votes
1
answer
61
views
Normalize a many-to-many table
I have an input data.frame combined containing a many-to-many relationship that I would like to normalize into 2 tables. This input table contains the mixture composition for several different samples ...
-1
votes
1
answer
121
views
Is it really better to respect the normal forms and create an additional table for one simple field? [closed]
We organize runs, and we want to save run results and the number of kilometers that runners did run in their career. We have one table with every runners data (name, age, gender, etc. including an Id)....
0
votes
2
answers
215
views
Does it violate any normalization rules if I add a boolean column to a db table?
Database tables:
Servers
Id
ServerType
ServerId1
1
ServerId2
2
ServerId3
3
ServerId4
4
ServerId5
5
ServerId6
1
ServerId7
2
ServerId8
3
ServerId9
4
ServerId10
5
ServerId11
1
ServerId12
2
ServerId13
3
...
0
votes
1
answer
89
views
Making (3) composite primary key less redundant
I have a table with a composite key (3) like this:
sub_product
- product_id (PK FK)
- product_type (PK FK)
- size_id (PK FK)
- quantity
quantity is dependent on all 3 keys.
Is reducing this to ...
0
votes
1
answer
252
views
Database Normalization BCNF decomposition
I have a relation schema M with the attributes {B, C, D, E, R} and the following set of functional dependencies:
B, D, E -> R
B, D, R -> E
B, C, D -> R
C, D -> E
I want to perform a BCNF ...
0
votes
1
answer
83
views
How does this relation produce candidate keys?
Given relation
R(a,b,c)
and that there are no functional dependencies:
How are candidate keys computed?
-1
votes
1
answer
559
views
Realm relationships vs embedded objects
I'm used to SQL and don't understand Realm's internals too good. After checking the usual recommmendations for using Realm, I've seen that database normalization is usually discouraged, as well as ...
-2
votes
1
answer
79
views
Database Table Normalization (3NF)
| MatrikelNr [PK] | Stud.-Name | Klausur | Raum |
Matrikelnr = student number, Klausur = Exam name, Raum = Room.
I should get this table into 3NF, and write them as relations with primary keys ...
-1
votes
1
answer
151
views
Is redundant data an acceptable trade-off in a normalized database structure?
In SQL I'm considering the following problem.
I have a list of A_ids and a list of B_ids.
the number of unique A_ids ~ 1.000s
the number of unique B_ids ~ 1.000.000s
The idea is that I for each A_id ...
0
votes
2
answers
149
views
How to normalize table1 in postgres sql?
I need to normalize (in a technical way) table1 by splitting the column "error occured at" so that it was like in table2.
Is there is any DML function that will help me solve this? So that ...
-1
votes
1
answer
109
views
Redundant relation: Is this a violation of database normalization?
I have a table with products that I offer. For each product ever sold, an entry is created in the ProductInstance table. This refers to this instance of the product and contains information such as ...
0
votes
0
answers
49
views
EF Common file table structure
Personel Table
Id
Name
1
ABC
2
DEF
Car Table
Id
Name
1
X Car
2
Y Car
Image&Document Table
Id
Path
EntityId
EntityName
1
Car-1.Jpg
1
Car
2
Person1.Jpg
1
Personal
3
Car-3.Jpg
3
Car
I want to create ...
-1
votes
1
answer
89
views
Database normalisation to 3NF
My original table which is not normalised looked like this:[1]: https://i.sstatic.net/NbKV4.png
Now after following the conditions of each form, I managed to separate the table into 3 forms which look ...
-2
votes
1
answer
313
views
Normalization on Student database table [closed]
I have a table that holds student information: the student's name, number, address, courses taken and the instructors and grades from the courses. I want to normalize this table.
What is best practice ...
0
votes
1
answer
41
views
One-To-Many relathionship task
I have a table Subject
It has many fields, two of them are code and flag.
Earlier those two fields was an idempotention key for rows in this table.
But, now I need one more option system.
There are ...
-1
votes
1
answer
74
views
Will MySQL allow no primary key if the table is linked with another table containing a MatchID with two Foreign Keys
I have a database of 5 tables. Some contain the same columns as others, does tying these tables to another table which has the primary keys of other tables meet 3rd normalisation. (This is outlined ...
2
votes
0
answers
213
views
PostgreSQL database: Get rid of redundant transitive relation (maybe 3NF is failed)
I'm creating a hybrid between "X-Com Enemy Unknown" and "The Sims". I maintain game state in a database--PostgreSQL--but my question is structural, not engine-specific.
As in X-...
-2
votes
1
answer
107
views
Is this allowed in BCNF Normalization?
I know that in BCNF if A->B then A must be a candidate key. But what about if A is part of the candidate key but not the whole candidate key?
Let me explain in an example:
Exercise 1:
Candidate ...