I'm not very good with database relationships and I'm starting my studies.
I would like to know why developers shorten when calling tables or if this is mandatory?
SELECT p.*, c.'nome' AS categoria, u.'nome' AS usuario FROM 'produtos' AS p
INNER JOIN 'categorias' AS c ON p.'categoria_id' = c.'id'
INNER JOIN 'usuarios' AS u ON p.'usuario_id' = u.'id'
WHERE (p.'ativo' = 1) ORDER BY p.'nome' ASC
This is very confusing, I know that he is joining 2 tables in a query but I do not understand this:
p.* , p.´nome´, c.'nome', u.'nome'