I'm starting to study the SQL language and the interaction between tables, and I came across an exercise in a list that I can not solve.
It asks for the following:
For each existing product, tell what sales were made and how many items were ordered.
I tried this solution but did not get the expected response:
SELECT
p.nome, COUNT(i.fk_venda)AS qtd_venda
FROM
tb_produto AS p, tb_itens AS i
WHERE
p.pk_produto=i.fk_produto
GROUP BY
p.nome;