R
R
random2015-04-25 07:39:29
MySQL
random, 2015-04-25 07:39:29

How to structure tables (MySQL) and classes (Java) correctly?

Good morning, I have three identical tables that only change the value of one column.
Example:
bd4d4397d52b464f876f5d4c81a86e4f.PNG
As you can see in the picture, only the value of the Cost column changes.
I quickly typed them in to make it work. I implemented it this way, I created 3 tables in MySQL (it turns out that I dilated columns for each table). After I coded one common model, then I created 3 DAO classes (for each table) and three Controllers.
Question: How can I put all this in order? (I know that you can’t do this, I just didn’t have enough experience to bring it back to normal. Also, time was not in my favor).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur, 2015-04-25
@timych

If I understood correctly, then there is one product that has three different prices? So?
Why is it impossible then to put everything in one table of the form:
NAME | PRICE_1 | PRICE_2 | PRICE_3
Formulate what the task is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question