H
H
Helo89892021-03-27 21:48:17
Java
Helo8989, 2021-03-27 21:48:17

How to organize dependency of SQL links?

There are three tables that contain chemical elements of different types. According to the formulas, you need to calculate the total of which element is needed in what quantity. Let's take a value from table_1 with id_1 and multiply it by the value from table_2 with id_3, display it on the screen and then multiply it by the value from table_3 with id_8. Do I understand correctly that in this case I do not need to link tables by foreign keys, since there are no permanent links in this case? Just starting to learn SQL queries

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Orkhan, 2021-03-27
@Helo8989

Good afternoon!

Do I understand correctly that in this case I do not need to link tables by foreign keys, since there are no permanent links in this case?

I'll assume yes. Although for a more precise answer it would be nice to see the full problem.
In this case, you are looking for a row with a specific id and perform this or that operation. Moreover, as far as I understand, you have a chem. elements are scattered across 3 tables. If you cannot logically link these tables to each other, then most likely links through FK are not needed.
And this question is more about the SQL tag than the Java tag

C
Cheypnow, 2021-03-27
@Cheypnow

If there are no specific relationships between elements, then foreign keys are not needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question