Skip to content

Create Anna Hromova#4

Open
HromovaAnna wants to merge 1 commit intomainfrom
Homework_4
Open

Create Anna Hromova#4
HromovaAnna wants to merge 1 commit intomainfrom
Homework_4

Conversation

@HromovaAnna
Copy link
Copy Markdown
Owner

What changes are you trying to make?
Adding new SQL queries to handle NULL values in the product table using COALESCE, creating customer visit numbering using ROW_NUMBER(), and calculating the total number of purchases per product using a window function. Additionally, string manipulations for product descriptions and a UNION query for highest and lowest market sales are implemented.

What did you learn from the changes you have made?
I learned how to manage NULL data efficiently using COALESCE, how to use window functions like ROW_NUMBER() and DENSE_RANK() to rank or number records, and how to use INSTR() for string manipulation to extract specific parts of a string.

Was there another approach you were thinking about making?
Yes, I considered using a CASE statement for the product description extraction but opted for INSTR() and SUBSTR() to make the query more dynamic and adaptable for various product names.

Were there any challenges?
The main challenge was ensuring that NULL values were handled correctly across different columns without affecting non-NULL data. Another challenge was managing string manipulation with varying product name formats. These were resolved by applying COALESCE and testing string functions like INSTR() to dynamically split values.

How were these changes tested?
The changes were tested using a set of sample data with both valid and NULL values. The output was verified to ensure correct formatting of product names, proper ranking of customer visits, and accurate handling of highest and lowest market sales using a UNION query.

Copy link
Copy Markdown

@amanda-ng518 amanda-ng518 left a comment

Choose a reason for hiding this comment

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

HW4 8/8

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