Hey everybody.
Welcome to the last video of this module.
So what I want to talk about last is a quick talk about how databases work and what they are.
Now we're not going to go too much into detail on what type of databases are out there and how you interact
with each one of them.
And it's gonna be more of a learning curve as you hit specific ones but I'm going to give you a general
idea of how they work what to expect and what kind of information is stored in them.
Now a database in a nutshell is a software storage service that allows the storage of data inside of
a predefined and fixed format by the admin.
So whether that is you know having to use names passwords personal identifiable information or API so
you know credit card numbers Social Security numbers addresses all of that is stored inside of a database
which is normally used by web apps.
Now you can any service can use a what a database and there's different types there services as a database
and then there's seek something called sequel lite that works as a flat file.
Now the file is still has a database structure when you interact with it from the protocol that's being
used at the library that sits on top of it.
However it's different than something like my sequel which is pretty common to use for enterprise applications.
Now what is the structure.
There's different types of structures but we're gonna hit the general idea of what a structure for a
database is tends to look like.
So each database server can have any number of databases it could be five 10 hundreds of them inside
of the server or the service itself.
You can think about each database as a let's say a bookshelf right so each bookshelf.
You might have a roomful of 10 bookshelves so the room is a server.
And then each bookshelf is a database now each bookshelf has a table name or each database has a table
name.
Now you can have multiple tables in a in a database.
So what a table is this thing thinking this is an Excel spreadsheet as well.
So it has a column at the top which is also known as a column which has the identifiers or you could
think of this also as a CSB format where you have the identifiers at the top such as the name username
password email first name last name social security number address whatever the case might be then you're
going to have below that you're going to have each row so each row will have for example user name test
password test emails test that test dot com the first name test last name test.
So you'd have a row like that.
And so each one is a single user.
In this particular case but it can each table is normally consisting of a type of data.
So you just get to understand that structure and what that looks like.
That's the general idea of how it's going to look.
In most table structures.
Now how do you interact with this to interact with it.
You need some sort of query language in general.
Now the type of query language tends to vary depending on which type of database you're using.
In most cases it's a lot of software is supported by something called sequel which is a secure query
link or structured query language.
Now an example of this is if we do select and then the table name from our I'm sorry select the column
in this case user names from users which is the table where another column is equal to a certain value.
Now this will select and show all user names from the table users with the password one two three four.
Now it's important that you understand the basics of how sequel works.
So what I want you to do is take a quick second and look up a quick mini tutorial on how sequel works.
I'm going to link a simple one above the video but I want you to understand how sequel works.
The reason this is important is because sequel injection is something we're going to go over later.
So you need to be able to understand how the query in the commands work to know what data you're pulling
and how you're supposed to be pulling.