 So why didn't we spend so much time and effort putting in all this data building this foundation for my database? Well, the reason is because Sort of how we look at a database why we have databases is one to collect this data Store it, but the other is to ask it questions. We create what are known as queries So if I think about it for example my patients, you know, I don't want to see all of this stuff I don't want to see the patient ID. I don't care about that You know, I don't even want to see the city, you know notice. Yeah, maybe Wilmington, North Carolina or Their birth date. I don't need any of that stuff. I just need their email address. For example, I'm writing out a You know email to them saying that will be closed the following week for construction purposes, so How can I grab all of that data? But not all of the excess well what I can do is I can come in here to my create tab and Instead of going to query wizard this time we're going to go into query design Now query design what this pulls up is a new sort of window with a new dialogue box Basically the same dialogue box we saw when we were building our relationship. We basically say what? Tables do I want to work with again? I just want to work with one table right now So I'll select the patient table and I'll click add and I'll close out of that And I'll just do a little resizing because I like to see things a little easier And now that I've got this data again. What do I need? Well? I'm going to go ahead and need their first and last name because I want to have a custom email that says hi you know Tom So I'm going to go with their first name and I can double-click it and you notice It's appearing it down here if I double-click on last name It appears as well and as soon as I double-click on email. I Now have built that out. I've built this structure Again now if I take a look at that all right. I've got those. How do I? Execute this query. Well, you notice we have this nice little exclamation mark this run Section right here. That's actually what we'll do it if I hit that It will run through my query now the one thing about a query is things can change notice How my first record is first name last name email at Cape here Community College. I can change that to Adam Govita a govita at cfcc.edu that change is actually going to be affected inside of my Patient ID notice all of a sudden Adam. Govita a govita is showing up So these queries all they do is they act as a mask say for example Dreya Gorski over here. I don't have an email for Dreya. So I'm going to just add one in real fast honey Boo at hotmail.com Not everybody has a classy email. Come on Dreya likes honey boo boo So I can continue to make that change that Dreya is going to be you Inside of my patient table Where would you be? Dreya there we are honey boo boo Now you may have noticed when I clicked on something I switched between my views for a second What happens if I accidentally did not include everything I need in my query Well, what I can do is I can go back to this view tab and notice that kind of same thing that we saw with our table design View in our data sheet view. I get with my query view. I can switch between the two So at any point in time I can make any kind of change as I want say for example, I want to go ahead and I want to just look at for example People from a different or specific city. Well, what I can do is I can come in here and I can add in that city Now again, let me take a second. Let's see that. I've just added in city And we get a few different ones now. Let's say for example, I want to look at all the people from Hartford Well Hartford. Okay, how do I only get emails and you know the first and last names of people from Hartford? All right, well down here, you notice we've got a few different options. We've got field table sorts show Criteria. Well criteria. That's a interesting word there criteria Basically, that's why we have so many of these squares right here. It's because we can add in Criteria to our query for example inside my city section right below here. I can say that I only want to look at Hartford City so only show me anything that runs on Hartford and I run this Now I get only the records of people from Hartford pretty nice One thing that I can do is since I know now that this is the Hartford People this is the email addresses of all the Hartford people what I can do I know there are some links what I can do is I don't need to specifically have it be viewed I don't have to see Hartford because again It's just repeating data one of the tenets of databases is don't repeat yourself So I'm gonna actually come in here and you notice that checkbox right above our criteria Well, if we look that is actually saying show and if I unchecked that What that does that explicitly says run the criteria run the query and only show me the first and last name and email of people from Hartford, but You don't actually have to show me the Hartford name. So it's a little bit of a nice Little nuance there that now I don't have to have excess stuff when I'm building my queries So the last thing I'm going to do is I'm going to just save this as its own query and because again We're looking at our Hartford patients. I'm going to call that Hartford patients