/sql-vs-pandas

SQL vs Pandas. All the most popular queries

Primary LanguageJupyter Notebook

What:

Jupyter notebook:

  • Creation and filling of the SQL database
  • View tables
  • Creating Pandas dataframes for basic SQL tables
  • Show the names of sweets which weight is 300
  • Show the names of sweets which cost is 100
  • Find a list of sweets that start with "M"
  • Names of sweets that have a cost of 150 and a weight of 300
  • Names of sweets which cost is from 200 to 300
  • Sort names of sweets by ID in descending order
  • Find the name of the sweet with the highest price
  • Which cities have storehouses?
  • Find manufacturers in more than one city
  • Find the names of all chocolates
  • Find the number of sweets for each type. In the response, display the name of the type and the quantity
  • Find types of sweets that have more than 2 quantity
  • Which cities have storehouses with sweets "Milty"?
  • How many sweets are in each storehouse?
  • Find storehouses with more than 8 sweets
  • Selection

Why:

This code was prepared for this article: https://medium.com/@axegggl/sql-vs-pandas-all-the-most-popular-queries-2b9e0cfa9f97


Python 3.10.5 numpy 1.23.0 pandas 1.4.2