TGViewer
Data Analyst Interview Resources Data Analyst Interview Resources @dataanalystinterview · 52.6K subscribers
Post #2414 1.25K
🔥 SQL Interview Question of the Day

📌 Scenario:

A food delivery company wants to find the average delivery time taken by each city.

You have one table:

deliveries

• delivery_id
• customer_id
• city
• order_time
• delivery_time

☑ Solution:

SELECT
city,
AVG(
TIMESTAMPDIFF(MINUTE, order_time, delivery_time)
) AS avg_delivery_time
FROM deliveries
GROUP BY city
ORDER BY avg_delivery_time;

💡 Concept Tested:

GROUP BY + Date Time Functions + Aggregate Functions

(Calculating Performance Metrics From Time-Based Data)

❤️ React if you want more SQL interview questions.
  • 👍 3
  • ❤ 2
More from @dataanalystinterview
  1. Oct 1, 2026🔥 Top 10 Theoretical Interview Questions Every Data Analyst Must Prepare 📊 Data Analyst…
  2. Sep 29, 2026🚀 Excel Formulas Fundamentals — Part 10 📊 Conditional Functions (SUMIF, SUMIFS, COUNTIF,…
  3. Sep 29, 2026𝗙𝗥𝗘𝗘 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗧𝗼 𝗟𝗲𝗮𝗿𝗻 𝗔𝗜 𝗶𝗻 𝟮𝟬𝟮𝟲🚀 ​ Explore 6 free resource…
  4. Sep 29, 2026📊 Tableau Learning Roadmap — Part 2 Connecting to Data Before creating visualizations in…
  5. Sep 28, 2026This is useful when you want to guide someone through an analytical narrative. The Tableau…
  6. Sep 28, 2026📊 Tableau Learning Roadmap — Part 1 What is Tableau? Tableau is a Business Intelligence a…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →