Skip to content
Advertisement

How do I extract these SQL queries from these pandas dataframes?

SQL QUERIES

Using SQL or Pandas, please tell me how to

1. Compare the monthly sales (GMV) trend in Q4 2019, across all countries (venture_code)

2. Show the top 10 brands for each product category, based on total sales (GMV)

I wrote but got the query wrong!

Advertisement

Answer

Concerning the error, you have a space in the column name.

In SQL, if the column has a space, use brackets to wrap the column name:

In your code, use this SQL:

I don’t have access to your data, so I can’t test, but I think these queries are correct. You may need to tweak them some.

Part 1:

Part 2:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement