Skip to content

Create pull request for homework4#4

Open
TinaToronto wants to merge 1 commit intomainfrom
homework-4
Open

Create pull request for homework4#4
TinaToronto wants to merge 1 commit intomainfrom
homework-4

Conversation

@TinaToronto
Copy link
Copy Markdown
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
Copy Markdown

@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