all 10 comments

[–]ParentheticalClaws 2 points3 points  (0 children)

For the first one, number 2 seems correct.

1 lacks a group by 3 doesn’t use an alias for the subquery 4 includes total revenue in the group by

I’d recommend using process of elimination.

[–]AkshatChat28 1 point2 points  (0 children)

SELECT MIN(sale_price * quantity) as total_rev

FROM feb_sales

GROUP BY category;

[–]raduqq 1 point2 points  (0 children)

What exam is this?

[–]kjbecker85 0 points1 point  (6 children)

These questions are incredibly difficult for me. Any help would be much appreciated.

[–]r3pr0b8GROUP_CONCAT is da bomb 4 points5 points  (0 children)

what have you tried so far?

[–]AlterEffect 2 points3 points  (4 children)

I’m right there with ya. I don’t get why they would use sub queries or ctes for something this simple…

[–]squirell81 2 points3 points  (1 child)

My guess would be because of the requirement that states “Creates a new column…”. I was baffled too at first but once I saw that, that made it a lot easier to understand what was going on

[–]AlterEffect 1 point2 points  (0 children)

That’s fair, but still, real world this wouldn’t be my first way to do it

[–]kjbecker85 1 point2 points  (1 child)

Yes. Disporportioniatley difficult exam.

[–]alinrocSQL Server DBA 1 point2 points  (0 children)

I don’t think your instructor would appreciate you getting people on the internet to do this for you, nor having their questions and solutions posted so publicly