Solving Easy SQL Interview Questions on Analyst Builder

Alex The Analyst · Beginner ·📊 Data Analytics & Business Intelligence ·2y ago

Key Takeaways

This video demonstrates solving easy SQL interview questions using Analyst Builder, covering topics such as filtering data, ordering output, and using SQL functions like COUNT and WHERE clause. The video uses MySQL and Analyst Builder as tools for practicing SQL technical interview questions.

Full Transcript

what's going on everybody welcome back to another video today we're going to be solving easy SQL technical interview [Music] questions now when I was interviewing for data analyst positions I almost always got some type of technical interview and the vast majority of the technical interviews that I got were in squel not only that but I was also on a hiring team and then later as a hiring manager I almost always conducted some type of SQL technical interview now why do hiring managers conduct these interviews it's because they want to make sure that you actually know the skill because you can just put SQL on your resume and not actually know it at all and then when they hire you they have to spend two three four months training you on the basics of SQL for you to actually understand it and use it that is not what any hiring manager wants and so that's why they conduct these SQL technical interviews so in this series we're going to start with easy questions that'll be in today's video then we'll go on to medium hard and then very hard SQL technical interview questions so without further Ado lunch up on my screen and take a look at the easy SQL interview questions we're going to be practicing these questions on analyst builder.com and if we come right over here we can filter to the free questions and we can filter to the easy questions these are all the free and easy questions that you can go and take right now I will leave a link in the description I will also leave a link to the two questions that we're going to be looking at today but go ahead and check out this if you want to try out all of these different questions there's also different difficulties so we're going to be working through the moderate and the hard ones in future videos and then we'll also be looking at the very difficult ones in the very last video in this series but let's go ahead and get rid of this cuz we're going to go over to our very first question now really quickly I just want to show you the interface before we actually dive into the question now we're going to be solving this in my SQL but you can also practice in postra SQL and Microsoft SQL Server whichever one you have an interview coming up for if that company uses Microsoft SQL Server come in here and use Microsoft SQL server and we also have python as well but we're going to be doing this in MySQL this is where we'll write our actual SQL code then we have the prompt now in an interview typically they're going to give you some type of prompt and then the data they're going to ask you to do something with the data and our data is right down here so this is our data now this is a practicing platform right to practice for technical interview questions or practice for technical interviews so we also have hints and expected output as well as a video explanation walking through this question showing you exactly how to do it um but if you can't get it at all you can always come here and look at the solution for any of these but let's go ahead and start this question the question is called car failure it says cars need to be inspected every year in order to pass inspection and be street legal if a car has any critical issues it will fail inspection or if it has more than three minor issues it will also fail write a query to identify the cars that passed inspection output should include the owner name and vehicle name ordered by the owner name alphabetically let's go take a look at this data so we have the owner name vehicle name minor issues critical issues and that's all we have so it's just a simple one um again this is an easy question at least on analyst Builder and so let's try to solve this without any of the hints or looking at the expected output because I think we can solve this one now the first thing that we need to take into consideration is we're going to need to be filtering so we'll need to filter down some data so if a car has any critical issues it'll fail so if critical issues is 1 2 three it's going to fail so it can't have uh no critical issues and they'll say and because even though this says or right here it doesn't mean one or the other it means if it has this or it has this it fails so we actually need an and here so both conditions need to be met or more than three minor issues so you can't have either of those now in our output for what we're going to get down here we need to have just two things we just need the owner name and vehicle name so let's put that owner name and vehicle name and then lastly we just have to order by the owner name and then that's going to be ascending ASC ascending is Just A to Z so I think we can go ahead and start writing this out cuz I think that's all we need to do now let's go ahead and run this and so we have our data right down here now here's what we need to do we are trying to identify cars that passed the inspection so we need to filter out the ones that had a critical issue or that had three or more minor issues so what we're going to do is we're going to come right over here and the first one we'll do is critical issues so we're going to say where critical uncore issues and we need to say is equal to zero and let's run this and it looks like I had a space here let's run this again there we go so now these are cars that have no critical issues so they're P these ones are passing but if we just look at our data right down here we have some that have four four five so we also have to say and and I'm going to copy this so I don't have another uh problem with that so I'm going to say where it's less than or equal to and I'm going to say three so if it has three or less H it should be in our output so let's run this and I say greater than let me do less than there we go and we can see that now the minor issues are all three or less and let's just make sure or if it has more than three so if it had four or five it should not be in our output so this has 320 222 and this has 0000 0 so these are cars that should pass now right now we've been selecting everything but what we really need to do is just select the columns that we need that's going to be owner undor name and vehicle so let's run this and this looks really good and the last thing that we need to do is order bu so we need to order bu the owner name let's get that owner name and we need to do that in ascending Now by default when you use order by uh to organize and sort a column it automatically is an ascending but I like to at least put it there you know explicitly so I can see it and this to me should be the correct answer now what we need to do to check our answer and actually show if we got the answer right is just click this check answer button we can also do controll uh shift enter but I'm going to click the uh check answer and there we go we got the solution correct so let's go ahead and come up here we're going to go to our next question this is another easy question on aless Builder again I'm going to leave a link in the description if you want to try out this exact question but let's take a look at this one this is called apply discount it says a computer store is offering a 25% discount for all new customers over the age of 65 or customers that spend more than $200 on their first purchase the owner wants to know how many customers received that discount since they started the promotion write a query to see how many customers received that discount okay and let's go down and look at the data so we have customer ID we have their age and then we have their total purchase and let's just see if there's any duplicates in this customer ID it doesn't look like it it looks like they're all just one purchase the reason I was looking at that is it says all new customers and it looks like these are all new customers it doesn't look like there's any repeat customers that are old customers so we're going to assume these are all new customers if there was a mult multiple 1,000 and ones I would look for something like a transaction ID or a transaction date but those types of questions are a little usually a little bit more difficult um in like the medium hard types of questions but let's go make some notes real quick so we have to filter on two different things they have to meet uh one of these criteria in order to be in the output they either have to be over the age of 65 so over 65 and let's do over 65 or they just have to meet one of these or have spent more than 200 or spent more than 200 and that's shouldn't be capitalized uh so that's what we need and then the owner is just wanting to know how many customers received that discount so we're going to do a count on the number of customers uh that fit that filter I'll write it like that so it's just going to be a number in our output this one should be I would say even a little bit simpler than the last one because we're not having to filter or really um do anything like that now let's run this and let's come down here so we're going to do a count eventually on this customer ID but what we need to do is filter on both the age and the total purchase so let's write this out so age needs to be and I need to write where where age is greater than 65 now I'm not saying greater than or equal to to cuz right here it says for new customers over the age of 65 if it said age 65 or over I would say greater than or equal to I want to be these questions can be very specific and then we'll say and or actually or because it's either of these need to be true or the total purchase and again it says more than 200 so we're going to say greater than 200 now let's run this and let's just kind of look down here there's a lot of people that fit this bill it looks like um yeah the majority of people that's great so we're going to give them a discount these are people that received a discount so all we're going to do is account on this customer ID so we's do account on customer ID let's run this and our answer is 14 all we have to do is check this answer to make sure uh it is correct so let's hit the check answer and there we go Your solution is correct now one thing I will say about just technical interviews in general is often times they want to make sure you know how to write it but even more so they're really checking to make sure you understand how SQL works so when I'm writing this out if I'm in an actual interview I would be talking this out loud to the interviewer who's interviewing me I would say okay I looks like I need to filter on this and I need to do account count on these things now you only would know how to do that if you know my SQL or if you know SQL right again they really want to hear your thought process and so so walking through it exactly how I did in the actual interview is exactly what the interviewer wants to hear now writing it correctly is still very important especially as you get to the more uh difficult questions right you want to know certain functions and certain ways to write things but you should be talking all this out loud during your interview now one other really cool thing I'm just going to show you this at the end is if I go over to my profile I'm actually earning points for these questions so right down here I just earned a couple extra points towards my my SQL badge and I can go all the way up to expert and then Master as well and so I am well on my way and then in future videos when we do the medium and the hard and then the very hard questions we earn even more points for those because they are more difficult and they go towards these badges so that is how we solve those easy SQL technal interview questions on analyst Builder go ahead and try those out there's tons of other free questions on the platform that you can just try out and there's lots of easy ones but then we're also going to be taking a look at medium hard and very hard in future lessons with that being said I hope you enjoyed this video if you did be sure to like And subscribe below and I will see you in the next [Music] video

