R
R
Rasul_qa2020-06-20 14:06:41
SQL
Rasul_qa, 2020-06-20 14:06:41

What is the relationship between tables?

I have a database schema. Tell me, I can’t understand what is the relationship between the Prices and Goods tables?
And how to display the name of the product for which there is a discount (discount) 10%.5eeded77e77f8780121080.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2020-06-20
@Rasul_qa

Why understand this connection? Well, you learned that this is a one-to-many relationship, so what? )
An example of a request if inside the discount field is 10 as 10%:

SELECT 
    g.name, p.price
FROM
    Goods AS g,
    Prices AS p
WHERE
    p.discount = 10 AND g.id = p.id;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question