Questions tagged [normalization]
Normalization is the process of organizing columns into tables within a relational database in such a way as to minimize redundancy and avoid insertion, update and deletion anomalies.
608
questions
0
votes
0answers
3 views
Relation is in 2NF or not?
Suppose a relation(A,B,C,D,E) has 2 candidate keys-
ABC
ABD
And a FD is given as, CD -> E Then is the relation in 2NF?
C and D are subsets of 2 different candidate keys and they together are ...
-1
votes
0answers
30 views
Relation in BCNF or not
Consider the relation R[A,B,C,D,E] with:
the keys {A,E}, {A,B,C} and {A,B,D}
the functional dependency {A,C} -> {D}
no repeating attributes
What is the normal form of R?
My answer: It is in 1NF ...
-4
votes
0answers
16 views
Multiple choice questions about normal forms [closed]
Can somebody help me with the next multiple choice questions?
For 1, I think it's b) because C->D is a transitive dependency. For 2, I think it's a), and for 3, I don't know what to chose.
-1
votes
0answers
29 views
Proper relational form for a CRM
I'm designing a multi-tenant CRM. At the moment, my tables look like this:
// one "list" per tenant. lists are collections of contacts.
lists
list_id
list_name
// a contact usually maps ...
0
votes
1answer
20 views
Normalization using DENSE_RANK and LAST_INSERT_ID
db-fiddle
I have created a table called orders (orderId, customersId) and a table called orderDetails (orderId, productId). My goal is to denormalize a table called temp which is like
scanId, ...
0
votes
1answer
42 views
How do I prove this relation is in the `3FN`?
Consider the relation R(A,B,C,D,E) and the set of functional dependencies F={A->D,D->C,BC->AE}
I need to prove this relation is in the 3FN, however I don't think it is; in fact, I don't even ...
0
votes
2answers
34 views
MySQL Insert Values Into Normalized Relational Database (multiple tables) at the same time
I have normalised my database to 4NF. How do I now insert values at the same time when records have been split into multiple tables? most of the child tables reference their parent table CUSTOMER ...
-1
votes
1answer
29 views
If `AB->C` and `A->B` , `A->C`?
I'm new to databases, is this true? if so, how can we deduce that?
I don't know how to use the properties to get an answer, could you help>
0
votes
3answers
40 views
How can I design Person table in MySQL?
I have two person type: Users and Clients.
Users can login the panel but clients can't login the panel.
My current database: (but this design not good for me. I need to connect these tables to the ...
-1
votes
2answers
28 views
Is this the proper way to integrate normalization? [closed]
I'm trying to wrap my head around normalization.
Is this the proper way to create a database with this data? How much more effective is it to use a foreign key instead of just repeating AAPL for ...
-1
votes
1answer
35 views
How can I design address table?
Hello I need designing addresses table. I designed it but I didn't like it very much.
My needs:
I have customers and users (admins). I have addresses for customers and users. We need design in ...
0
votes
1answer
44 views
How can I design Address table with different types?
I have a Address table and different address types like Personal and Corporate. I design a table but I think is breaking normalization rules. How can I improve this design?
My design:
0
votes
1answer
52 views
What should be the schema of the database if the parent table is being referenced in more than one child table?
I have three entities in my database: Category, SubCategory, and Product. Now the thing is SubCategory is dependent on Category, whereas Product can be dependent on SubCategory or directly either on ...
0
votes
0answers
139 views
BCNF decomposition which generates redundant relations (as for 3NF)
Sometimes the 3NF synthesis decomposition algorithm (such as the one described here p.4) generates redundant relations, where all attributes of some R_i already appear in another R_j. The algorithm is ...
-1
votes
1answer
33 views
Database scheme design for complex movie system
I'm creating a complex app for cinemas including frontend and reservation system. I struggle with a DB scheme and this is a worst part for me, I was never good in designing DB's.
Easily said it's a ...
0
votes
2answers
62 views
Database normalization for sensor data
I'm working on the backend of a quality evaluation tool. And I hit a the limit of too many columns.
SQLSTATE[HY000]: General error: 1005 Can't create table xxx.xxx (errno: 185 "Too many columns&...
0
votes
3answers
42 views
How do I ensure I have split my tables without loss of data?
This is w.r.t Database Normalisation, when I have a redundant table that causes anomalies, I would want to consider splitting it in smaller tables as per the NF rules.
BUT
Say I split a big table into ...
0
votes
1answer
31 views
Meaning of “Dependency” in Relation to Elementary DB Normalization
In trying to figure out why the following table definitions from a textbook exercise about nurses in hospital wards is not in 2NF:
Ward (WName, Location, WType)
Ward-Nurse (WName(fk), NurseID, ...
-1
votes
1answer
58 views
JSON vs Record/Struct type in a DB
It seems like some databases have implement a Record/Struct type and others have implemented a Json/Jsonb type to handle nested data structures. A few examples being:
BigQuery Struct
CockroachDB ...
0
votes
1answer
53 views
database design - table with multiple nullable foreign keys
Context:
I have 3 unrelated entities (tables) Entity1, Entity2 and Entity3
I have a table called Operation, which can have multiple targets.
A target for an operation can be Entity1, Entity2 or ...
0
votes
0answers
8 views
How can a 'Request' store a 'Result' code and its associated 'Error' code and still enforce the relationship between Result and Error?
I'm an application developer creating the database structure to represent a flat file message format. I'd like to ask the collective knowledge the best/correct way to represent the following scenario:...
1
vote
2answers
54 views
Postgres normalize human name string
Is there some function to normalize name string:
select normalize('R.C. Bray')
'R. C. Bray'
Or the opposite direction?
The simple replace('. ', '.') or replace('.', '. ') is wrong and may be ...
0
votes
1answer
23 views
More tables or More records performance wise
i am into a scenario that upon looking at the our project database contains Identical tables with the schema described below:
id
url
region_1
region_2
region_3
region_4
date_created
My ...
0
votes
0answers
23 views
Is this definition of 5NF right?
From what I've gathered from my textbook, 5NF doesn't allow lossy decomposition, so that when we join tables that are in 5NF, no spurious tuples are generated.
The definition in my book states that:
&...
0
votes
1answer
57 views
Most efficient table structure for multi-tenant database
I have a conventional relational database (mySQL) with several entities stored in their own table. Three examples are images, events and organisations.
We are making a change to the way our site works ...
0
votes
0answers
23 views
Can a table be un-normalizable or am I misunderstanding the theory
I was considering normalizing a flat table (SQLite if its relevant) I'd been working with in a small personal project and it just didn't seem to make sense.
Consider an example table like below. Each ...
0
votes
1answer
44 views
Relational-JSON overlapping with association [closed]
I have a composed class called sensor that is linked to a main class Node such that:
class node is linked with another node to make a communication that produce an event
class sensor can as well ...
0
votes
3answers
38 views
Is storing data that can be inferred go against data normalization?
To simplify lets say I have two tables PROJECTS and JOBS. A user creates a project and runs 1 or more jobs using a project.
So it would possible look something like this:
PROJECTS
[PK] project_id
...
0
votes
1answer
58 views
How do foreign keys affect partial and transitive dependencies (databases)
I'm struggling to work out how foreign keys can affect partial and transitive dependencies when normalising databases.
I have multiple tables, two of which are job offer and accepted job.
in job offer,...
-2
votes
1answer
42 views
Table normalisation and empty values [duplicate]
Here are two ways I can optimise mapping of a text field with several other attributes to question and answer. First approach is, creating a map table with both question_id and answer_id in which ...
1
vote
1answer
32 views
Refactoring out a boolean column [closed]
I have a Pets table (cats, dogs, you name it) with over a million records. For simplicity sake, it looks like the following:
Pets
Field Type Null Key
id int(11) NO ...
0
votes
1answer
42 views
Database Normalization Advice [closed]
I have database for multi store application. So, I have 3 type of user thats Admin, Customer, Merchant and I have 3 table for users. User table, Customer table, Merchant table.
User Table;
id
...
0
votes
1answer
119 views
Weak Entities + Partial Keys + 2NF [closed]
I'm a bit confused on the concept of weak entities and normalization and couldn't find any answers online. I know that generally weak entities have a partial key to uniquely identify its own records ...
-1
votes
1answer
33 views
Celebrities database with multiple parent categories and children categories? [duplicate]
I am creating a React/Laravel web application that will allow the user to search and navigate through celebrities based on their 'categories'. I have set up a Categories table using MySQL like so:
*...
0
votes
1answer
21 views
Where can I get a proper dataset for performing Normalization techniques? [closed]
I'm new to databases and I just started with learning different techniques of Data Warehousing. I was given an assignment to perform Normalization techniques on a dataset of at least 1000 rows with ...
0
votes
1answer
24 views
Is it correct way having status or Summary columns in parent table or should choose another precedure?
My Parent Table is "Jobs" table, and there is child table that records Job's actions named "JobActions" as below:
Jobs (JobId, JobType, CurrentStage, AssignedTo)
JobActions (JobActionId, JobId, ...
1
vote
1answer
168 views
Need Help With BCNF Decomposition Problem
I'll try and keep it as quick and concise as I can: I'm currently a novice developer who's super eager to learn Database Normalization and Optimization so I can up my skill in Full-Stack development, ...
1
vote
2answers
31 views
Relationship normalization in SQL Server
I want to know should I remove PersonTypeId from Persons table or is it a good idea to have it in there?
6
votes
2answers
266 views
Alternatives to storing a record with exactly n multiple foreign keys from the same foreign table, where the relationships can't be repeated
Say there are entities called singulars, and entities called relationships.
It takes exactly two singulars to make up a relationships entity.
That pair of singulars can't be repeated elsewhere in ...
1
vote
0answers
99 views
Can there exist Tables with no Non-Prime Attributes? If so, are they always normalised to 3NF?
Can there exist a table with no non-prime attributes?
Here is an example of a table which I believe has no non-prime attributes:
I came to this conclusion because the list of attributes in the ...
2
votes
2answers
88 views
Does one of the normal forms require separation of repeating clusters of values into another table?
Should the repeating values in the "Sales" table below be separated out into a second table as part of the process of database normalization? Note that none of the values are functionally dependent on ...
1
vote
2answers
44 views
Normalization Excercise Clarification
Have a bit of confusion regarding a normalization from 1NF to BCNF. The teacher gave us this excercise to illustrate a normalisation all the way up to BCNF. I think I have found a problem with the ...
1
vote
1answer
115 views
Database Design: Normalization and NULL values
I have normalized my table from 0NF to 2NF (hopefully correct).
How do I now go from 2NF to 3NF?
Also, ResponseToTransactionId is a recursive foreign key that will contain NULL values a lot of the ...
1
vote
0answers
37 views
SKU and Price on product that have multiple attributes
Currently, my Inventory system is writing products data like this:
T-Shirt Gildan -> blue, L, short -> stock: 140 -> price: $40
T-Shirt Gildan -> blue, XL, short -> stock: 0 -> price: $45
T-Shirt ...
0
votes
1answer
63 views
How to normalize a lookup table containing NULL? - or should I bother?
I have a table fee listing different fee descriptions and another table fee_amount holding the amount of the fee. The fee amount is different for each year, whether it's a joint fee or not and what ...
0
votes
1answer
246 views
BCNF decomposition step without functional dependencies
I am performing the BCNF decomposition for the relation R = (A, B, C, D, E), that has the set of functional dependencies AB -> C, CD -> A, C -> E, and C -> B.
After checking that the ...
2
votes
0answers
45 views
How to handle / model “cost of provided spare parts per PO line item” where one spare qty is divided between multiple line items? / Postgres 11
Problem
My objective is to help improve the data modeling / handling of my company’s present cost-of-goods [‘COGS’] calculation.
Everything in the current Postgres 11 table structure is pretty ...
0
votes
1answer
48 views
How to normalize a database which uses tables as references to other tables?
I'm trying to create the database for my application, but I cannot manage to normalize my data on a MySQL database.
I have a Types of map entity
The Types must have one or more Models associated to ...
0
votes
1answer
42 views
Database design - logging of same value when recorded in multiple tables
I need to record changes to a particular value, which is read as part of multiple events that are all separately tracked, and be able to view a log of all of the values later.
I think an example will ...
0
votes
4answers
90 views
Trouble deciding what/how many tables to use; normalisation suggests one
More of a conceptual question for the community, as I am not "thinking with databases" as much as I would like to just yet. I am using Oracle Database 18c Express Edition with SQL Developer.
I have ...