added completed sql for assignment 1 and logical data model #1
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)
I am adding new SQL queries and refining existing ones to improve data retrieval accuracy and efficiency. Specifically, I added calculated columns, introduced filtering based on specific criteria (e.g., vendor IDs, purchase dates), and implemented JOIN operations to integrate related tables. Additionally, I created new reports summarizing vendor booth rentals and customer spending.
What did you learn from the changes you have made?
I learned how to use SQL aggregate functions like SUM() combined with GROUP BY and HAVING clauses to filter aggregated results. I also gained experience with conditional logic in SQL using CASE statements and how to properly join multiple tables to enrich data queries.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
I considered using subqueries instead of JOINs for some tasks, such as calculating total customer spending, but opted for JOINs for better readability and performance. Additionally, I thought about creating temporary tables to store intermediate results for complex queries but decided to keep everything in single queries for simplicity.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
One challenge I dealt with was syntax errors like stray commas in clauses, which I resolved through careful review and testing.
How were these changes tested?
I tested the queries by running them in DB Browser for SQLite, verifying that the outputs matched expected results. For aggregate queries, I cross-checked totals manually and ensured filters returned correct subsets. Additionally, I validated that JOIN operations returned correct combined data from related tables.
A reference to a related issue in your repository (if applicable)
N/A
Checklist