Data Interview Qs - Projecting landfill volume

InterviewQs

Projecting landfill volume

SQL Database Querying Subquery Forecast

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

Suppose you are given two tables containing information around various landfills across the United States. The table columns are defined as follows:

  • table: landfill_weights
    • landfillID - the unique ID of the landfill
    • base_weight - the current weight (in tons) of trash at the landfill
    • number_garbage_vehicles - the number of garbage vehicles available in the fleet
  • table: landfill_monthly_flows
    • monthly_inflow - the monthly inflow of trash to the landfill (in tons)
    • monthly_outflow - the monthly outflow of trash to the landfill (in tons) through incineration

Using the tables below, write a SQL query to return the projected base_weight of landfills by state in 3 months. You can view/query the data in an interactive fiddle here.

landfill_weights

landfill_id base_weight state number_garbage_vehicles
12300 95 California 1005
12401 85 California 850
00992 105 New York 1300
00882 100 New York 1000
11100 55 Michigan 580
11201 75 Michigan 700
11207 60 Michigan 500

landfill_monthly_flows

monthly_inflow monthly_outflow landfill_id
12300 23 17
12401 17 15
00992 25 20
00882 22 18
11100 6 4
11201 12 9
11207 10 8



 

You’ve accumulated 301 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


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

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Older messages

Weather simulation using stochastic modeling

Wednesday, June 1, 2022

Python, Data Structures, Arrays, Markov Simulation, Markov Chains, Statistics, InterviewQs Weather simulation using stochastic modeling Python Data Structures Arrays Markov Simulation Markov Chains

Generating partitions

Monday, May 30, 2022

Python, Data Structures, Arrays, Recursion, InterviewQs Generating partitions Python Data Structures Arrays Recursion Forward this email to a friend or colleague and challenge them to solve it. Hi,

Independent vs. Uncorrelated Variables

Friday, May 27, 2022

Statistics, Independent, Uncorrelated, Probability Distribution, InterviewQs Independent vs. Uncorrelated Variables Statistics Independent Uncorrelated Probability Distribution Forward this email to a

Avg interview scores by location

Wednesday, May 25, 2022

SQL, Database Querying, Statistics, InterviewQs Avg interview scores by location SQL Database Querying Statistics Forward this email to a friend or colleague and challenge them to solve it. Hi, Suppose

Rain in the US

Monday, May 23, 2022

Data Analysis, Python, Pandas, Data Manipulation, Data Visualization, External Dataset, InterviewQs Rain in the US Data Analysis Python Pandas Data Manipulation Data Visualization External Dataset

You Might Also Like

Infographic | How Small Investments Make a Big Impact Over Time 📈

Thursday, March 28, 2024

Compound interest is a powerful force in building wealth. Here's how it impacts even the most modest portfolio over the long term. View Online | Subscribe Presented by: EnergyX's groundbreaking

Fully Autonomous Development, AI .NET Components, Data Visualization ML Tutorial, More

Thursday, March 28, 2024

Home | News | How To | Webcasts | Whitepapers | Advertise .NET Insight March 28, 2024 THIS ISSUE SPONSORED BY: ■ Visual Studio Live! Chicago: .NET Developer Training Conference ■ dtSearch® - INSTANTLY

Daily Coding Problem: Problem #1395 [Hard]

Thursday, March 28, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Google. Implement an LRU (Least Recently Used) cache. It should be able to be

72 x $99 tickets left for virtual product conference (May 2)

Thursday, March 28, 2024

​ACT FAST!​ ONLY 72 TICKETS AVAILABLE AT THE DISCOUNTED RATE OF $99! MAY 2, 2024 | ONLINE ACROSS THE WORLD Join product people from around the world on Thursday, May 2, for INDUSTRY, the #1 Virtual

⚙️ "I'm a GPT builder" 😎

Thursday, March 28, 2024

Plus: Elon's Grok will be available to all ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

🔒 The Vault Newsletter: March issue 🔑

Thursday, March 28, 2024

Get the latest business security news, updates, and advice from 1Password. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

📑 Discover The Power of AI With UPDF — 63% Off For a Limited Time

Thursday, March 28, 2024

Digitally Read/Sign/Edit/Summarize PDFs Seamlessly. Available Now at a Huge Discount! How-To Geek Logo March 28, 2024 Tired of Dealing With PDFs? Try AI-Powered UPDF With the Biggest Discount of the

Issue 310 - New Autopark looks awesome!

Thursday, March 28, 2024

View this email in your browser If you are just now finding out about Tesletter, you can subscribe here! If you already know Tesletter and want to support us, check out our Patreon page Issue 310 - New

Programmer Weekly - Issue 199

Thursday, March 28, 2024

View this email in your browser Programmer Weekly Welcome to issue 199 of Programmer Weekly. Let's get straight to the links this week. Quote of the Week "Optimization hinders evolution.

wpmail.me issue#660

Thursday, March 28, 2024

wpMail.me wpmail.me issue#660 - The weekly WordPress newsletter. No spam, no nonsense. - March 27, 2024 Is this email not displaying correctly? View it in your browser. News & Articles What's