Display average wage by years of service

Asked

Viewed 67 times

-1

I have the FUNCIO table that has as columns matricula, name, anoServico, salary.

I would like to display the average wage per yearService.

How to do?

Thank you!

  • Why the question is pending ?!

  • The question has even been answered. Because now pending???

  • The OS seems to measure the question by size if it has 500M and recipe for ironing , if it is short is marked.... :)

1 answer

2


Santana,

In SQL there is the AVG function, which returns the mean of values.

You can use the AVG function in the wage field and group by anoServico, it would be more or less as follows:

SELECT AVG(salario) media_salaria, anoServico
  FROM FUNCIONARIO 
 GROUP BY anoServico

https://www.w3schools.com/sql/sql_count_avg_sum.asp

Browser other questions tagged

You are not signed in. Login or sign up in order to post.