WEBVTT

00:00.120 --> 00:02.240
Now this video is going to be a slight departure.

00:02.460 --> 00:04.200
We're still working with inserting data.

00:04.230 --> 00:10.130
But it's a slight side note which has to do with something called warnings.

00:10.650 --> 00:16.670
So to illustrate what I'm describing here if we tried to insert something that looks like this.

00:16.710 --> 00:20.670
So we're going back to cats and our cats have a name and an age.

00:21.180 --> 00:26.760
If we tried to insert a cat whose name is this gigantic string this is a cat named Charlie which is

00:26.760 --> 00:27.540
also a human name.

00:27.540 --> 00:28.920
In fact I know a couple of Charlie's.

00:28.920 --> 00:35.070
Fun fact if we're trying to put that as this cat's name and age is just 10.

00:35.070 --> 00:40.400
If we do that let's go ahead and copy this just so I don't have to type that.

00:40.770 --> 00:45.450
Make sure we have our cats table let's do describe cats.

00:45.850 --> 00:47.550
Ok so name and age.

00:47.550 --> 00:51.750
Remember those this restriction here of 50.

00:51.750 --> 00:56.220
I'm just going to paste that and put a semi-colon.

00:56.380 --> 01:05.200
I get something that says queery OK one reflected one warning just to double down on that.

01:05.200 --> 01:08.230
I pulled it out into a separate slide one morning.

01:08.500 --> 01:10.350
Oh my gosh what's going on.

01:10.720 --> 01:15.960
Well if you wanted to know what that warning was we can use this command.

01:16.090 --> 01:17.930
Show warnings.

01:18.280 --> 01:27.580
So we'll go back and type show warnings and I want you to pause and think what is the warning.

01:28.090 --> 01:31.660
If you were to guess obviously we haven't talked about it yet but what do you think.

01:31.690 --> 01:34.100
I'll see.

01:34.270 --> 01:41.710
And the answer is I get a warning here that says Data truncated for column name so that corresponds

01:41.710 --> 01:45.310
to name here which had a limit of 50 characters.

01:45.310 --> 01:50.270
And this is more than 50 characters I can't remember how much it is but it's more than 50.

01:50.890 --> 01:53.350
And if we look at Katz

01:58.310 --> 02:02.690
you'll see that our First of all our table gets a little messed up here.

02:02.900 --> 02:09.700
But the string for name gets cut off after this cat is named Charlie which is also a.

02:10.220 --> 02:11.680
And then the rest is gone.

02:11.900 --> 02:15.700
So it's not like it's hidden and it's not displaying.

02:15.800 --> 02:17.660
It's just not stored at all.

02:17.750 --> 02:19.070
So that's important to note.

02:19.370 --> 02:21.760
So that's one warning that we saw there.

02:22.270 --> 02:25.130
And that happened when our data was truncated.

02:25.220 --> 02:30.650
Can you think of another warning we could generate deliberately with something we could do that would

02:30.650 --> 02:38.030
give us a warning to pause video or don't but try and come up with something based off of what we have

02:38.030 --> 02:40.400
currently set up for cats.

02:40.400 --> 02:44.000
How could we insert something that would give us a warning.

02:44.000 --> 02:44.480
All right.

02:44.690 --> 02:50.290
So what I was imagining is that we could try to insert something where we mixed up a data type.

02:50.360 --> 02:58.160
So let's say age instead of being an integer we passed in some text random jibberish that should generate

02:58.160 --> 02:58.950
a warning.

02:58.970 --> 03:05.420
So let's try and insert into cat's name first and then age

03:08.210 --> 03:12.760
and name will just be lemah.

03:12.830 --> 03:13.910
Why not.

03:13.910 --> 03:19.240
But age will be jibberish like that which is not a valid integer value.

03:19.570 --> 03:20.420
Well hit enter.

03:20.540 --> 03:26.670
We get one morning and we can view that warning with show warnings.

03:28.500 --> 03:30.720
And this time it's a different warning.

03:30.950 --> 03:32.860
It says incorrect integer value.

03:32.870 --> 03:37.820
So the last one we saw said that name was truncated it was too long.

03:37.820 --> 03:43.760
This one is telling us that incorrect integer value for column age.

03:43.760 --> 03:45.980
So then here's a second thing for you to think about.

03:46.160 --> 03:50.870
And you probably I mean Ill just have to guess but what do you think is stored in.
