Skip to content

Edited Assignment2 SQL and Markdown files, and created two ERDs as per assignment instructions#2

Open
amera6 wants to merge 1 commit intomainfrom
assignment-two
Open

Edited Assignment2 SQL and Markdown files, and created two ERDs as per assignment instructions#2
amera6 wants to merge 1 commit intomainfrom
assignment-two

Conversation

@amera6
Copy link
Owner

@amera6 amera6 commented Nov 16, 2025

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

I created two Logical Models for the relationship between entities for a hypothetical bookstore. The first model (titled "ERD2.pdf" contains the relationships between the following tables: customers, books, orders, sales, and employees. The second model (titled "ERD3.pdf") is the same but also includes a table for employee shifts. I also added my code to the assignment2 SQL file and my written responses to the assignment2 markdown file.

ERD3.pdf
ERD2.pdf

What did you learn from the changes you have made?

I learned a lot about handling NULL values, combining rows from different tables, combining columns from seemingly exclusive tables, and updating/deleting entries from existing tables. I also get to try out designing a hypothetical database from scratch with the bookstore example in section 1.

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

I know that there was flexibility with how to approach certain questions like Q1 for Windowed Functions and Q1 for Unions, but I mainly stuck with the example workflows suggested in the code as I could not think of any other approaches to take this time.

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

For the UNION question in section 2, I tried to order the rows and filter the top/bottom ranks within the SELECT line of two subqueries that sandwich the UNION function. This yielded no results despite each individual subquery producing the table that I wanted (one with the highest sales day and another with the lowest sales day) . Upon looking it up, I realized that the UNION statement may not allow for in-line filtering and ordering in the SELECT lines. So, I had to rank and filter separately for each sub-table in the FROM line instead of the SELECT line.

How were these changes tested?

I would select specific portions of each code block and run them to ensure that my subqueries were correct before putting them into a larger query. I also made sure to double check values using the 'browse data' tab in DB Browser.

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

Checklist

  • I can confirm that my changes are working as intended

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 well done!! 70/70

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