Welcome back. In this section, we're going to talk about data types. If you have experienced learning a bunch of programming languages, you'll be familiar with some of this already. Even if you've learned a new human language, this section might feel a little bit like learning a new language as alphabet. It's a fundamental and important building block for writing code or written language, but it can also be a bit tedious and repetitive. What I'd like for you to know at the end of this is how to learn the data types in a language you're working with and we'll do that by figuring out what it looks like when you get the data types wrong and how to fix it. After this lesson you'll be able to review data types and table syntax. Let's get started. For this class the table creation parts we're using MySQL. Most of what you learn in this class isn't specific to MySQL, but here it is. So, don't go memorizing data types. That's not what I'm asking you to do. Instead, make sure you know the basic categories and the kind of variation that can exist. Before we go straight into data types, when you're thinking about picking the right data type, here are two guiding principles to get started with. Use the right data types for the tools you want to use. Metaphor time. If you are hoping to stick your leftovers, your leftover food in the oven later. Then maybe you don't want to put them in plastic because it will melt. If you are planning to microwave them, then maybe they don't put them in a metal pan. Same idea for SQL data types. If you want to be able to do math to a number, then don't store it in a string. Here's the other thing to think about. Storage space adds up. If you put your smallest leftovers in the biggest topper where you have, sometimes that's fine. If you do that with every bit of food in your fridge you'll end up filling up your fridge with air, very cold air. Buying another fridge might not be an option at least not before your leftovers go bad. It's kind of the same concept with data types in your database except that you have to pick the same size container for everything that could possibly go in a column. If you use a datatype that takes up more storage space than you need, becomes more of a concern as your table gets bigger. Okay. Let's dive into the main kinds of data types. There are numbers, love those guys. You can do all kinds of stuff with them edition, averages, etc. Sadly, not everything can be a number. Sometimes you need to use words. We use that for the item categories for example. There are tools like regular expressions that you get access to when you're working with strings. Then we've also got dates and times. There are all kinds of special things that you can do with dates, but the most useful so far as I've seen is the ability to compare them to one another. Here are all of the kinds of containers you can put numbers in. I've highlighted what I think of as the greatest hits of data types in MySQL. Some of the nuances between the size of the containers in this category make no difference when you're querying a table. Since we are focusing on building tables for this section, that's when you want to focus on getting the datatype, right? For strings, in this class we'll fill them with things like item names and user our email addresses. We might need to figure out if those are all going to fit within the smallest 255 character container. If you're bored, see if you can come up with an email address that's 255 characters long and imagine typing that in every time you want to log into something. I think refined for email addresses. There might be some cases where we need to think about the size of the string in the future. Maybe right now 255 characters is enough for the full item name. But next year, we are thinking about offering the warmest, fuzziest, industrial strength contraption warmer in both glossy and matt, and we might need every single one of those 255 characters to do it. Or maybe a more realistic example. If we're dealing with an event stream that's really just a long string of JSON which is a pretty common way to store data that needs a flexible format, we might want to leave room for some of those were boast parameters later. Two hundred and fifty five characters might be enough right now, but maybe not forever. For dates and times, I most commonly care about the date. For some specific cases, especially in section four, we'll talk about the hours and minutes because we'll be comparing two times that might happen on the same day. Most likely you'll just use whatever is already being used in your dataset, but if I had to pick my favorites, it would be date and date time. Okay. Hopefully, now you know some basics. Let's head into the exercises where we'll look at some SQL gone wrong and you can help identify why.