Back to Browse

Solving 3 CVS SQL Interview Questions

2.2K views
May 19, 2023
9:46

🧠 Don’t miss out! Get FREE access to my Skool community — packed with resources, tools, and support to help you with Data, Machine Learning, and AI Automations! 📈 https://www.skool.com/data-and-ai-automations-4579 In this video, we solve 3 different SQL interview questions asked at CVS taking you step by step on how to write the queries. Everything is coded within MSSQL and inside SQL Server Management Studio. SQL Interview Question here: https://datalemur.com?referralCode=e6YqaKye 🚀 Hire me for Data Work: https://ryanandmattdatascience.com/data-freelancing/ 👨‍💻 Mentorships: https://ryanandmattdatascience.com/mentorship/ 📧 Email: [email protected] 🌐 Website & Blog: https://ryanandmattdatascience.com/ 🖥️ Discord: https://discord.com/invite/F7dxbvHUhg 📚 *Practice SQL & Python Interview Questions: https://stratascratch.com/?via=ryan 📖 *SQL and Python Courses: https://datacamp.pxf.io/XYD7Qg 🍿 WATCH NEXT Real SQL Interview Questions Playlist: https://www.youtube.com/playlist?list=PLcQVY5V2UY4LvbRTDRVmcqZPkhCqk4Ax9 TikTok SQL Interview Question: https://youtu.be/aV3OVBkNXfA Alibaba SQL Interview Question: https://youtu.be/HA0XYk1MqRo Uber SQL Interview Question: https://youtu.be/gEMSQRj1WuM In this video, I walk through three actual SQL interview questions asked at CVS Health, breaking down each problem line by line so you can understand exactly how to approach these pharmacy analytics challenges. We start with finding the top three most profitable drugs using GROUP BY and SUM aggregations, then move to identifying manufacturers with losses using WHERE clauses and conditional logic, and finally tackle a formatting challenge that requires rounding, division, and string concatenation. Each question builds on fundamental SQL concepts like aggregate functions, grouping, ordering, and data transformation, making this perfect practice whether you're preparing for a CVS interview or just want to sharpen your SQL skills with real-world scenarios. I code everything live in PostgreSQL on DataLemur so you can see the exact syntax, common mistakes to avoid, and how to format your output to match business requirements. By the end of this tutorial, you'll know how to calculate profits, filter for losses, format currency strings, and structure complex queries that solve actual business problems. All three solutions are tested and accepted, and I explain my thought process at every step so you can apply these same techniques to your own SQL interviews. Check out DataLemur in the description below to practice these questions yourself, and don't forget to subscribe for more SQL interview prep content! TIMESTAMPS 00:00 Introduction to CVS SQL Interview Questions 00:42 Part 1: Pharmacy Analytics - Top 3 Profitable Drugs 02:36 Running and Submitting Part 1 Solution 03:02 Part 2: Analyzing Manufacturer Losses 05:12 Adding WHERE Clause and ORDER BY for Losses 06:10 Part 3: Total Drug Sales by Manufacturer 07:32 Formatting Sales Output with CONCAT 08:54 Final Solution Review and Submission OTHER SOCIALS: Ryan’s LinkedIn: https://www.linkedin.com/in/ryan-p-nolan/ Matt’s LinkedIn: https://www.linkedin.com/in/matt-payne-ceo/ Twitter/X: https://x.com/RyanMattDS Who is Ryan Ryan is a Data Scientist at a fintech company, where he focuses on fraud prevention in underwriting and risk. Before that, he worked as a Data Analyst at a tax software company. He holds a degree in Electrical Engineering from UCF. Who is Matt Matt is the founder of Width.ai, an AI and Machine Learning agency. Before starting his own company, he was a Machine Learning Engineer at Capital One. *This is an affiliate program. We receive a small portion of the final sale at no extra cost to you.

Download

0 formats

No download links available.

Solving 3 CVS SQL Interview Questions | NatokHD