Original Description

Questions Page on Analyst Builder: https://www.analystbuilder.com/questions Car Failure Question: https://www.analystbuilder.com/questions/car-failure-TUsTW Apply Discount Question: https://www.analystbuilder.com/questions/apply-discount-RdWhb Let's look at how we can solve an Easy SQL technical interview question. In this series we work our way through easy, medium, hard, and very hard SQL interview questions that you may see in a technical interview. ____________________________________________ RESOURCES: 💻Analyst Builder - https://www.analystbuilder.com/ 📖Take my Full MySQL Course Here: https://bit.ly/3tqOipr 📖Take my Full Python Course Here: https://bit.ly/48O581R 📖Practice Technical Interview Questions: https://bit.ly/46pDqqL Coursera Courses: Google Data Analyst Certification: https://coursera.pxf.io/5bBd62 Data Analysis with Python - https://coursera.pxf.io/BXY3Wy IBM Data Analysis Specialization - https://coursera.pxf.io/AoYOdR Tableau Data Visualization - https://coursera.pxf.io/MXYqaN Udemy Courses: Python for Data Science - https://bit.ly/3Z4A5K6 Statistics for Data Science - https://bit.ly/37jqDbq SQL for Data Analysts (SSMS) - https://bit.ly/3fkqEij Tableau A-Z - http://bit.ly/385lYvN *Please note I may earn a small commission for any purchase through these links - Thanks for supporting the channel!* ____________________________________________ BECOME A MEMBER - Want to support the channel? Consider becoming a member! I do Monthly Livestreams and you get some awesome Emoji's to use in chat and comments! https://www.youtube.com/channel/UC7cs8q-gJRlGwj4A8OmCmXg/join ____________________________________________ Websites: 💻Website: AlexTheAnalyst.com 💾GitHub: https://github.com/AlexTheAnalyst 📱Instagram: @Alex_The_Analyst ____________________________________________ 0:00 Intro 2:33 First Question 6:58 Second Question 11:44 Outro *All opinions or statements in this video are my own and do not reflect the opinion of the company I w
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Alex The Analyst · Alex The Analyst · 0 of 60

