Hey guys it's Eddie the Magic Monk as you guys can see I've changed up my
students table quite a bit I've added some new fields and I've added a lot of
new records so what I want you guys to do is delete the table that you
currently have so right click on your table and choose to delete and so close
it first one day I'll remember to do that right-click press delete delete it
ok so now the table is gone and I want what I want you to do is choose import
XML file ok import XML so click that and then I want you to find the data so you
should have downloaded this file from the description there's going to be two
files make sure you download both ok and choose the XML file click open click OK
and choose structure and data and choose OK and it should import the students
table that I have created for you guys
with the correct data types so 50 field size for the first and last name
birthday and so on so yeah this is the fake information that I've created and
now we're going to introduce you guys to the Select query so let's go to create
again and let's go to query design to create a query and close this window
that's the show table go to SQL view and then what I want to do is simply select
* which means select all rows from students and if you run this query what
you'll see is basically it just repeats the table again
okay because every single row and every single field is selected so that's
what this query does so let's go back to SQL view again go back to SQL view again
and this time we just want to select some different columns so you can see
that there is student ID last name first name so let's say I just want to select
last name and first name so I can just go select last name, first name and
if you do that run it so design run, it just selects these two columns so let's
use the where clause so where basically so let's go back to the SQL
and let's say I only want to select students that are female so I can say
where the gender is equal to F alright capital F with single quotation marks
and if you run that it only selects all the females in our database so that's
what the where clause is doing it only selects certain rows so this part here
decides what columns you want to select and this part here decides which rows
you want to select so I'm only selecting the rows where the gender is equal to
female so only these rows are selected right Sarah
Phoebe, April and Phoebe - two Phoebe's alright so if you go back to query run
it again and you'll see that only these people are selected
now instead of using equals so go back to the query design again and instead of
using equals "F" we can also have something like birth dates smaller than
or equal to and let's just put in a date let's put in first of February 2000 so
first of February of 2000 now the dates in Access have to be placed inside
# to signify that it's a date so if you run this all right actually you
can't see the answer if we do that so let's go back to the query and let's put
in birthdate here so you can see their birth date so if you run it then you can
see that it's only selected people who were born before February 1st February
1st 2000 right all these people were born before February 1st 2000 so if I
did it the other way if I went birthdate is bigger than or equal to that
then if you run this it will only show people who were born after this day so
all of these people were born after that day okay so I guess I'll stop here
hopefully you guys learned something about the Select statement today thanks
for watching see you next time.