Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create pull request for homework4 #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Create pull request for homework4 #4

wants to merge 1 commit into from

Conversation

TinaToronto
Copy link
Owner

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

Adding code

What did you learn from the changes you have made?

Unit4 & Unit5

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Yes.

-- Highest total sales
SELECT
market_date,
SUM(quantity * cost_to_customer_per_qty) AS total_sales
FROM
customer_purchases
GROUP BY
market_date
ORDER BY
total_sales DESC
LIMIT 1

UNION

-- Lowest total sales
SELECT
market_date,
SUM(quantity * cost_to_customer_per_qty) AS total_sales
FROM
customer_purchases
GROUP BY
market_date
ORDER BY
total_sales ASC
LIMIT 1

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

Yes. I got below error for above approach.

Execution finished with errors.
Result: ORDER BY clause should come after UNION not before

How were these changes tested?

Yes. SQLite

A reference to a related issue in your repository (if applicable)

None

Checklist

  • I can confirm that my changes are working as intended

None

Copy link

@niyazmnazari niyazmnazari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting the homework!
8/8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants