Open
Conversation
DwardEE
suggested changes
Nov 25, 2025
DwardEE
left a comment
There was a problem hiding this comment.
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.
Owner
Author
|
Thanks for the heads up! I've submitted the appropriate files and fixes. |
DwardEE
approved these changes
Nov 27, 2025
DwardEE
left a comment
There was a problem hiding this comment.
Everything looks good now. No changes are further needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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