Who Are We Helping?

558fe5180e0e8fc922d31c23ef84d240

It’s hard to deny the truth that for a lot of us “difficult” means “good,” and “more difficult” is “even better.” From video games to exercise to music to cooking, if someone accomplishes something perceived as hard to do, it’s a clear indication of their skill. Conversely, saying something is easy or simple is often a veiled insult, an insinuation that anyone could do it and therefore the thing is therefore barely worth acknowledging.

And, while I don’t want to discount the system upon which so much of our leisure activities are based, I think this is a lesson we in IT have taken too much to heart. I’m writing today to ask us to all consider shifting our thinking in the direction of “easy can also be good.” In fact, things which are easy are often better overall than things that require a greater level of individual virtuosity.

My query statement isn’t working correctly

Category Image 101

There are 2 tables as orders$ and 'order items$'
orders$ Table have 4 columns as order_id, customer_id, status, order_date
'order items&' Table have 4 columns as order_id, item_id, product_id, quantity

I want to modify the SQL statement to show an average number of products each customer had on their orders.

SELECT DISTINCT (c.customer_id) AS CustomerID, o.order_id AS OrderID, AVG(o.product_id)AS AvgProductOrdered
FROM orders$ c
INNER JOIN ['order items$'] o ON c.order_id = o.order_id
WHERE c.order_id = o.order_id
GROUP BY c.customer_id, o.order_id
ORDER BY AvgProductOrdered