Learn to utilize the incredibly powerful and useful database tool, Microsoft's SQL Server as well as SQL Server Management Studio through this series of tutorials! This episode covers downloading SQL for FREE, installing useful tools like SQL Server management studio and reporting services, as well as creating a first table, adding data to it, and making your first query for selecting data!
Learn the basics of a standard Select, From, Where statement query in just minutes! SQL is an incredible tool for any employee to be familiar with for their job or as an independent software developer!
If you want to see anything specific on the channel or have technical questions about anything leave a comment on our of our videos and we will get back as soon as we can!
Thanks for watching and supporting the channel!
hello welcome back to the channel
today's episode is going to be uh part 1
in this channel's introduction to sql
microsoft sql server
and if you're unfamiliar with what a sql
is or sql however you've heard it
i'll probably call it sql through most
of the tutorial but it's essentially
just microsoft and a few other companies
make a similar solution but it's a
database tool for storing data as well
as pulling data out and then
manipulating it into reports and all
sorts of usable formats
so if you're an enterprise or a business
developer
you can get one that's azure linked and
backed up on
the cloud or you can get a local sql
server iteration and just host it all
locally
but if you're an independent developer
just building
kind of software on your own you can get
either a developer or express version of
sql and you can download it and get
started with it completely for free
from microsoft's website
you just go to sql server sql server
downloads so that's pretty cool that
they offer it for free you download
right here
and then one of the first things that
installs when you install sql is also
the installation center
and initially you're just going to be
installing sql as a standalone but then
i would recommend adding the install sql
server reporting services as well as the
sql server management tools particularly
if you're going to be doing local
development so
the the sql server management tools are
really useful
for actually creating tables manually
and running some queries locally
and then the sql server reporting
services is useful tool for
actually reporting data back and you can
share that with like a corporate
through web links and vpns and stuff so
those two tools are super useful and
most of this tutorial series we're going
to be doing inside of the microsoft sql
server management studio so
first thing that you're going to do
after you've installed this is just open
it up and it's going to load in with
some
defaults and if you need help
actually like setting a server name and
getting started with that we can do that
in a later series but for now i'm
leaving everything as the default just
so we can get rolling and so the first
thing you need to do typically with sql
is create some data because uh from then
on you'll be manipulating it and
interacting with it in different ways
so if you open up your folder structure
and go into databases and system
databases you can either create a new
one or i just use the built-in master
database
and i created a table already that we're
going to use for this example
but when you create a table you go to
new table
you
right click on the tables folder you go
to new and then table
and it's going to take you to a
a loadout structure that looks
very much like this
so
it'll give you column name and then data
type and if you think about a table
that's really all you need to know
because this is not the data inside of
the table you're creating the table
parameters
so for this in particular i've created a
sample table that's letting you track
information about an employee and i just
have the employee name
and then their position at the company
in here is two
fields to start and so that's how you
create the table um you just give this
column name something descriptive so
i'll i'll add another one that says
salary and you can see i've made the
employee's name and the position
something called a varchar with 50
characters as a limit
varchar and sql just means variable
characters
and it's basically code for this could
be anything numbers letters special
characters like exclamation marks or
asterisks that can all go in a var chart
but then if you hit the drop down if
you're ever not sure if sql supports
that data type or not you can see all of
the ones that they have
so they have integers and then big
integers which are like
double integers um if you're familiar
with dents
bin bits and binary
so like boolean characters you can get
just the date or date time
um you you can
have decimals or floats and then you can
actually pass in even things like
pictures images
integers text numeric but really the
most common ones you're going to use are
probably going to be floats integers um
varchars because even though they have a
text
and
it's just better to use a var chart
because if there's ever
numbers or special characters in there a
varchar will still catch it where like
text wouldn't
um
so that's my rant on that but for salary
we'll just make it a float because you
never know it could have um
could have decimal points or
something
um and then
the other nice thing is you once you've
saved a table you can go back and modify
it at the name time it's not just uh on
creation just by right clicking it and
going to design
but then actually view just raw data you
can either select the top 1000 rows
where it'll show you a thousand rows of
recent data or you can edit the top 200
rows and you can actually interact with
your data inside of there and these are
just defaults we'll go through how to
select and modify specific data a little
bit later
but for now we'll see these three
employees i just totally made up
jim pam and michael and their positions
in sales
we'll change pamps from recruiting to
reception
and michael is in management so let's
give them some salaries let's say jim
makes 45 000
pam makes
30 000 and let's say michael's bringing
in the big bucks 60 000.
so right there we just went through and
physically
added uh data into this table
and typically what you're gonna do in
sql is you're gonna have this connected
to outside software and use sql as an
odbc an outside database connection so
you'd ordinarily have routines that are
putting data into these tables
externally we'll get into how to
actually do that later in the series but
for now we've made it our first table
we've put some data in it let's go ahead
and take a look at creating our first
query to actually access this data okay
so you go up to new query
and basically query is the structured
text for sql
and pretty much any time you're pulling
data from tables it's going to go in the
format of select
and then from so i'll just punch both of
those in there
but we actually have to add some data
here
so to start i'm going to use the star
which is sql's little indicator for
everything so i'm saying select
everything from and i need to tell them
what table i want to pull from and i'm
going to say specifically the employee
table
and when i run this
bam you see at the bottom of the table
we get in all of our employees their
positions and their salaries
and we get gym sales salary pam
reception salary there you go um
but so so the select from is a good tool
to basically grab everything
um
and then let's just go one further what
you can also do in your select statement
is say what you actually want so you can
specify columns inside of the table so
now if i say that we want just the
employee names from the table we get jim
payment michael right there
okay
so select and from is basically how you
get data out of a table you say what you
want and then you say where it is
and the last piece to this and the last
thing i'll cover in this video is select
from and where is usually the third
piece so now let's say we want to select
all employees from the employee table
who are in sales okay so let's say where
position
and with text you can use an equal sign
and then say sales
or you can use a few things unique to
strings so i'll go ahead and run this so
you can see we just get jim because he's
the only person in our table that's uh
got a job in sales
but another thing you can do with
strings is say
like sales okay so if i run this again
we still just get gym but if i were to
change our condition to reception
we just get pam okay
so
that's pretty cool
now let's let's say we want to actually
look at where salary
is greater than
and we'll say
40 000
okay
so
did i not call it salary
i sure did
it's like the
table hasn't refreshed
oh there we go i guess i didn't refresh
my uh i guess i didn't refresh my tables
after saving them so i was querying old
data
um
but uh silly things like that always
happen
but then um so now i'm looking where
salary is greater than forty thousand
dollars a year we get jim and michael
based on data that we
showed before and then you can also
select multiple
columns
and and so we are actually seeing the
employee and the salary that we called
out so this is pretty cool the basics of
sql queries
are usually select
where you give the conditions of what
you want to pull in
from where that's the table and then
where is your actual conditions to
filter data out
so this has been a quick little crash
course on sql we'll get into a lot more
of the specifics and advanced things you
can do with this database in future
videos but for now
if you have any questions about anything
you saw here today go ahead and let me
know in the comments
and if you found this or anything else
on the channel useful i'd really
appreciate a like and a subscribe it
helps the channel out a lot
and as always good luck with your
programming and thanks for watching
thanks bye