Data Interview Qs - Avg. sales by location in SQL

Avg. sales by location in SQL
SQL Database Querying

You are given the below tables, showing Store, Product, and Sales information for a chain of grocery stores. The columns are labeled in such a way that you should be able to interpret what each field is showing.

Store

store_idlocation
91110New York
99525Los Angeles
37340Tokyo
32016Detroit
57507London

Product

product_idproduct_nameprice_usd
31331Apples2
34611Lettuce3
49760Chicken5
26583Lemons1
20267Bread2

Sales

sale_idproduct_idstore_iddate
1313319111002/20/2020
1313319111002/20/2020
2346115750702/20/2020
3265833734002/20/2020
3346113201602/20/2020
3202679952502/21/2020
4313319952502/21/2020
5497609952502/21/2020
6346115750702/21/2020
7313319111002/21/2020

Using the tables above, write a SQL query to return the number of sales as well as the average sale price (in dollars) for a given location.

Your output should return the following columns:

locationnumber_salesavg_sale_price
XYZ
ABC



Want the solutions? Upgrade to premium to access detailed solutions to each problem (including this one).

Was this email forwarded to you? You can join our list here to receive questions


Unsubscribe

Older messages

Cleaning and analyzing employee data

Friday, January 15, 2021

Data Interview Qs Cleaning and analyzing employee data Data Analysis Python Pandas Data Manipulation Data Cleaning Below is a snippet from a table that contains information about employees that work at

Life expectancy

Monday, January 11, 2021

Data Interview Qs Life expectancy Statistics Probability Theory Conditional Probability Suppose you're analyzing a population of 100000 people, and you're trying to understand life expectancy.

Counting numbers, letters, and other things from a text file

Friday, January 8, 2021

Data Interview Qs Counting numbers, letters, and other things from a text file Python Reading Files Write a function that can take in a text file and return the number of characters in the file

Calculating quarterly moving average of revenue in SQL

Wednesday, January 6, 2021

Data Interview Qs Calculating quarterly moving average of revenue in SQL SQL Database Querying Window Function Moving Average Suppose you're working with a large conglomerate and are trying to

Best ad group

Monday, January 4, 2021

Data Interview Qs Best ad group Data Analysis Python Pandas Data Manipulation External Dataset Given the following dataset, can you identify the top 3 performing ad groups? Explain how you evaluated

You Might Also Like

Tuesday Triage #200 and giveaway

Tuesday, May 14, 2024

Your weekly crème de la crème of the Internet is here! The 200th edition featuring annual subscriptions giveaway, thoughts on nearly four years of ... ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

🎮 How AI Tools Are Changing Game Development — Grab a Pixel 8a Instead of Waiting for Pixel 9

Tuesday, May 14, 2024

Also: Sharing Your Google Maps Trip Progress, and More! How-To Geek Logo May 14, 2024 Did You Know In a bid to keep the ingredients secret, WD-40 was never patented. 🤖 The New GPT It's Tuesday!

Meta shuts down Workplace

Tuesday, May 14, 2024

Plus: Everything that happened at Google I/O and AWS CEO steps down View this email online in your browser By Christine Hall Tuesday, May 14, 2024 Hello, and welcome back to TechCrunch PM. The team

Flattening Lists of Lists, Python 3.13, Sets, and More

Tuesday, May 14, 2024

Flattening a List of Lists in Python #629 – MAY 14, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Flattening a List of Lists in Python In this video course, you'll learn how to flatten a list

Daily Coding Problem: Problem #1441 [Easy]

Tuesday, May 14, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Google. UTF-8 is a character encoding that maps each symbol to one, two, three, or four

Noonification: 3 Quick Ways to Optimize RecyclerView

Tuesday, May 14, 2024

Top Tech Content sent at Noon! Get Algolia: AI Search that understands How are you, @newsletterest1? 🪐 What's happening in tech today, May 14, 2024? The HackerNoon Newsletter brings the HackerNoon

Using 97 fewer cores thanks to PGO

Tuesday, May 14, 2024

Plus an HNSW indexed vector store library, a new Go game hits the Steam store, and is 'ok' ok?. | #​507 — May 14, 2024 Unsub | Web Version Together with Stytch logo Go Weekly Reclaiming CPU for

Ranked | The Top 6 Economies by Share of Global GDP (1980-2024) 📈

Tuesday, May 14, 2024

Gain a unique perspective on the world's economic order from this graphic showing percentage share of global GDP over time. View Online | Subscribe Presented by: Data that drives the

Free online event this Thursday: Getting ahead with time series data

Tuesday, May 14, 2024

Free Online Event Do you know how your competitors use time series data to get ahead? Join us on Thursday, May 16 at 10am PT/1pm ET for a free, hour-long online fireside chat called “Unleash the Full

Here's the deal

Tuesday, May 14, 2024

We wanted you to be among the first to know about our plans to relaunch the Gigantic training courses that Product Collective now powers! Here's the deal: From May 20th - May 31st, anybody that