1 00:00:00,190 --> 00:00:01,990 Wow, great job. 2 00:00:01,990 --> 00:00:03,570 Also, while you're at it, 3 00:00:03,570 --> 00:00:06,170 they'd like you to figure out which room seats the most people. 4 00:00:07,220 --> 00:00:11,840 To figure out which room has the largest capacity, instead of using the sum or 5 00:00:11,840 --> 00:00:15,890 count aggregate methods, we'll be using the MAX method. 6 00:00:15,890 --> 00:00:23,513 So let's SELECT the MAX(CAPACITY) FROM the ROOMS table. 7 00:00:23,513 --> 00:00:27,705 Then you Shift+Enter, and it looks like the MAX(CAPACITY) is 40. 8 00:00:27,705 --> 00:00:31,400 And to figure out which room this is, we can just add in the ID column. 9 00:00:32,480 --> 00:00:36,000 And if we run it now, it looks like it's room 19. 10 00:00:36,000 --> 00:00:41,630 Also, another cool thing you can do is you can always just SELECT *. 11 00:00:41,630 --> 00:00:45,650 You don't have to have * by itself, you can also use it with other columns. 12 00:00:45,650 --> 00:00:51,220 So selecting * and the MAX(CAPACITY) will give us both the ID and 13 00:00:51,220 --> 00:00:55,110 CAPACITY columns, and then the MAX(CAPACITY) columns. 14 00:00:55,110 --> 00:00:59,790 Another thing to mention is that if we had more than one ROOM with the same CAPACITY, 15 00:00:59,790 --> 00:01:03,630 which we don't in this example, but you might in a real-world scenario. 16 00:01:03,630 --> 00:01:06,870 Then instead of doing this you might want to figure out the MAX(CAPACITY), 17 00:01:06,870 --> 00:01:11,390 which is 40, and then SELECT everything from ROOMS 18 00:01:12,510 --> 00:01:16,310 where the CAPACITY is equal to your MAX(CAPACITY). 19 00:01:16,310 --> 00:01:18,381 Which in this example is just 19. 20 00:01:18,381 --> 00:01:21,600 But again, if you had more than one room, you'd probably want to do it this way.