← Previous Next →
1 Top 3 Data Analyst Skills in 2020
Top 3 Data Analyst Skills in 2020
Alex The Analyst
2 Truth About Big Companies | Told by a Fortune 500 Data Analyst
Truth About Big Companies | Told by a Fortune 500 Data Analyst
Alex The Analyst
3 Data Analyst Salary | 100k with No Experience
Data Analyst Salary | 100k with No Experience
Alex The Analyst
4 Working at a Big Company Vs Small Company | Told by a Fortune 500 Data Analyst
Working at a Big Company Vs Small Company | Told by a Fortune 500 Data Analyst
Alex The Analyst
5 Data Analyst Resume | Reviewing My Resume! | Fortune 500 Data Analyst
Data Analyst Resume | Reviewing My Resume! | Fortune 500 Data Analyst
Alex The Analyst
6 Data Analyst Resume | Complete Guide To Creating A Data Analyst Resume | Tips + Templates + Examples
Data Analyst Resume | Complete Guide To Creating A Data Analyst Resume | Tips + Templates + Examples
Alex The Analyst
7 Switching Careers to Become a Data Analyst | How I Made the Switch
Switching Careers to Become a Data Analyst | How I Made the Switch
Alex The Analyst
8 Working With a Recruiter to Land Your First Job as a Data Analyst | LinkedIn Recruiters
Working With a Recruiter to Land Your First Job as a Data Analyst | LinkedIn Recruiters
Alex The Analyst
9 Data Analyst Salary in 2020
Data Analyst Salary in 2020
Alex The Analyst
10 Data Analyst Resume | Reviewing YOUR Data Analyst Resumes!
Data Analyst Resume | Reviewing YOUR Data Analyst Resumes!
Alex The Analyst
11 Data Analyst Fact Check |  84k Average Starting Salary?? | The Career Force 2020 Data Analyst Salary
Data Analyst Fact Check | 84k Average Starting Salary?? | The Career Force 2020 Data Analyst Salary
Alex The Analyst
12 SQL Basics Tutorial For Beginners | Installing SQL Server Management Studio and Create Tables | 1/4
SQL Basics Tutorial For Beginners | Installing SQL Server Management Studio and Create Tables | 1/4
Alex The Analyst
13 SQL Basics Tutorial For Beginners | Select + From Statements | 2/4
SQL Basics Tutorial For Beginners | Select + From Statements | 2/4
Alex The Analyst
14 SQL Basics Tutorial For Beginners | Where Statement | 3/4
SQL Basics Tutorial For Beginners | Where Statement | 3/4
Alex The Analyst
15 SQL Basics Tutorial For Beginners | Group By + Order By Statements | 4/4
SQL Basics Tutorial For Beginners | Group By + Order By Statements | 4/4
Alex The Analyst
16 Day in the Life of a Data Analyst | Fortune 500 Edition
Day in the Life of a Data Analyst | Fortune 500 Edition
Alex The Analyst
17 Intermediate SQL Tutorial | Inner/Outer Joins | Use Cases
Intermediate SQL Tutorial | Inner/Outer Joins | Use Cases
Alex The Analyst
18 Intermediate SQL Tutorial | Unions | Union Operator
Intermediate SQL Tutorial | Unions | Union Operator
Alex The Analyst
19 Intermediate SQL Tutorial | Case Statement | Use Cases
Intermediate SQL Tutorial | Case Statement | Use Cases
Alex The Analyst
20 Intermediate SQL Tutorial | Having Clause
Intermediate SQL Tutorial | Having Clause
Alex The Analyst
21 Intermediate SQL Tutorial | Updating/Deleting Data
Intermediate SQL Tutorial | Updating/Deleting Data
Alex The Analyst
22 Day in the Life of a Data Analyst | Fortune 500 Edition (During Quarantine)
Day in the Life of a Data Analyst | Fortune 500 Edition (During Quarantine)
Alex The Analyst
23 Data Analyst Interview Questions | Phone + In-Person Interview Questions
Data Analyst Interview Questions | Phone + In-Person Interview Questions
Alex The Analyst
24 SQL Interview Questions and Answers for Beginners | Data Analyst Interview Questions
SQL Interview Questions and Answers for Beginners | Data Analyst Interview Questions
Alex The Analyst
25 Data Analyst Interview Questions | What To Say vs What NOT To Say
Data Analyst Interview Questions | What To Say vs What NOT To Say
Alex The Analyst
26 Data Analyst Interviews | Salary Negotiation
Data Analyst Interviews | Salary Negotiation
Alex The Analyst
27 Data Analyst Q&A LIVE
Data Analyst Q&A LIVE
Alex The Analyst
28 Intermediate SQL Tutorial | Aliasing
Intermediate SQL Tutorial | Aliasing
Alex The Analyst
29 Data Scientist vs Data Analyst | Which Is Right For You?
Data Scientist vs Data Analyst | Which Is Right For You?
Alex The Analyst
30 Best Online Courses for Data Analysts
Best Online Courses for Data Analysts
Alex The Analyst
31 Best Free Online Courses for Data Analysts
Best Free Online Courses for Data Analysts
Alex The Analyst
32 Data Analyst vs Business Analyst | Which Is Right For You?
Data Analyst vs Business Analyst | Which Is Right For You?
Alex The Analyst
33 Scraping Data Off Twitter Using Python | Twitterscraper + NLP + Data Visualization
Scraping Data Off Twitter Using Python | Twitterscraper + NLP + Data Visualization
Alex The Analyst
34 Data Analyst Question and Answer | Answering Your YouTube Questions
Data Analyst Question and Answer | Answering Your YouTube Questions
Alex The Analyst
35 What Does a Data Analyst Actually Do?
What Does a Data Analyst Actually Do?
Alex The Analyst
36 Data Analyst Bootcamps | Are They Worth It?
Data Analyst Bootcamps | Are They Worth It?
Alex The Analyst
37 Top 5 Reasons Not to Become a Data Analyst
Top 5 Reasons Not to Become a Data Analyst
Alex The Analyst
38 Data Analyst Career Path | How to Become a Data Analyst + What to Do Next
Data Analyst Career Path | How to Become a Data Analyst + What to Do Next
Alex The Analyst
39 Live Data Analyst Q&A #3
Live Data Analyst Q&A #3
Alex The Analyst
40 Top 5 Reasons Not to Lie on Your Resume
Top 5 Reasons Not to Lie on Your Resume
Alex The Analyst
41 The Hiring Process from an Interviewer's Perspective | Alex The Analyst Show | Episode 1
The Hiring Process from an Interviewer's Perspective | Alex The Analyst Show | Episode 1
Alex The Analyst
42 Top 5 Reasons Data Analytics is a Good Career Choice
Top 5 Reasons Data Analytics is a Good Career Choice
Alex The Analyst
43 How I Changed Careers to Become a Data Analyst | Alex The Analyst Show | Episode 2
How I Changed Careers to Become a Data Analyst | Alex The Analyst Show | Episode 2
Alex The Analyst
44 Top 5 Reasons You'll Be a Good Data Analyst
Top 5 Reasons You'll Be a Good Data Analyst
Alex The Analyst
45 Self Taught vs Boot Camp vs Degree | Alex The Analyst Show | Episode 3
Self Taught vs Boot Camp vs Degree | Alex The Analyst Show | Episode 3
Alex The Analyst
46 Covid and the Data Analyst Job Market | Alex The Analyst Show | Episode 4
Covid and the Data Analyst Job Market | Alex The Analyst Show | Episode 4
Alex The Analyst
47 Data Analyst Expectations vs Reality
Data Analyst Expectations vs Reality
Alex The Analyst
48 Imposter Syndrome in Tech | Alex The Analyst Show | Episode 5
Imposter Syndrome in Tech | Alex The Analyst Show | Episode 5
Alex The Analyst
49 Top 10 Coursera Courses for Data Analysts
Top 10 Coursera Courses for Data Analysts
Alex The Analyst
50 Working at a Startup vs Fortune 500 Company | Alex The Analyst Show | Episode 6
Working at a Startup vs Fortune 500 Company | Alex The Analyst Show | Episode 6
Alex The Analyst
51 Data Analyst Certifications | Are They Worth It? | Alex The Analyst Show | Episode 7
Data Analyst Certifications | Are They Worth It? | Alex The Analyst Show | Episode 7
Alex The Analyst
52 Top 10 Udemy Courses for Data Analysts
Top 10 Udemy Courses for Data Analysts
Alex The Analyst
53 Asking My Wife Your Questions About Me | Alex The Analyst Show | Episode 8
Asking My Wife Your Questions About Me | Alex The Analyst Show | Episode 8
Alex The Analyst
54 Data Analyst Q&A LIVE #4
Data Analyst Q&A LIVE #4
Alex The Analyst
55 Data Analyst Skills Path | What Skills You NEED to Know
Data Analyst Skills Path | What Skills You NEED to Know
Alex The Analyst
56 What is Analytics Consulting? With John Ariansen | Alex The Analyst Show | Episode 9
What is Analytics Consulting? With John Ariansen | Alex The Analyst Show | Episode 9
Alex The Analyst
57 Solving LeetCode SQL Interview Questions | Part 1/3
Solving LeetCode SQL Interview Questions | Part 1/3
Alex The Analyst
58 What is No Code Analytics? | Alex The Analyst Show | Episode 10
What is No Code Analytics? | Alex The Analyst Show | Episode 10
Alex The Analyst
59 Top 3 Tips on Using LinkedIn to Land a Job
Top 3 Tips on Using LinkedIn to Land a Job
Alex The Analyst
60 Completely Unrealistic Jobs on LinkedIn | Alex The Analyst Show | Episode 11
Completely Unrealistic Jobs on LinkedIn | Alex The Analyst Show | Episode 11
Alex The Analyst

