1 00:00:00,210 --> 00:00:00,870 All right. 2 00:00:00,870 --> 00:00:06,480 Moving along to the next function, which is reverse and reverse does what it sounds like. 3 00:00:06,480 --> 00:00:08,250 It reverses strings. 4 00:00:09,180 --> 00:00:12,930 That's why I said it's super straight forward, you know, forward. 5 00:00:12,930 --> 00:00:13,710 Reverse. 6 00:00:13,740 --> 00:00:14,460 It's a joke. 7 00:00:15,360 --> 00:00:16,050 Yep. 8 00:00:16,680 --> 00:00:17,610 So that's what it does. 9 00:00:17,610 --> 00:00:18,870 It will reverse a string. 10 00:00:19,560 --> 00:00:20,700 So here's an example. 11 00:00:20,730 --> 00:00:27,460 Select reverse of Hello World and we get this row. 12 00:00:27,990 --> 00:00:28,820 Ola. 13 00:00:28,850 --> 00:00:29,600 Ola. 14 00:00:30,120 --> 00:00:35,070 I think it's probably best if I just stop pronouncing them from here on out, but you get the reversed 15 00:00:35,070 --> 00:00:37,440 version of the string, same casing and everything. 16 00:00:37,440 --> 00:00:39,780 Same spaces just reversed. 17 00:00:41,540 --> 00:00:44,300 And that's kind of all there is to it, to be honest. 18 00:00:44,330 --> 00:00:45,590 I'll show you a couple of examples. 19 00:00:45,590 --> 00:00:50,510 But if you feel like you already have a that was enough for you and you understand how it works and 20 00:00:50,510 --> 00:00:51,740 feel free to just move on. 21 00:00:51,740 --> 00:00:55,940 But I'll go over to Cloud Nine and show a couple of examples. 22 00:00:55,940 --> 00:01:03,770 So let's do a select reverse and instead of Hello World, let's just do Meow Meow. 23 00:01:03,800 --> 00:01:06,200 Why not just like that? 24 00:01:07,340 --> 00:01:09,620 And we get what I said, I wouldn't pronounce them. 25 00:01:09,620 --> 00:01:14,540 Well, we get this right here reversed of meow meow. 26 00:01:14,930 --> 00:01:21,980 So we could do the same thing to find the reverse of every author's first name in our table, for instance. 27 00:01:22,070 --> 00:01:31,760 So that would be a select reverse author f name, and then from books. 28 00:01:32,600 --> 00:01:33,620 And there we go. 29 00:01:34,010 --> 00:01:38,330 We get the reverse of Jhumpa, the reverse of Neil, and so on. 30 00:01:39,770 --> 00:01:41,240 And that's kind of it. 31 00:01:41,600 --> 00:01:44,900 And just like some of these other ones, we can combine them. 32 00:01:45,080 --> 00:01:50,330 So if I wanted to turn something into a palindrome, for instance, let's say I started with the string 33 00:01:50,330 --> 00:01:51,110 woof. 34 00:01:51,950 --> 00:01:56,330 And if you're not familiar, a palindrome is something that reads the same forwards and backwards. 35 00:01:56,330 --> 00:02:03,440 So the way I would do that is by adding f0w to that and concatenating them. 36 00:02:03,440 --> 00:02:08,840 So taking the original string plus the reverse string and concatenating them. 37 00:02:09,110 --> 00:02:10,699 So we have two functions. 38 00:02:10,699 --> 00:02:20,570 We've seen how to do that and it's just a matter of cat, so a select can cat and we'll just start with 39 00:02:20,570 --> 00:02:24,260 Woof and then what do we want to concatenate it with? 40 00:02:24,260 --> 00:02:30,410 Well, we want to concatenate it with the reverse of woof. 41 00:02:31,020 --> 00:02:32,100 Just like that. 42 00:02:32,580 --> 00:02:34,240 And that should do it. 43 00:02:34,260 --> 00:02:35,340 Let's try it out. 44 00:02:37,470 --> 00:02:42,930 And we get this the palindrome version, I guess, that we just made this sandwich. 45 00:02:43,380 --> 00:02:47,070 Now let's just try it with authors first names again. 46 00:02:47,250 --> 00:02:48,960 So let's do that now. 47 00:02:50,070 --> 00:02:52,320 All we need to do is replace a couple of things in here. 48 00:02:52,320 --> 00:03:00,270 So rather than concluding, woof, we're going to do author f name, and then we're going to use the 49 00:03:00,270 --> 00:03:03,540 reverse of author f name as well. 50 00:03:05,820 --> 00:03:06,930 Just like that. 51 00:03:07,770 --> 00:03:10,130 And then, of course, we need to say from where? 52 00:03:10,140 --> 00:03:11,610 From books. 53 00:03:12,720 --> 00:03:13,860 Let's copy that. 54 00:03:14,070 --> 00:03:19,110 So just again, we're taking the author's first name, the reverse of the author's first name, and 55 00:03:19,110 --> 00:03:21,150 we're smashing them together with Cat. 56 00:03:23,560 --> 00:03:24,790 And there we go. 57 00:03:25,750 --> 00:03:26,410 We get. 58 00:03:26,500 --> 00:03:27,770 This one's kind of funny, I guess. 59 00:03:27,790 --> 00:03:28,990 David Devore. 60 00:03:29,030 --> 00:03:33,760 DD And I don't think any of them are really pronounceable otherwise. 61 00:03:34,510 --> 00:03:36,610 But they are valid palindromes. 62 00:03:37,150 --> 00:03:39,010 So I guess we succeeded at something.