All right.
So we're going to start off by taking a bit of a step back and talking about two very high level general
questions that are pretty central to everything this course is about.
And they are.
First off, what is database?
It seems like a pretty straightforward question, but there is a little bit of terminology we need to
discuss.
And then secondly, why do they matter?
So let's start off with the first one.
What is a database?
What actually makes something database?
And there are a couple of definitions that we could go with here.
I kind of synthesized some of them into my own definition.
That has two parts.
And the first part is that it's a collection of data, which seems pretty straightforward.
There are all sorts of collections of data around us in the real world, things like when you go to
your doctor's office and there's a filing cabinet full of medical records, or even just a to do list
or a list of things to buy at the grocery store that qualifies as a collection of data.
Or going back a little bit in time, if you remember what Rolodexes were, a Rolodex full of different
people's contact information that qualifies as a database under this definition.
Speaking of archaic technology like a Rolodex, another example of a database is a phone book.
So I say this mainly jokingly, but I actually have some siblings who don't know what phone book is,
or they've never seen one or used one before.
It's a gigantic book, basically, that lets you look up people's phone numbers based off of their name.
So it's usually organized by last name alphabetically for people.
So you would flip through the book until you find someone's last name, and then you would try and match
the first name and then you find their phone number.
So let's take a quick example here.
This is a fictional phone book.
Think of it as just a little section of a phone book that has tens of thousands of entries.
And these are fictional characters alphabetically organized by their last name.
So Archie Andrews becomes before Betty Cooper, who comes before Ned Flanders and so on.
And then we have corresponding phone numbers.
So imagine you have a gigantic phone book with this information in it, and I ask you to do something
like find Ned Flanders phone number.
Well, it's actually pretty straightforward.
As long as you're comfortable using the alphabet in alphabetical order.
You flip through the book until you find F, F, L, and so on, until you find Ned Flanders.
And then you find his phone number.
It's what the phone book is made for.
However, it gets a little trickier or a lot trickier, really.
If I asked you to do something like find everyone in the phone book who has the first name Ned.
There isn't an easy way to do this.
You basically would have to go through every entry in the book and check for however many thousands
there are.
Is this person's name Ned?
So I have a couple other questions that are similarly difficult.
So the point here is just if you were to find all phone numbers with a particular area code or to find
all people who have a three letter first name, it's not easy.
And it would take a lot of time, like a ton of time.
So that brings me to the next component of the definition of what makes something a database, in my
opinion, which is not just a collection of data, it also contains a method for accessing and manipulating
that data.
So going back to this phone book, we would want a way, some sort of program or code that would allow
us to do things like find everybody with the first name Ned or find all people who have a three letter
first name, or even do things like add a new person into the phonebook or change area codes or change
phone numbers, or get crazy and just delete people from our phonebook or delete everybody.
If we wanted to, we would have some sort of program or code as part of our database that would help
with that, that would allow us to interface with the data.
So I did say we were going to dive a little bit into jargon and terminology.
I usually try and stay away from that early on while I try and stay away from that in general, but
especially early on in the course.
Basically, if you've read about databases, if you've used one before, if you've read a blog post
about them, you may have come across the term database management system or relational database management
system or DMS or RB DMS and all these different acronyms.
Basically, this right here, what I have on the screen database versus database management system refers
to the fact that what I just talked about, having data, a collection of data and then having an interface
for that data are two different things.
So let me show you a quick example.
Imagine that you have an application, let's say it is a dating app, and then you have a database and
you're storing all sorts of information, all the different users, all the different messages that
have been sent, the photos, whatever else goes into your dating app.
But on its own, the database here is basically like our phonebook.
It's a gigantic collection of data, which is great for storing data, but it really doesn't let us
do very much.
You can almost think of it as if it was a gigantic file on your computer.
So for our application to be able to do things like update somebody's username in the database or edit
their profile photo or delete a user if they want to leave our application, whatever it is, there's
a database management system that allows us to interface with that database.
So it's just the code or the program that does the talking to our database for us.
So we talk to our database management system and it talks to the database.
Okay.
So for the most part, we're out of the weeds with the jargon here.
The reason I brought this up, though, is that oftentimes when people talk about a database, you actually
hear them referring to both of these things, the database management system and the database together
just as a database.
So what I have right here is a list of some of the more common databases you'll run into.
And actually, I just did it there.
What I was just talking about these four things, PostgreSQL, my SQL, Oracle SQL Light, they're not
technically databases, they're actually database management systems, but for the most part, people
just call them databases.
So when we say things like, my SQL is one of the most commonly used databases, it's actually one of
the most commonly used database management systems.
So it's not the end of the world if you forget about that.
But it is important because it will help you understand later on when we actually start talking about
SQL, when we start talking about some of the code that you write to interact with the database, I
think it will help you understand what you're doing and that you're giving commands to this database
management system, which then goes and gives commands to the actual data itself or to the database
itself.
So to wrap everything up, here's a little bit of a synthesized definition.
What is the database?
Well, it's a structured set of computerized data with an accessible interface.