UofT-DSI | <SQL> - Assignment <assignment one>-->#1
Open
springzhouxx wants to merge 3 commits intomainfrom
Open
UofT-DSI | <SQL> - Assignment <assignment one>-->#1springzhouxx wants to merge 3 commits intomainfrom
springzhouxx wants to merge 3 commits intomainfrom
Conversation
|
Great work! |
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)
This submission includes three components: a logical data model, a series of SQL queries practice, and a reflective analysis. First, I developed a relational diagram using LucidChart to map the connection between the product and customer_purchases tables, defining primary keys and relationship types. Second, I created SQL scripts covering data selection, conditional logic using CASE statements, table joins, and complex aggregations with HAVING clauses, etc. Finally, I included an essay discussing the socio-technical nature of databases and how data architectures can inadvertently encode societal values.
What did you learn from the changes you have made?
Through this assignment, I gained a deeper understanding of the Execution logic in SQL, specifically about the HAVING clause. On the modeling side, I strengthened my ability to visualize many-to-one relationships, which is a critical skill for my doctoral research as well involving large-scale educational datasets.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
N/A
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
One technical challenge is the INSERT INTO process for the temporary table, we did not cover it in the class, so I did some research to find out. Secondly, regarding of HAVING clause, I initially attempted to use the alias total_spend within the HAVING clause, which resulted in an "unknown column" error. I overcame this by thinking about the SQL Order of Execution again and rewrite the code.
How were these changes tested?
Each query was executed successfully with the farmersmarket.db database. I verified the results by comparing the output with data browsing. For the aggregation query, I manually cross-referenced a few customer IDs to ensure the SUM calculation correctly.
A reference to a related issue in your repository (if applicable)
N/A
Checklist