MySQL Forums
Forum List  »  Newbie

Re: My SQL Challenge Question, Can You Solve it?
Posted by: Phillip Ward
Date: September 20, 2016 05:28AM

Quote

Write a single MySQL query that calculates the total impressions, clicks, conversions, spend, & revenue for all users whose email contains the domain “@foobar.com”.

Done.

Sounds far too much like homework to just hand over the query, though.

I needed to use the "sum()" aggregate function a few times, an "inner join" clause to connect the main data table (which you didn't tell us the name of, BTW) to the "users" table by client_id and a "where" clause to filter the resulting set of rows, based on the email address domain (a condition that, in the Real World, would be hideously inefficient).

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: My SQL Challenge Question, Can You Solve it?
September 20, 2016 05:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.