Question: User A company stores data about its employees in two tables, employees and positions, with the following structure: create table employees ( id integer not

User A company stores data about its employees in two tables, employees and positions, with the following structure: create table employees ( id integer not null unique, name varchar(38) not null, age integer not null, salary integer not null create table positions ( id integer not null unique, department_name varchar(30) not null, employee_id integer not null unique, position_name varchar(38) not null ); Each record in the table employees represents a single employee and consists of the following data: id, name, age and salary. Each record in the table positions represents the position description of a single employee and consists of the following data: id, department_name, employee_id and position_name. Note: employee_id represents id of employees from previously mentioned employees table. Write an SQL query that calculates the average salary of all employees who are working in a Software Engineer position and are at most 30 years old. If there are no such employees then the answer should be NULL

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!