From the course: Learning Data Analytics: 1 Foundations

Solution: Products are not categorized

From the course: Learning Data Analytics: 1 Foundations

Solution: Products are not categorized

(upbeat music) - [Instructor] Welcome back. I really hope you learned a lot with that example. Really, for some people, the light bulb goes off on joins. They are unstoppable. Let me show you how I would tackle this challenge. Okay, I'll start by going to create, I would bring up a query. All right, I'm going to go ahead and add my product table and my product subcategory because I know that's what I'm looking at. Now the very first thing I'll do is go hit those product counts. Okay, I only have 504, so I know I have less coming because I don't know how many are not categorized but I know of the 504, some of them are not, okay? Now I'm going to look for those key fields. So I'll expand my table here. Oh, I think I see it. So here's product subcategory. I'm going to left click and hold and drag it to product subcategory. All right, so my goal is to get a list of products so I'll get that product ID and name, I'll get that subcategory and the name. All right, let's run it and see what we get. So now I see 295. And let me go ahead and size these. So I know I have 504, and because I did an inner join, which is default, I can see the 295 that actually have categories. So let me go back to my design view and let me change that join. So again, I'm going to right click and go to join properties. Let me see all from production product and from production product subcategory, where the join fields are equal. Now I know that's the left outer join because product is my left table. All right, I'll go ahead and click okay. And then I'll run my query again. Now I see a list of products, and I know because I have 504 I see all of my products. Perfect. Okay, now the goal was to get just the list. So I'll go to my design view. And I'll use that is null. And then when I run it I see the 209 products that don't have subcategories. There's no need to save this query, but if you did, make sure you save it with the name products with no sub category.

Contents