Given Hw3 restaurant menu situation, write SQL and dataframe ways (a,b) in jupyter notebook setup to find the dish with the second highest price (not 2ndranked, but 2ndhighest price) of the whole menu...

1 answer below »







  1. Given Hw3 restaurant menu situation, write SQL and dataframe ways (a,b) in jupyter notebook setup to find the dish with the second highest price (not 2ndranked, but 2ndhighest price) of the whole menu




  2. Do 1 in SQL and dataframe ways (a,b) but 2ndhighest price in its own category (hint: consider using the methodology in 3 below on your way to final solution)




  3. Use dataframe way to display all dishes (category, dish, price) that is neither the highest nor the lowest in its own category. You can get partial credit if you can show only the prices, but not the dish names or category names. Extra credit if you can show two different ways, one using set difference and the other not.




  4. Given a csv file daily temp readings, with a table having column headings: Day (1 to 356), year, T(temperature), write SQL code and dataframe method (a,b) to find a pair of days in 2019 that are 7 days apart whose T difference is closest to 5 (could be above or below).






    *This is hw 3 reference

























































































    menu
    categorydishprice
    entreeChicken Parmigiana20
    entreeSalmon23
    entreeBeef40
    entreeLamb37
    saladsTomato Watermelon27
    saladsCaesar10
    saladsGreen Leaf12
    saladsCole Slaw15
    dessertIce Cream18
    dessertCake23
    dessertJello11
    dessertSmoothie5


Answered 4 days AfterApr 07, 2021

Answer To: Given Hw3 restaurant menu situation, write SQL and dataframe ways (a,b) in jupyter notebook setup to...

Sandeep Kumar answered on Apr 12 2021
144 Votes
1.
SELECT MAX( price ), dish
FROM menu
WHERE price NOT IN ( SELECT MAX( price )
FROM menu )
df['price'].nlargest(2).values[-1]
2.
SELECT MAX( price ), dish
FROM menu
WHERE price NOT IN ( SELECT MAX( price )
FROM menu ) AND menu.category = 'entree'
df['price'].nlargest(2).values[-1] & df[‘category] == ‘entrée’
SELECT MAX( price ), dish
FROM menu
WHERE price NOT IN ( SELECT MAX( price )
FROM...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here