This video teaches how to solve easy SQL interview questions using Analyst Builder, covering topics such as filtering data, ordering output, and using SQL functions. It provides a comprehensive guide to practicing SQL technical interview questions and earning points on Analyst Builder. The video is suitable for beginners in data analytics.

Key Takeaways
  1. Filter data based on critical issues and minor issues
  2. Order output by owner name alphabetically
  3. Filter down data to identify cars that passed inspection
  4. Use AND operator to filter out cars with critical issues or three or more minor issues
  5. Select only owner name and vehicle name columns
  6. Order by owner name in ascending order
  7. Filter on age > 65 and total purchase > 200
  8. Use COUNT function to count customers who received the discount
💡 Practicing SQL technical interview questions on Analyst Builder can help improve SQL skills and earn points to progress through badges.

Related Reads

📰
Data Science Institute in Tilak Nagar — AI, ML & Python Training
Learn how to analyze business data with AI, ML, and Python training at the Data Science Institute in Tilak Nagar
Medium · Data Science
📰
How to Write SQL Queries That Detect Unstable Join Filtering and Inconsistent Results
Learn to write SQL queries that detect unstable join filtering and prevent inconsistent results, improving data analysis reliability
Medium · Machine Learning
📰
How to Write SQL Queries That Detect Unstable Join Filtering and Inconsistent Results
Learn to write SQL queries that detect unstable join filtering and prevent inconsistent results, improving data analysis reliability
Medium · Data Science
📰
Fable 5 Hype: Fangirling with Datasets to Build a Lakers Dashboard
Build a sports team dashboard using datasets and AI for fun and learning
Dev.to · L. Cordero

Chapters (4)

Intro
2:33 First Question
6:58 Second Question
11:44 Outro
Up next
Google Analytics Alternative For WordPress | AnalyticsWP Tutorial
Matt Tutorials
Watch →