Menu
Coddy logo textTech

Adjust Watt

Part of the Fundamentals section of Coddy's SQL journey. Lesson 52 of 72.

challenge icon

Challenge

Easy

Available tables and columns:

  • <strong>enom_gilpane</strong>: <strong>part_id</strong>, <strong>rpm</strong>, <strong>watt</strong>, <strong>size</strong>

In this project you are a visitor in an imaginary product factory. You want to find the best quality products to buy for your industry.

Each table represents a product and each product has many parts. All tables (which will be added in later challenges) have the same columns.

For this challenge we will focus only on one product (table)

Your task is to adjust the watt values: For each row, add the overall average watt value (calculated from the entire table) to the existing watt value of that specific part.

In other words, calculate the average watt across all parts in the table, then add this same average to each individual part's watt value.

Return part_id, rpm, adjusted_watt and size

Try it yourself

-- For each row, add the average of the whole table to the value in that row
SELECT part_id, rpm, watt + ____ AS adjusted_watt, size
FROM enom_gilpane

All lessons in Fundamentals

Practice on your own: SQL playground