The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Feedback…plase :) 

Feedback…plase :) 

0
Votes
1
Answer

CREATE TABLE new_table
(
SELECT t1.first_name, t1.last_name, round(avg(salary),1) AS average_salary, round(sum(salary),1) AS totall_salary, t4.dept_name
FROM (((employees t1
JOIN salaries t2 ON t1.emp_no = t2.emp_no)
JOIN dept_emp t3 ON t1.emp_no = t3.emp_no)
JOIN departments t4 ON t4.dept_no = t3.dept_no)
GROUP BY t1.emp_no
ORDER BY totall_salary
); 
# rock n’ roll!

1 Answer

365 Team

Hi Luigi!
Thanks for reaching out!
This query looks great to me! There’s nothing that really needs to be changed in it, provided that it replies to your initial task. 
Best,
Martin