Skip to content

Conversation

@evankchan
Copy link
Owner

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

I was mostly editing the md text file to include my answers to the prompts, but also coding SQL! In the SQL file you will find a collection of queries!

What did you learn from the changes you have made?

I learned a lot about SQL programming particularly with queries, aggregate functions, and windowed functions... as well as extravagant joins such as CROSS JOIN

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

The final coding question, there were multiple approaches that I thought about, such as did a temp table need to be made? Which is ultimately what I did! :)

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

Subqueries were my weakness! I mostly read up about it and did some more research. My brain doesnt seem to like the "nested" stuff.

How were these changes tested?

I ran in SQLite and copy and pasted them into sql in VSCode

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

N/A

Checklist

  • I can confirm that my changes are working as intended

…his assignment is being submitted at the revised due date
Copy link

@anjali-deshpande-hub anjali-deshpande-hub left a comment

Choose a reason for hiding this comment

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

Very Good! 63/70

I liked reading your response for Section 4. Thank you for sharing your personal experience.

Section 2:
Union query: The query has syntax errors (There is no table named vendor_daily_sales). Please see attached screenshot.
Screenshot 2025-11-15 230427

Cross Join: Minor issue - semicolon is missing.
Screenshot 2025-11-15 230343

Insert Query: Although the query is correct, the requirement is to create product_units table.

Delete Query: The requirement is to delete the older record for the product added.

You can use MIN(snapshot_timestamp) function. Using the WITH clause and MIN function, identify the earliest snapshot for the product_id and then delete the row that matches that product_id and timestamp.

Update query: The technique of creating the temp table looks good. But, you should update the quantity and not product_name field in the second query. I am also getting syntax error when executing this query because of missing semicolon, quantity_latest2 instead of temp.quantity_latest2.
Screenshot 2025-11-15 233955

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.

3 participants