CURSO DE ACCESS 2019 - LECCIÓN 9 CONSULTAS — Transcript
Full transcript
- 0:09All right, today we are going to start
- 0:11with queries. In the last lesson, we
- 0:14learned how to create relationships,
- 0:16and we had a series of tables that
- 0:18could work linked to one another. Well,
- 0:21what is a query? A query is a way to
- 0:24filter our tables so we can get results
- 0:28that are more filtered and more
- 0:30favorable for us, and that way, we
- 0:33don't have to work with all the data.
- 0:38We will be able to join several—
- 0:40pardon me—several tables for that. We
- 0:44will be able to delete data from tables
- 0:46, create new tables, append data, and
- 0:48so on. Well, I would go to Create and
- 0:51then come over here to Query Design.
- 0:54Let's start with an easy one. I have to
- 0:56tell it which table or tables I want to
- 0:58use. So, I'm going to start, for
- 1:00example, with the Customers table. I
- 1:02can select it there and click Add. And
- 1:06here, all the fields appear: Customer
- 1:08ID, Company Name, Contact, Title,
- 1:10Country. And what I have to do here
- 1:13where it says Field, for each one of
- 1:15these, I have to add the fields I have
- 1:17here, the ones I need. I surely don't
- 1:20need all of them, so I don't have to
- 1:21include everyone. What would I do now?
- 1:24Well, for example, I would add Customer
- 1:25ID. I have two ways: I can either
- 1:28double-click it or drag it. I'm going
- 1:30to move Company Name here. I'm going to
- 1:34put Contact here and, for example,
- 1:36Country. Let's assume that I don't need
- 1:39any more than these. So, if I now click
- 1:43here to view the datasheet, I now have
- 1:45a table here that it has extracted from
- 1:48the original, from the original
- 1:50Customers table. So, as you can see,
- 1:53there is my entire table. It's a little
- 1:56different because I removed a field I
- 1:58didn't need, or two fields, rather. So,
- 2:00in that way, I can already work with
- 2:03that table. If I go back to Design, I
- 2:06will have options, such as if one of
- 2:08the fields I added isn't needed, I can
- 2:10hide it. I say, "Right now I don't want
- 2:13to see the contact one," so I come here
- 2:14and it removes it for me. And then I
- 2:17can start adding criteria, like, for
- 2:19instance, let's assume that here in
- 2:21Company Name I'm only interested in—
- 2:24I'll take a look to see what companies
- 2:26there are. Well, it will only interest
- 2:29me, for example, those that start with
- 2:32the letter A. So I can come here and
- 2:35tell it where it says criteria. Let's
- 2:38see, here I put an A asterisk, and that
- 2:44way it tells me that it will search for
- 2:46what starts with A and has something
- 2:48after it. You can see there that four
- 2:50results appeared. And then I could
- 2:53enter a second criterion. Let's assume
- 2:55that, for example, I say I want those
- 2:57from Mexico. There it would be. And now
- 3:01none come up. Why? Because Mexico had
- 3:04an accent, so I have to enter the exact
- 3:06one. Since I didn't put the exact one,
- 3:08I did it on purpose, it gives me an
- 3:10error. So now I am going to put it with
- 3:14there it would be with the accent. Now
- 3:16yes, now two come up there. At any time
- 3:18I can delete the criterion and then I
- 3:21recover everything. And if I add more
- 3:25data to the original table, that data
- 3:27will be part of the query if it was
- 3:30filtered for it. So, there we see again
- 3:33that I have all the data. I could come
- 3:37here and the same, be able to say, "Hey
- 3:39, I want customer IDs between 30 and
- 3:4235." So I put exactly between 30 and 35
- 3:45. There we see 30, 31, 32, 33, 34, and
- 3:5135. And that way, keep adding any
- 3:53criteria that come to mind. We can
- 3:56always provide the exact one, for
- 3:58example, say company name, well I want
- 3:59one called Bonetiz, so I put it, or I
- 4:01want a country here, well I come here,
- 4:02I say, you're going to get me all those
- 4:04from Germany. Germany, like this, there
- 4:08I would have it. I can enter a second
- 4:11criterion or delete later, and so on.
- 4:14If I want to save the query, in the end
- 4:16a query is as if it were a table. This
- 4:19is called, anyway as I told you, it's
- 4:21called a select query. It says it here,
- 4:24or selection, because what it does is
- 4:26take data from the original table and
- 4:28we simply filter them and display them.
- 4:31Well, if I exit here now and tell it
- 4:33that I do want to save the changes and
- 4:36I give it a name, well, let's assume I
- 4:38call it query. customers, query
- 4:46customers, like this, I click accept
- 4:47and it has created a new category for
- 4:49us. Before we had tables and now we
- 4:51have queries. I can query the query,
- 4:54never better said, easily and it is
- 4:57really the same as a table, but
- 4:59filtered. And at any moment I can go
- 5:03back to the design and remove any of
- 5:05the criteria I have here, and that way
- 5:08I could play around with it a bit and
- 5:11find the data I want. To make a new
- 5:14query, we said we were going to Create
- 5:17and go to Query Design. Well, today
- 5:20what we are going to do is use several
- 5:22queries to use several, uh, sorry,
- 5:24several tables. To use multiple tables,
- 5:27they have to be related, and since we
- 5:29had already related them, we won't have
- 5:31any problems. Let's assume we want
- 5:34Customers; it's already marked, so I
- 5:36add it. And we want Orders. Then the
- 5:39relationship shows up there. And the
- 5:42good thing about this is that we will
- 5:44be able to create a query, which as we
- 5:46said, a query is ultimately a table
- 5:48that will contain the data from both
- 5:50tables. Let's assume that I now want to
- 5:54put the company name here. We
- 5:58double-click Contact, and then here I
- 6:00want, for example, the Order ID. And,
- 6:05for example, the ID of the employee who
- 6:09managed the order, the Product ID,
- 6:12order date, and delivery date. Well, so
- 6:17if I click View now, it has already
- 6:19created a table with the orders I have.
- 6:22So that is very good because, in that
- 6:25way, I don't have to query both tables,
- 6:27and I can easily see one or several
- 6:29orders there. So, that's it. Right.
- 6:32Then I could come here and try to do,
- 6:35for example, by order date, saying,
- 6:37well, I want to see the ones from
- 6:39such-and-such a day, so I would come
- 6:42here and put, for example, this order.
- 6:46I put it there. We always write it, and
- 6:49then when we hit enter, it will fill in
- 6:51some data for us there. So, it has
- 6:53placed it for us there, and the order
- 6:55for that day appears, and we have
- 6:57another order there. That, at any
- 7:00moment, we can add, uh, another table
- 7:02if we wanted to. We click Show Table
- 7:04and say, "Okay, Orders, and I also want
- 7:06to include Products." Well, I add it,
- 7:09and since it was related, I won't have
- 7:11a problem because now I say that, for
- 7:13example, I say, "Oh, I'm also going to
- 7:16include the product name," and if I go
- 7:18to view now, it has already added the
- 7:20product name there. I'm going to remove
- 7:24this date from here so that all the
- 7:25orders appear, and there I have them. I
- 7:29can see and remove or delete any field
- 7:30from here, for example, saying, "Hey,
- 7:32I'm not interested in the employee ID
- 7:34right now.""So I remove it, and that's
- 7:38how I build my query by setting the
- 7:40criteria I want; in upcoming videos, we
- 7:43will see more complicated criteria,
- 7:46etc., where we can do this." Okay, so
- 7:49let's assume I want to save this table,
- 7:52this query, so I click here. I'm going
- 7:54to call this query orders and I click
- 8:02OK. Okay, another thing is that since
- 8:04everything is related, this is my
- 8:06orders query, I can see it there. If I
- 8:09enter some dates here, they will also
- 8:11automatically appear in the table.
- 8:13Let's assume that here I enter 24/01/16
- 8:14. and for the delivery date, let's put
- 8:22that it was 28/01/16. and we exit. So
- 8:30if I now go to the table, uh, we go to
- 8:33orders. In orders, you can see that
- 8:35they appear, and I have there what I
- 8:37just filled in the query. In other
- 8:39words, everything is interconnected; we
- 8:41have no problem. when it comes to
- 8:44filling it out from the table or from
- 8:47the query. And if I make a new order,
- 8:50for example, it will also automatically
- 8:52appear in the orders query. Let's
- 8:55assume I come here and say that
- 8:57customer 22 has placed an order that
- 9:01was managed by employee 2. The product
- 9:06ID is 16, and the order date, let's put
- 9:12it here, for example, let's say it was
- 9:1701/22/2016, and we shipped or delivered
- 9:23the product on 01/26/2016. And I'm also
- 9:28going to fill in the data I have here.
- 9:30I'm going to fill in this product as
- 9:31well. Let's assume this is 01/25/2016.
- 9:38I could also use this calendar here to
- 9:39look for dates, but I find it more
- 9:41comfortable to type it in, especially
- 9:42if they are from previous years. Okay,
- 9:45and so here let's assume this was
- 9:48received on 01/30/2016. Okay, so there
- 9:53we have it. Yes, well, I made a mistake
- 9:55there. It's 30th of January, I put 30th
- 9:57of February. There it is. Okay, and if
- 10:00I exit now and open the orders query
- 10:02again, exactly, now I have the four
- 10:04orders there; I wouldn't have any
- 10:06problem because when entering new data,
- 10:09the query updates itself without issue.
- 10:12Well, let's go back to the design for a
- 10:13moment. At any moment, as I have told
- 10:16you, I can modify the tables. What
- 10:20happens if we try to put together two
- 10:22tables that have no relationship? Well,
- 10:25in principle we will be able to enter
- 10:27the data, but it will surely give us an
- 10:28error or the data will be inaccurate.
- 10:30So, it doesn't make much sense to enter
- 10:33two tables that are not related.
About this transcript
This page contains the full transcript of CURSO DE ACCESS 2019 - LECCIÓN 9 CONSULTAS by Ebm Informatica, generated from the public captions YouTube serves with the video. The transcript has 1,729 words across 229 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.