Skip to content

UofT-DSI | <SQL> - Assignment <assignment one>-->#1

Open
springzhouxx wants to merge 3 commits intomainfrom
assignment-one
Open

UofT-DSI | <SQL> - Assignment <assignment one>-->#1
springzhouxx wants to merge 3 commits intomainfrom
assignment-one

Conversation

@springzhouxx
Copy link
Copy Markdown
Owner

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

  • [✅] I can confirm that my changes are working as intended

@khsergvl
Copy link
Copy Markdown

khsergvl commented Apr 3, 2026

Great work!
Please keep eyes on git modification.

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