Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago