Conversation
…his assignment is being submitted at the revised due date
anjali-deshpande-hub
left a comment
There was a problem hiding this comment.
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.

Cross Join: Minor issue - semicolon is missing.

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.

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