Skip to content

Assignment Two submission#2

Open
aravijay wants to merge 3 commits intomainfrom
assignment-two
Open

Assignment Two submission#2
aravijay wants to merge 3 commits intomainfrom
assignment-two

Conversation

@aravijay
Copy link
Owner

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

I have made a logical model for a bookstore with a relevant and believable internal structure for its potential day-to-day operations. I've also updated Assignment2.sql's questions with their appropriate responses (questions related to COALESCE, string manipulation, CROSS JOINS, etc)

What did you learn from the changes you have made?

I've learned how to make detailed subqueries and use window functions to group rows as iterative blocks for aggregate functions to work off of.

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

I was considering doing all of the questions using only CTEs, but some of the code just looked more readable via temp tables instead.

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

UPDATE and SET were a little confusing, especially because SET did not automatically behave when I tried "SET temp.product_units.current_quantity = cq.current_quantity where temp.product_units.product_name = cq.product_name" unless I made a subquery for SET instead. (I assume this is because SET can't work with 2 columns from different tables at the same time?)

How were these changes tested?

These were tested on a fresh database and iteratively checked with SELECT * queries of every temp table and interim step.

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

Checklist

  • I can confirm that my changes are working as intended

Copy link

@DwardEE DwardEE left a comment

Choose a reason for hiding this comment

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

Great effort!

I don't seem to be able to find your diagram for part 3 in section 1. Could you please also submit that?

For your SQL code, the Window Q3 COUNT requires you to use a windowed function. That would be using COUNT(*) OVER(...) without GROUP BY.

Also for UNION, your code calculates MIN/MAX count of purchases, not total sales.

Please make these changes and then resubmit. Thanks.

@aravijay
Copy link
Owner Author

Thanks for the heads up! I've submitted the appropriate files and fixes.

Copy link

@DwardEE DwardEE left a comment

Choose a reason for hiding this comment

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

Everything looks good now. No changes are further needed.

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