Now this video is going to be a slight departure.
We're still working with inserting data.
But it's a slight side note which has to do with something called warnings.
So to illustrate what I'm describing here if we tried to insert something that looks like this.
So we're going back to cats and our cats have a name and an age.
If we tried to insert a cat whose name is this gigantic string this is a cat named Charlie which is
also a human name.
In fact I know a couple of Charlie's.
Fun fact if we're trying to put that as this cat's name and age is just 10.
If we do that let's go ahead and copy this just so I don't have to type that.
Make sure we have our cats table let's do describe cats.
Ok so name and age.
Remember those this restriction here of 50.
I'm just going to paste that and put a semi-colon.
I get something that says queery OK one reflected one warning just to double down on that.
I pulled it out into a separate slide one morning.
Oh my gosh what's going on.
Well if you wanted to know what that warning was we can use this command.
Show warnings.
So we'll go back and type show warnings and I want you to pause and think what is the warning.
If you were to guess obviously we haven't talked about it yet but what do you think.
I'll see.
And the answer is I get a warning here that says Data truncated for column name so that corresponds
to name here which had a limit of 50 characters.
And this is more than 50 characters I can't remember how much it is but it's more than 50.
And if we look at Katz
you'll see that our First of all our table gets a little messed up here.
But the string for name gets cut off after this cat is named Charlie which is also a.
And then the rest is gone.
So it's not like it's hidden and it's not displaying.
It's just not stored at all.
So that's important to note.
So that's one warning that we saw there.
And that happened when our data was truncated.
Can you think of another warning we could generate deliberately with something we could do that would
give us a warning to pause video or don't but try and come up with something based off of what we have
currently set up for cats.
How could we insert something that would give us a warning.
All right.
So what I was imagining is that we could try to insert something where we mixed up a data type.
So let's say age instead of being an integer we passed in some text random jibberish that should generate
a warning.
So let's try and insert into cat's name first and then age
and name will just be lemah.
Why not.
But age will be jibberish like that which is not a valid integer value.
Well hit enter.
We get one morning and we can view that warning with show warnings.
And this time it's a different warning.
It says incorrect integer value.
So the last one we saw said that name was truncated it was too long.
This one is telling us that incorrect integer value for column age.
So then here's a second thing for you to think about.
And you probably I mean Ill just have to guess but what do you think is stored in.