SQL Exercise: Average salaries of the employees works as ANALYST
SQL employee Database: Exercise-13 with Solution
[An editor is available at the bottom of the page to write and execute the scripts.]
13. From the following table, write a SQL query to calculate the average salary of employees who work as analysts. Return average salary.
Sample table: employees
SELECT avg(salary) FROM employees WHERE job_name = 'ANALYST';
avg ----------------------- 3100.0000000000000000 (1 row)
The provided query in SQL that selects the average salary of all employees with the job title 'ANALYST' from the 'employees' table.
The "WHERE" clause filters the results of all employees with the job title 'ANALYST'.
Relational Algebra Expression:
Relational Algebra Tree:
Sample Database: employee
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join