Open
Conversation
niyazmnazari
approved these changes
Nov 19, 2025
niyazmnazari
left a comment
There was a problem hiding this comment.
Thank you for submitting assignment 1. All sections are correct.
Mark: 30/30
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.
UofT-DSI | SQL - Assignment 1
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
This pull request adds my completed solutions for Assignment 1 in the SQL module.
Changes include:
SELECT,WHERE, andORDER BYtasks.COUNT,SUM, andAVGwithGROUP BY.HAVINGto filter grouped results based on aggregate conditions.customer,customer_purchases,vendor, andvendor_booth_assignments.new_vendor) based on the originalvendortable, then inserted an additional vendor row.What did you learn from the changes you have made?
From this assignment I:
WHERE(filters rows) andHAVING(filters groups after aggregation).GROUP BYcorrectly by ensuring all non-aggregated selected columns are included in the grouping.INNER JOINqueries to combine information from multiple tables.Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
In a few places I considered:
WITHclauses) instead of writing everything in a singleSELECTwith joins, especially for the “big spenders” type queries.COUNT(*)versusCOUNT(column)depending on whether I wanted to include potentialNULLvalues.For this assignment, I stayed close to the patterns shown in the course materials and used straightforward joins and aggregations.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
Yes, a few:
GROUP BYand aggregates:Initially I forgot to include all non-aggregated columns in the
GROUP BYclause, which caused errors. I fixed this by systematically checking that every column inSELECTwas either aggregated or listed inGROUP BY.Using
HAVINGcorrectly:I first tried to use aggregate functions in the
WHEREclause. I resolved this by moving those conditions intoHAVINGand keepingWHEREonly for row-level filters.Temporary table behavior:
I was confused when creating and inserting into a temp table because nothing appeared to “show up” at first. I realized that:
CREATEandINSERTdo not return result sets, so I needed an explicitSELECT * FROM new_vendor;After those adjustments, all queries ran as expected.
How were these changes tested?
A reference to a related issue in your repository (if applicable)
Not applicable for this assignment; this PR is only for completing Assignment 1 for the SQL module.
Checklist
I can confirm that my changes are working as intended