1 00:00:00,120 --> 00:00:04,010 And we finally hit the end of the section where we have an exercise. 2 00:00:04,019 --> 00:00:07,410 So it's time to get some practice working with the different data types we've covered. 3 00:00:07,710 --> 00:00:13,470 And this exercise involves a couple of free response questions, I guess you would call it. 4 00:00:13,770 --> 00:00:18,660 The first one is what is a good use case for CHA or car? 5 00:00:18,690 --> 00:00:19,410 Just make one up. 6 00:00:19,410 --> 00:00:20,370 You don't have to write any code. 7 00:00:20,370 --> 00:00:21,120 Just what is it? 8 00:00:21,120 --> 00:00:21,960 Good use case. 9 00:00:21,960 --> 00:00:26,730 Why would you use one over of cha cha then fill in the blanks. 10 00:00:26,730 --> 00:00:30,720 What would the types be that are appropriate for this table we're making? 11 00:00:30,930 --> 00:00:32,280 It's called inventory. 12 00:00:32,280 --> 00:00:33,660 We have an item name. 13 00:00:34,200 --> 00:00:38,450 You don't really have to worry about the length of each of these, but you know, item name, it's going 14 00:00:38,450 --> 00:00:39,120 to be text. 15 00:00:39,120 --> 00:00:47,010 What type of text price here is always going to be less than $1 million and it will only ever have two 16 00:00:47,010 --> 00:00:47,790 decimals. 17 00:00:48,000 --> 00:00:49,770 So what data type makes sense there? 18 00:00:49,770 --> 00:00:51,210 And then quantity. 19 00:00:51,330 --> 00:01:00,450 Let's say we can only have a whole number of an item after that Explain out loud or in your head what's 20 00:01:00,450 --> 00:01:03,360 the difference between date, time and time stamp? 21 00:01:03,690 --> 00:01:04,620 How are they similar? 22 00:01:04,620 --> 00:01:05,519 How are they different? 23 00:01:06,650 --> 00:01:08,180 Then a little bit of code. 24 00:01:08,180 --> 00:01:12,080 Write a select statement to print out the current time. 25 00:01:12,080 --> 00:01:13,040 Just the time. 26 00:01:13,710 --> 00:01:18,330 And then do the same thing, but to print out the current date without the time. 27 00:01:18,330 --> 00:01:19,680 So just the date. 28 00:01:20,650 --> 00:01:25,480 After that, you'll have to print out the current day of the week as a number. 29 00:01:25,480 --> 00:01:27,000 So we saw how to do this. 30 00:01:27,010 --> 00:01:32,770 You'll have to use something to get the current time or the current day rather, and then you'll have 31 00:01:32,770 --> 00:01:37,240 to pass that through to something that will give you the day of the week and then do the same thing, 32 00:01:37,240 --> 00:01:40,330 but get the name of the day, the day name. 33 00:01:40,330 --> 00:01:45,490 So whatever day it is that you're running this on, it should say Monday or Saturday or Friday. 34 00:01:46,240 --> 00:01:51,430 Then print out the current current date and time using this format. 35 00:01:51,430 --> 00:01:53,470 So I want there to be slashes there. 36 00:01:53,470 --> 00:01:59,770 I want it to be two digits of the month, slash two days slash all four digits of the year. 37 00:02:00,070 --> 00:02:05,620 So you'll need to format it using some special stuff that we covered and then do that again. 38 00:02:05,620 --> 00:02:11,830 But this time, print out the current date in time using this format where we have the full month name 39 00:02:11,920 --> 00:02:20,020 and then the what is it called where you get the suffix first, second, third, 27th, and then at 40 00:02:20,020 --> 00:02:22,120 and then the time here. 41 00:02:22,150 --> 00:02:24,610 So hours, colon minutes. 42 00:02:24,610 --> 00:02:29,650 And I didn't specify if this is 12 hour or 24 hour time, so let's just say 24 hour time. 43 00:02:30,810 --> 00:02:35,010 And then finally create a new table called tweets. 44 00:02:35,040 --> 00:02:36,420 It's a simple table. 45 00:02:36,450 --> 00:02:39,540 It has something to store the tweet content. 46 00:02:39,750 --> 00:02:43,380 And let's say I think a tweet has to be 180 characters or fewer. 47 00:02:43,410 --> 00:02:44,250 I don't remember. 48 00:02:44,250 --> 00:02:44,980 I know it changed. 49 00:02:44,990 --> 00:02:49,830 It used to be hundred and 40, I think I'm not on Twitter, but make it some number. 50 00:02:49,830 --> 00:02:56,220 Let's call it 180 of characters and then a username and then the time the tweet was created. 51 00:02:56,220 --> 00:03:00,660 And I want this to automatically be filled in by my SQL. 52 00:03:00,900 --> 00:03:03,330 So use one of those defaults that we learned about. 53 00:03:04,010 --> 00:03:04,590 Okay. 54 00:03:04,860 --> 00:03:06,970 So once you finish that, you can pat yourself on the back. 55 00:03:06,990 --> 00:03:09,870 This has been a bit of a slog of this section. 56 00:03:09,870 --> 00:03:10,590 I know. 57 00:03:10,590 --> 00:03:15,780 I mean, there's a reason we didn't cover all these data types upfront when I was just I just wanted 58 00:03:15,780 --> 00:03:17,730 to make sure I didn't lose anybody at the beginning. 59 00:03:17,730 --> 00:03:22,680 We got to just have the basics select, insert, update, create table. 60 00:03:22,860 --> 00:03:26,130 So I just showed the very basics of int and var char. 61 00:03:26,130 --> 00:03:31,680 But as we saw in this section, there's a lot more data types and it can be a little tedious to cover 62 00:03:31,680 --> 00:03:32,210 them all. 63 00:03:32,220 --> 00:03:36,690 Anyway, get some practice, do this exercise and I'll be back with a solution.