As many of you know, my technical roots are in databases, SQL, and full stack web development.
I’ve spent a lot of time creating videos on YouTube over databases. For example, I have a 51 part video series on Database Design.
Who or What is freeCodeCamp?
Recently I was reached out to by freeCodeCamp. For those who don’t know, freeCodeCamp is one of the most popular online learning platforms for software development. freeCodeCamp is a nonprofit organization that brings people from noob to developer through their online curriculum.
freeCodeCamp came to me to talk about potential collaborations. I’m happy to say that we came to agreements and decided that we would aggregate my database design series into one long, undivided video! As a result, the Database Design Full Course was born.
So far we’ve learned about the very basic concepts of Db2, but now I want to dive in a bit and work with tables. Some of the material in blog may take a few more blogs to fully understand, but that is okay. The goal is to get you started. Later we will come back and learn all the details.
We will be using SQL (Structured Query Language) to communicate to our database. DSM (Data Server Manager) is the UI (user interface) that we can use to work with our database, but we should do as much as we can with SQL. Why use code when there is a user interface? I’m glad you asked.
Before building a database for yourself or a corporation, you need to understand a bit about database structure.
We are going to go in some depth on how to design a database, which deals with structuring your database the best way possible. However, I thought it would be appropriate to give an overview of the Db2 structure and start using the database right away.
Once we have the fundamentals down, we are going to then go back to database design to learn the details. This will allow us to more concretely discuss database design because we’ve already had some experience with the fundamentals.
Here it is, your guide on getting started with Db2! Working with new software can be stressful, so my goal is to make this as easy as possible for you. Fortunately, Db2 setup is not too challenging.
Before we dive in and start downloading stuff, I want to take a moment to explain a few of the different editions of Db2. First off, we will be using Db2 for Linux, UNIX, and Windows. The edition we will be using is calledDeveloper Community Edition (You may hear it as Developer-C) which is a full-fledged version of Db2 with the only limitation that it is only to be used for development.
First off, what is a database? A database stores data, which is any information that might be of use to a company.
Db2 is a database created by IBM that is best known as an enterprise database, so we are talking about a database used by huge companies who have more data than they know what to do with. The great part for us is that that there are multiple editions of Db2 going all of the way up to the enterprise editions, but actually starting with a completely free version. That’s what I’ll be using.
So back on the topic of data. A database will often be used behind the scenes when you are using some software. Anytime you put information in software that you can access at a later time, that information will be stored in a database.
What is Mongo DB? MongoDB is an unstructured database that is becoming extremely popular for speed, ease-of-use, and scalability.
The Problem with Structured Data
Until now, the majority of the my content has covered relational databases. You communicate with a relational database using SQL (Structured Query Language). A relational database follows a structure defined by columns in a table.
The problem with a structured database is that it can become too structured and require a lot of resources to create and design a good database. For instance, I have a fifty part YouTube series just on how to design the structure of a relational database, and that doesn’t even talk about how to use the database.
Just to show one example of this, what if we have a table that defines some structure and for a specific row we want to have some extra data?
This will be a blog dedicated to designing relational database indexes. By this I mean we will be discussing the important topics of indexing a database but we will not be programming any SQL. This is all part of database design.
What is an index?
Wow, such as awesome question! An index allows us to select data from our table much quicker. Think of an index in a book…If you want to know something about a specific topic, you check the index.
In order to understand crow’s foot notation, we must first understand the basics of database design. I recommend you read the previous blogs listed to familiarize yourself with all of the database relationship concepts:
Cardinality refers to the relationship between a row of one table and a row of another table. The only two options for cardinality are one or many.
Example: Think of a credit card company that has two tables: a table for the person who gets the card and a table for the card itself. A row from the card_holder table would have a relationship with a row in the card table because the card_holder holds the card.