Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
Introduction
Quiz
13. INSERT INTO with CTE
Summary

Instruction

Perfect! How about a slightly more complicated example with INSERT INTO?

Exercise

We've created another table called ProjectWorktime. It has the following columns: ProjectId and AvgWorktime.

Your task is to use the table Allocation and insert the average total number of hours spent by employees on each project into the new table ProjectWorktime. Insert the ProjectId and the average HoursSpent. Additionally, do not insert any data for ProjectId = 1.

First, count the total number of hours spent by each employee on each project which ID is not 1. Then, insert into ProjectWorktime table the average total number of hours spent on each project.