4.1 Basic aggregation

 

3.4 Inverse grouping


Calculate the average salary of company employees.

SPL

A
1 =file(“EMPLOYEE.csv”).import@tc()
2 =A1.avg(SALARY)

SQL

SELECT AVG(SALARY) AS AVERAGE_SALARY FROM EMPLOYEE;

Python

df=pd.read_csv('../EMPLOYEE.csv')
avg_salary=df.SALARY.mean()

4.2 Selection as aggregation
Example codes for comparing SPL, SQL, and Python