TGViewer
Data Analytics Data Analytics @sqlspecialist · 111K subscribers
Post #3165 1.96K
9️⃣ How would you calculate month-over-month growth?

Sample Answer:

“I would first retrieve the previous month's sales using LAG(), then calculate the percentage change between the current month and previous month.”

SELECT Month,
Sales,
LAG(Sales) OVER (ORDER BY Month) AS Previous_Sales,
(Sales - LAG(Sales) OVER (ORDER BY Month))
* 100.0 /
LAG(Sales) OVER (ORDER BY Month) AS MoM_Growth
FROM Monthly_Sales;


“I would also handle cases where the previous month's value is zero or NULL to avoid incorrect calculations.”

🔟 What is the difference between DELETE, TRUNCATE, and DROP?

Sample Answer:

“DELETE removes selected rows from a table and can be used with a WHERE condition.

TRUNCATE removes all rows from a table while keeping the table structure.

DROP removes the entire table, including its structure and data.

So, the key difference is whether I'm removing specific records, all records, or the entire table itself.”

📌 Double Tap ❤️ For Part-4
  • ❤ 15
More from @sqlspecialist
  1. Oct 4, 2026📊 Data Analyst Interview Series — Part 3 Guys, let's continue our Data Analyst Interview…
  2. Sep 29, 2026🔟 How would you find duplicate records in SQL? Sample Answer: "I would first identify the…
  3. Sep 29, 2026📊 Data Analyst Interview Series — Part 2 Guys, let's continue our Data Analyst Interview…
  4. Sep 29, 2026𝗙𝗥𝗘𝗘 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗧𝗼 𝗟𝗲𝗮𝗿𝗻 𝗔𝗜 𝗶𝗻 𝟮𝟬𝟮𝟲🚀 ​ Explore 6 free resource…
  5. Sep 29, 2026"After identifying duplicates, I investigate whether they are genuine duplicate records or…
  6. Sep 29, 2026📊 Data Analyst Interview Series — Part 1 Guys, let's start a Data Analyst Interview Serie…
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 →