Questions tagged [database-normalization]

Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy and dependency. It removes insertion, deletion and update anomalies. Normalization involves decomposing a table into less redundant, smaller tables without losing information.

Filter by
Sorted by
Tagged with
-3 votes
0 answers
33 views

Is separating the table into the following correct for 2NF?

I am trying to understand if the order of separation in 2NF plays a role. This is an example from freecodecamp about 1NF, 2NF and 3NF. A table in 1NF: employees(EMPLOYEE_ID,NAME,JOB_CODE,JOB,...
Watermelon Films's user avatar
0 votes
1 answer
34 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?
nicomp's user avatar
  • 4,354
-3 votes
1 answer
49 views

Database normalization for 1 to many, many to many, many to 1

For both scenarios I'm using the same Color [lookup] table but storing the data differently. Here's the spec for the records to store: Car with Id 1 is available in 3 colors: Blue, Red, White. Car ...
PassingThru's user avatar
-1 votes
1 answer
29 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 ...
altoviento's user avatar
-2 votes
1 answer
59 views

Are my Spring Boot entities normalised if not How can I do so?

I have a table having a oneToMany relation with another table public class UserDetails { @Id @Column(nullable = false) private String userId; @OneToMany(targetEntity = Books.class, ...
shiningStar's user avatar
-1 votes
1 answer
60 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 ...
Begems's user avatar
  • 13
-2 votes
1 answer
58 views

Normalization in PostgreSQL - share a primary key across tables?

I'm designing a PostgreSQL database that involves three tables: buys, sells, and transaction_pairs. In each of the buys and sells tables I have a unique identifier column id. database schema In the ...
Virgilio Gonzenbach's user avatar
-1 votes
1 answer
41 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 ...
Bjarke Kingo's user avatar
-1 votes
1 answer
37 views

Turning related Comma Separated strings into individual rows with multiple columns with one to many

I was looking at the post Turning related Comma Separated strings into individual rows with multiple columns. This works great for me when the data Data is one to one Related Data. But I need more ...
mthom's user avatar
  • 1
0 votes
0 answers
26 views

MongoDB Sharding by foreign key

Let's say I have two collections: users and items, where every item belongs to one user: users: { id: 1, country: "US" }, { id: 2, country: "UK" } items: { id: 123, userId: 1 }, { ...
user734796's user avatar
0 votes
2 answers
60 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 ...
Stupid Blonde's user avatar
0 votes
1 answer
277 views

Joining with a json column makes the result very slow

There are 3 tables and I linked three tables with one query. But the problem is that the result returns in 7-8 seconds. One of the columns I join is JSON type and the data in it is json. For this ...
grudge's user avatar
  • 11
-1 votes
1 answer
81 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 ...
dinnerspoon's user avatar
-3 votes
1 answer
56 views

How to normalize three identical tables into one table?

I have three tables: cat1: id(PK) name description cat2: id(PK) name description cat1_id1(FK) cat3 id(PK) name description cat2_id(FK) cat1 has one-to-many cat2, and cat2 has one-to-many cat3. How ...
mightycode Newton's user avatar
0 votes
0 answers
41 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 ...
Harun's user avatar
  • 51
0 votes
0 answers
36 views

Minimum normal form of a relation with all prime attributes

If all the attributes of a relation are prime (part of a candidate key), which normal form would it be at least? 1NF, 2NF, 3NF or BCNF. The question was already solved in slides as BCNF, but I don't ...
Dani Cruz's user avatar
-1 votes
1 answer
65 views

Database normalisation to 3NF

My original table which is not normalised looked like this:[1]: https://i.stack.imgur.com/NbKV4.png Now after following the conditions of each form, I managed to separate the table into 3 forms which ...
Habibullah Ahmadi's user avatar
-1 votes
1 answer
60 views

Struggling with functional dependency practice questions

I'm going over some practice questions. F={ B→E, C→B, CD→E, ABE→C} I tried to make a canonical cover - Fc ={ B→E, C→B, D→E, AB→C} Then finding candidate keys - ADB, ADC Is R in BCNF? I thought it ...
Ofekino97's user avatar
-1 votes
1 answer
111 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 ...
Mustafa Furkan Bilen's user avatar
-1 votes
1 answer
73 views

foreign key order in psql (database normalization)

student database that must be normalized 3NF and put into PSQL I am having trouble with what order to insert into the tables in order to keep referential integrity with the FKs attributes: student ...
Sandi K.'s user avatar
0 votes
1 answer
30 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 ...
Александр Коромыслов's user avatar
0 votes
1 answer
48 views

Replacing two columns (first name, last name) with an auto-increment id

I have a time-series location data table containing the following columns (time, first_name, last_name, loc_lat, loc_long) with the first three columns as the primary key. The table has more than 1M ...
user1386058's user avatar
-1 votes
1 answer
43 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 ...
Thomas's user avatar
  • 1
-2 votes
1 answer
210 views

PHP/MySQL: Multiple comma separated values per table field vs... WHAT?

Storing multiple comma-separated values in a single table field is a notoriously bad design as it impacts performance and breaks relationships. Except I don't know how to change things. I have a ...
Puddintane's user avatar
2 votes
0 answers
97 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-...
Anthony L. Gershman's user avatar
0 votes
1 answer
36 views

Normalizing data in R - dataframe construction

I'm using R to connect to a database I have stored in PGAdmin so that I can add data into the database through R. Before adding the data into the database, it has to be normalized. The dataset ...
amatof's user avatar
  • 175
-2 votes
1 answer
52 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 ...
Lechius's user avatar
  • 183
-1 votes
1 answer
273 views

use a Foreign key or make a new Primary key while normalizing to 2NF?

A table in First Normal Form: While converting it to Second Normal Form should I use the same Employee ID in 1 table as Primary and use it as a Foreign key in the other table like shown in the ...
Ethan Brown's user avatar
3 votes
1 answer
347 views

Storing JSON in a database violates 1NF?

Many DBMSs started allowing JSON in a database. Does this violate 1NF? One of the rules of 1NF is not storing multiple values in one column. But we are storing JSON, which can contain a key-value pair....
DRSK FUN cuts's user avatar
0 votes
1 answer
73 views

Decomposing tables where some attributes aren't in any minimal, non-trivial functional dependency

While writing a library to automatically decompose a given table, I came across some special cases where the first steps of Bernstein's synthesis for 3NF (ACM 1976) give me results I don't expect. ...
Accidental Statistician's user avatar
0 votes
0 answers
45 views

breaking transitive dependencies in third normal form (case)

Suppose we are second normal form with: R(a,b,c,d,e) FD: (a->bcde, c->de, d->e) And we remove transitive dependencies: R1(a,b,c) R2(c,d,e) R3(d,e) Is this a correct decomposition?
filtertips's user avatar
1 vote
0 answers
115 views

Data normalisation into third normal form

I have done data normalization on dummy data and would like to know if I did it correctly. If it is done correctly, I would also like to ask two things below, because it is about 3NF. 1NF: This table ...
filtertips's user avatar
-1 votes
1 answer
52 views

How to normalize relationships between tables with references to a parent table

Disclaimer that I'm not very versed in relational database design and normalization, but this is something that I've encountered and I'm not sure if this is a normalized design. Let's say there's a ...
platizin's user avatar
  • 812
0 votes
1 answer
52 views

SQL data normalisation for Calendar entry

I am working on a project that needs calendar entries to create reminders for the users. I am storing the id, title, description, date, and time of each entry in a relational database. Does it mess up ...
Jes's user avatar
  • 33
-1 votes
1 answer
200 views

Creating tables for many to many relationship.Will it effect normalization?(Laravel)

My database tables: 1.jobs table having fields id,name 2.locations table having fields id,name Jobs can have more than one location and locations can have more than one jobs.So i added a table ...
Vishnu kk's user avatar
0 votes
0 answers
32 views

How can I avoid having 2 nullable fk

I have these 4 tables, one is called register and has columns: ID Name Location Then, I have these 2 kind of users - Normal User and Shelter User. As both are related to the register table because ...
Darsh's user avatar
  • 11
-1 votes
1 answer
33 views

After normalising my data using DataPreparer while using random forest and SVM, why do my data values become negative?

I am working on predictive modeling where I need to predict whether an online customer ends up purchasing a product on a website or not, and I am using Random Forest Classifier and SVM since it's a ...
Eri Bytyci's user avatar
0 votes
2 answers
51 views

python pandas normalization

I have a csv file where one field should be normalized over two records: +-----+---------+ | id | field | +-----+---------+ | 1 | A-a,B-b | | 2 | C-c | +-----+-------...
Nicola Bertellini's user avatar
-2 votes
1 answer
204 views

Normalization: partial dependency & transitive dependency attribute collision

When I was practicing normalization I encountered this question: Normalize the following AB (a, b, c, d, e, f, g) b --> c, e c --> e, g a --> d where a, b is the composite primary key. I ...
Mustafa Muhammad's user avatar
0 votes
1 answer
101 views

Definition for relation to be in 3NF using canonical cover

We are using following definition of 3NF: A schema R is in third normal form (3NF) if for all FD α → β in F +, at least one of the following holds: α → β is trivial (i.e., β ⊆ α). α is a superkey ...
Marc's user avatar
  • 45
-1 votes
2 answers
191 views

MySQL single table with hourly, daily, monthly values, or separate tables?

When working with data values, should I create a single table storing the hourly values, and also the aggregated daily/monthly values, or should I create separate tables for these? I'd imagine ...
dansan's user avatar
  • 194
-1 votes
1 answer
58 views

How can I avoid complex SQL queries used to find an ID from sub-sub-sub-child to parent?

Let's say I have these models: TABLE trainers ( id -- PK -- many fields here... ); TABLE players ( id -- PK, trainer_id -- FK, -- many fields here... ); TABLE tournaments ( id -- PK, ...
Fred Hors's user avatar
  • 3,328
-1 votes
1 answer
62 views

Question concerning the transitivity axiom and 2NF

If I have a table {A, B, C} and the FDs: {A -> B, B -> C} is the table in 2NF ? Im a little bit confused because of the transitivity axiom which is if A -> B and B -> C then A -> C. Is ...
Bobi's user avatar
  • 11
1 vote
1 answer
89 views

Different versions of 3NF?

I have a question on the definition of 3NF given by Chris Date in his book "Database Design and Relational Theory", page 78. The definition given in the book is: "A relvar R is in 3NF ...
Louis's user avatar
  • 63
0 votes
1 answer
45 views

MinMaxScaler to ExtraTreesClassifier

I am trying to implement ExtraTreesClassifier normalization with a specified gini value to my dataframe. I have MinMaxScaler designed which successfully ran. But I wasn't able to implement ...
UnFury's user avatar
  • 11
1 vote
0 answers
176 views

Is normalisation done on the primary key or on the candidate keys?

Im not sure about the correct definitions for normalisations, as primary key and candidate key are used interchangeably. I have come across these 2 definitions when trying to find a definition for 2NF ...
MohG's user avatar
  • 25
-1 votes
1 answer
76 views

SQL 3 NF normalization

I have a table with 4 columns to display the bill of buying an item, column 1 is the primary key, column 2 and 3 are the price and the amount of the item, column 4 is the sum of the price, which is ...
YSJR's user avatar
  • 1
0 votes
0 answers
104 views

Non trivial functional dependency... Not certain here

Question: Consider the following relation: Order (Product_ID, Product_Name, Customer_ID, Customer_Name, Date, Item_Price, Amount, Total) OBS: If the same customer sends multiple orders on the same day ...
onetimeagain's user avatar
1 vote
2 answers
97 views

Issue normalising json and using Pandas

I have an issue where I am trying to normalise my json response Json example: { "data":{ "flavors":[ { "name":"Basic_A4&...
Ali987's user avatar
  • 29
1 vote
0 answers
91 views

find all functional dependencies for attribute closure?

It is for a university assignment. I have to list all non-trivial functional dependencies that are applicable, while also trying to ensure that all tables in my schema are 3NF. I have created an ER ...
Iamclueless's user avatar

1
2 3 4 5
29