-3
I have a question regarding normalization. I have three tables: Vehicles, Filters and Combinations. It works like this, in the Combinations table I select the Vehicle ID in the Vehicle table and 4 filters related to each car in the Filters table . Ex.:
Is the structure acceptable by the standards? or would it have to create 4 Filtrosn tables? This is linked in what I will call in PHP. For example:
$query = "SELECT * FROM Combinações c
JOIN Veiculos v
ON c.id = a.veiculo
JOIN Filtros f
ON..." <<--- É aqui que estou em dúvida
How do I link the Filters table to the Combinations table ? and as I would call a 'echo' Oil Filter, Air Filter, Cabin Filter, Fuel Filter relating to the Filters table?
It depends on what normal way you’re talking, on some it’s yes, on another it’s not, I think because normalization is not a magic rule that solves problems, you have a problem and everything needs to be normalized to meet its demand, without knowing the exact demand has no way of knowing whether it’s right or not. Unfortunately every time I write this the person repeats what he has already said and does not detail the demand and then it becomes difficult to say if it is right. I don’t know what those parts are for when they break down, so I don’t know if it’s right. The second part must have dup,have seen several times answers 3 tables
– Maniero
The demand you say is in terms of traffic? number of queries per time? I don’t understand...
– Nosredna
I do not know if I will be repetitive, but I will try to explain how my system works: it is a system for mechanical workshop, so I have a list of vehicles and a list of specific parts of each vehicle (e.g.: Spin - Tyre X - Wheel X - Hubcap X - Screw X ; Pallet - Tyre Y - Wheel Y - Hubcap Y - Screw Y...). So when consulting a vehicle I will know which wheel, hubcap, screw, tire I use... (Note: the table image was an example I found ready, I don’t know if it is disturbing you)
– Nosredna
How many pieces can you have in this? Always 4, can’t have 3 and can’t have 5?
– Maniero
Yes, always 4 pieces.
– Nosredna
So the answer you accepted is wrong.
– Maniero
It’s...I just realized. I did but it gave a 'false-positive''...
– Nosredna
I edited the question and put how it really works. Now I think it’s more understandable rsrs...note that in the table Filters has all filters, no matter your application (air, oil, ...) that I filter in php
– Nosredna
The problem is that you now have two wrong answers to your question because it was not done properly from the beginning, and worse, it has positive in both.
– Maniero
I may have been wrong in the formulation of the initial question, but I do not see it as wrong answers, so much so that the initial structure I made was in line with that last answer. But I changed because it greatly increased the amount of information stored...
– Nosredna
You just said they’re wrong even though they’re not.
– Maniero
Well...we can be discussing philosophically the meaning of the sentences...but did not say they were wrong, said it is not the best option, there are good and bad options, what do not classify them as wrong...follows the game...
– Nosredna