Instruction
Perfect! How about a slightly more complicated example with INSERT INTO?
Exercise
We've created another table called project_worktime. It has the following columns: project_id and avg_worktime.
Your task is to insert the average number of hours spent on each project into the new table project_worktime. (Use the table allocation.) Each time, insert the project_id and the average hours_spent.
Important: Do not insert any data for project_id = 1.
Stuck? Here's a hint!
You'll need two CTEs:
- One to get the sum of hours spent by a given user on a given project, and
- One to get the average sum of hours per project, based on the result of the first CTE.



