1
00:00:00,330 --> 00:00:00,720
Okay.

2
00:00:00,720 --> 00:00:05,310
Let's take a look at a potential solution for this people problem.

3
00:00:06,000 --> 00:00:13,200
So first thing, we need to create the table using the create table statement with first name as a var

4
00:00:13,200 --> 00:00:18,510
char 20 last name, var char with a 20 character limit and age as an int.

5
00:00:18,510 --> 00:00:19,530
So let's do that.

6
00:00:21,030 --> 00:00:25,250
I'm just working in the Kat app for now.

7
00:00:25,260 --> 00:00:26,190
It's fine.

8
00:00:26,190 --> 00:00:27,840
We're going to delete this at the end.

9
00:00:28,110 --> 00:00:32,850
So we'll start off with the create table and we'll call it people.

10
00:00:35,720 --> 00:00:43,940
And the first thing that we'll have is first name, which is fa fa fa fa 20.

11
00:00:46,130 --> 00:00:49,580
Next thing is last name, which is the exact same.

12
00:00:51,620 --> 00:00:57,110
And then finally we have age, which is an int, and then our closing parentheses.

13
00:00:58,660 --> 00:00:59,200
Okay.

14
00:00:59,230 --> 00:01:00,160
Let's just double check.

15
00:01:00,160 --> 00:01:00,770
It worked.

16
00:01:00,790 --> 00:01:03,700
Let's use describe people.

17
00:01:05,040 --> 00:01:05,610
Cool.

18
00:01:05,640 --> 00:01:06,150
First name.

19
00:01:06,150 --> 00:01:06,600
Last name.

20
00:01:06,600 --> 00:01:08,210
Age bar cha cha cha.

21
00:01:09,060 --> 00:01:09,890
Perfect.

22
00:01:09,960 --> 00:01:15,690
So now we're going to insert our first person, Tina Belcher, who is 13.

23
00:01:16,800 --> 00:01:20,040
So insert into people.

24
00:01:21,680 --> 00:01:22,850
And we'll start off.

25
00:01:22,850 --> 00:01:30,350
Let's do first name, last name, age and then values.

26
00:01:31,850 --> 00:01:34,030
And we'll do hoops.

27
00:01:34,430 --> 00:01:37,580
Tina Belcher.

28
00:01:39,920 --> 00:01:41,480
It was 13, right?

29
00:01:43,580 --> 00:01:56,090
Okay we hit enter just double check that it worked select star from people there Tina is perfect.

30
00:01:57,800 --> 00:02:02,450
Now we're going to insert our second person, Bob Belcher, who is 42.

31
00:02:02,450 --> 00:02:05,270
And my instruction here was do it in a different order.

32
00:02:05,600 --> 00:02:10,400
So we'll do an insert into people this time.

33
00:02:10,400 --> 00:02:11,960
Let's do age.

34
00:02:12,110 --> 00:02:14,570
Last name, first name.

35
00:02:16,900 --> 00:02:17,920
Values.

36
00:02:18,220 --> 00:02:22,300
So age was priority for Cochise, 42.

37
00:02:23,620 --> 00:02:28,510
Last name is Belcher and first name is Bob.

38
00:02:29,800 --> 00:02:31,090
Don't forget our semicolon.

39
00:02:32,470 --> 00:02:34,330
Let's do our select again.

40
00:02:34,960 --> 00:02:35,770
Perfect.

41
00:02:35,980 --> 00:02:37,720
It worked out how I was supposed to.

42
00:02:38,170 --> 00:02:38,710
Great.

43
00:02:39,550 --> 00:02:43,030
So then the last insert we're going to do is a multiple insert.

44
00:02:43,330 --> 00:02:47,350
We have Linda Belcher, Phillip Frond and Calvin fish odor.

45
00:02:47,740 --> 00:02:48,160
Oh, boy.

46
00:02:48,160 --> 00:02:49,900
It's just going to be a lot to remember.

47
00:02:50,020 --> 00:02:52,680
Let's start off by just typing out the basics.

48
00:02:52,690 --> 00:03:02,830
Insert into people and we'll do this one with first name, then last name, and then finally age just

49
00:03:02,830 --> 00:03:03,640
like that.

50
00:03:04,450 --> 00:03:09,710
Then we'll do values and we'll start off poof.

51
00:03:09,790 --> 00:03:18,640
We'll start off with Linda Belcher, who is 45, I think it was.

52
00:03:19,390 --> 00:03:23,620
And I'll do commas on the new line and then we'll go with.

53
00:03:25,660 --> 00:03:27,280
Phillip frond.

54
00:03:33,080 --> 00:03:35,300
And he is 45.

55
00:03:35,870 --> 00:03:37,370
No, 38.

56
00:03:38,630 --> 00:03:39,800
I made this too hard.

57
00:03:40,920 --> 00:03:43,710
Lastly, we have Calvin Fish out here.

58
00:03:43,710 --> 00:03:48,090
I'm just going to copy Fish Odor, who is 70.

59
00:03:49,900 --> 00:03:50,770
Calvin.

60
00:03:53,140 --> 00:03:55,450
Fish odor 70.

61
00:03:56,080 --> 00:03:57,070
All righty.

62
00:03:57,070 --> 00:03:59,800
And before I forget, I need a semicolon.

63
00:04:00,930 --> 00:04:01,740
Perfect.

64
00:04:02,070 --> 00:04:03,900
Let's do our select star again.

65
00:04:04,770 --> 00:04:11,130
Have to use the up arrow a couple of times and we have Linda, Philip and Calvin belch different fish

66
00:04:11,130 --> 00:04:11,370
odor.

67
00:04:11,370 --> 00:04:13,320
45, 38, 70.

68
00:04:13,590 --> 00:04:14,370
Perfect.

69
00:04:14,640 --> 00:04:15,740
So that's it.

70
00:04:15,750 --> 00:04:20,829
And I didn't specify this in the instructions, but let's go ahead and delete the table.

71
00:04:20,850 --> 00:04:24,690
So that's drop table, people.

72
00:04:25,410 --> 00:04:28,080
Goodbye to the Belcher's and the other two.

73
00:04:30,310 --> 00:04:31,780
And we verify that it's gone.

74
00:04:31,780 --> 00:04:34,930
If you tried to do select staff from people, we get an error.

75
00:04:35,440 --> 00:04:39,910
But if we do show tables now, we only have cats.

76
00:04:40,450 --> 00:04:41,680
All the people are gone.

77
00:04:41,680 --> 00:04:43,210
Just left with cats.

