Tecnologia da Informação Banco de Dados Linguagem SQL

A empresa planeja fechar algumas lojas baseando-se no valor vendido, calculado por funcionário. Para tomar essa decisão, o seguinte comando escrito em SQL pode ser utilizado:
  • A. SELECT CodLoja, Total/NumeroDeFuncionarios AS Media FROM (SELECT CodLoja, SUM(Valor) As Total FROM VENDA GROUP BY CodLoja) AS V NATURAL JOIN LOJA ORDER BY Media
  • B. SELECT CodLoja, Total/NumeroDeFuncionarios AS Media FROM (SELECT CodLoja, COUNT(Valor) As Total FROM VENDA GROUP BY CodLoja) AS V NATURAL JOIN LOJA ORDER BY Media
  • C. SELECT CodLoja, AVG(Total/NumeroDeFuncionarios) AS Media FROM (SELECT CodLoja, SUM(Valor) As Total FROM VENDA GROUP BY CodLoja) AS V NATURAL JOIN LOJA ORDER BY Media
  • D. SELECT CodLoja, AVG(Total/NumeroDeFuncionarios) AS Media FROM (SELECT CodLoja, COUNT(Valor) As Total FROM VENDA GROUP BY CodLoja) AS V NATURAL JOIN LOJA ORDER BY Media