Q
Q
Qeinzo2021-11-01 19:34:53
Database
Qeinzo, 2021-11-01 19:34:53

Is it possible to get data without a direct relationship between tables?

Logical database model (ignore that there are no intermediate tables for many-to-many):

spoiler
61801619a0301487584327.png

As you can see in the figure, the "Price" table is not related to the "Orders" table. But in the table "Orders" there is a field attribute "Margin".

Question: Is it possible to get the prices of goods from the "Orders" table through the "Products" table to calculate the margin? Or do they need to be linked together?

The same principle applies to the "Supplies" and "Goods" tables. Is it possible to enter information about the purchase price without having a direct link between "Supplies" and "Price"?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-11-01
@Qeinzo

Can. Joins do not require FKs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question