1 00:00:00,190 --> 00:00:03,130 Let's walk through the updating portion of this challenge. 2 00:00:03,150 --> 00:00:09,390 The first piece is to update all of the polo shirts so that their size is L for large. 3 00:00:09,780 --> 00:00:14,610 So as always, I like to select my target rows first. 4 00:00:14,610 --> 00:00:22,830 So select star from shirts and then I'll do something like wear article is polo shirt, I believe is 5 00:00:22,830 --> 00:00:24,540 polo space shirt. 6 00:00:24,930 --> 00:00:25,590 And there we are. 7 00:00:25,590 --> 00:00:27,060 We have three of them. 8 00:00:27,300 --> 00:00:30,510 So what I want to do is change their size to L. 9 00:00:30,690 --> 00:00:34,320 So instead of selecting, of course, I'm going to do an update. 10 00:00:37,720 --> 00:00:48,440 Update Shirt's set and then shirt size equals L wear article equals polo shirt. 11 00:00:48,460 --> 00:00:50,020 Let's see if that works. 12 00:00:50,110 --> 00:00:52,010 It says three rows changed. 13 00:00:52,030 --> 00:00:54,190 Let's go back and select all of them. 14 00:00:54,670 --> 00:00:55,810 And now we see. 15 00:00:55,840 --> 00:00:58,440 Oh, great, that looks good. 16 00:00:58,450 --> 00:01:03,940 I mean, I guess you could verify we didn't somehow change every single shirt to have size L. 17 00:01:03,970 --> 00:01:06,220 We still got a lot of smalls in there and mediums. 18 00:01:06,850 --> 00:01:08,350 So that's our first query. 19 00:01:08,440 --> 00:01:16,360 The next one is to update the shirt that was last worn 15 days ago and changed the last 1 to 0. 20 00:01:16,600 --> 00:01:25,240 So once again, I like to start selecting select start from shirts where last worn equals 15. 21 00:01:25,810 --> 00:01:28,360 Make sure that's what we're supposed to do and change. 22 00:01:28,360 --> 00:01:29,740 Last worn to zero. 23 00:01:29,740 --> 00:01:30,920 We wore it today. 24 00:01:30,940 --> 00:01:33,400 I guess it's a blue medium tank top. 25 00:01:33,670 --> 00:01:39,400 All right, so instead of selecting star from shirts, same thing, We're going to remove that first 26 00:01:39,400 --> 00:01:41,350 part of the query and change it to an update. 27 00:01:41,380 --> 00:01:44,770 Update Shirts set. 28 00:01:46,250 --> 00:01:49,430 And then last one equals zero. 29 00:01:49,460 --> 00:01:52,040 Where last one was 15. 30 00:01:52,070 --> 00:01:53,660 Let's go back and select it. 31 00:01:53,780 --> 00:01:54,440 And. 32 00:01:54,440 --> 00:01:58,250 Well, we can't because my query is still looking for last one of 15. 33 00:01:58,430 --> 00:02:00,530 Let's just select start from shirts. 34 00:02:01,790 --> 00:02:03,870 So that one had an ID of eight. 35 00:02:03,890 --> 00:02:07,550 Look for that idea of eight and last one is now zero. 36 00:02:08,509 --> 00:02:09,080 All right. 37 00:02:09,080 --> 00:02:10,610 And I think this is our final piece. 38 00:02:10,639 --> 00:02:11,320 It is. 39 00:02:11,330 --> 00:02:17,750 Update all the white shirts to have a size of extra small and color to off white. 40 00:02:18,200 --> 00:02:19,400 Same process. 41 00:02:19,400 --> 00:02:25,280 Select star from shirts where color equals white. 42 00:02:25,550 --> 00:02:26,750 And there's two of them. 43 00:02:26,990 --> 00:02:29,660 And we need to change their size to extra small. 44 00:02:29,660 --> 00:02:32,720 And at the same time, I don't want to do two separate queries. 45 00:02:32,930 --> 00:02:38,750 I want to do an update to their shirt size or rather to their color to be off white. 46 00:02:38,750 --> 00:02:44,060 So update shirts sets color to be off. 47 00:02:44,300 --> 00:02:51,200 I'll match it off space white comma if I want a second thing that we're updating, we're going to update 48 00:02:51,200 --> 00:02:54,830 shirt size to be X. 49 00:02:54,830 --> 00:02:57,050 S, make sure that's correct, too. 50 00:02:58,100 --> 00:02:58,760 All right. 51 00:02:58,760 --> 00:03:00,800 And I've got an extra shirts in here. 52 00:03:00,800 --> 00:03:02,140 I don't need that. 53 00:03:02,140 --> 00:03:03,680 And that was from when I had my select. 54 00:03:03,680 --> 00:03:10,310 So update shirts set color to off white and shirt size extra small where color is currently white. 55 00:03:11,090 --> 00:03:11,830 Great. 56 00:03:11,840 --> 00:03:15,710 Let's go ahead and select star from shirts. 57 00:03:15,710 --> 00:03:18,770 And we had one and seven. 58 00:03:18,860 --> 00:03:21,260 One is now off white extra small. 59 00:03:21,290 --> 00:03:22,430 Seven is now off. 60 00:03:22,430 --> 00:03:22,910 White. 61 00:03:22,910 --> 00:03:23,810 Extra small. 62 00:03:24,140 --> 00:03:24,740 Great.