WEBVTT

00:00.060 --> 00:06.150
So now that you've seen the three data types we're talking about here around dates which are date time

00:06.180 --> 00:11.780
and date time let's hop over to cloud 9 and just try them out and briefly.

00:12.120 --> 00:18.180
So but I'm going to do is actually make a new table and in this one table I'm going to use all three

00:18.180 --> 00:20.700
types to three different columns.

00:20.700 --> 00:27.540
Of course so that we can compare and contrast how they work and you'll see that they're pretty similar

00:27.540 --> 00:28.690
honestly.

00:29.010 --> 00:34.050
Which is why I didn't want to make three separate videos because it would be pretty boring if be a lot

00:34.050 --> 00:35.280
of repetition.

00:35.850 --> 00:37.830
So let's go ahead and do this.

00:37.830 --> 00:39.540
Now we're going to make a table called people

00:42.490 --> 00:47.650
and people we will have we're going to work with.

00:47.680 --> 00:50.600
Well we'll start with name which will just be of our chart.

00:50.830 --> 00:52.670
So somebody's name.

00:52.910 --> 01:00.860
Then we're also going to have birth day as a date birthday as a time and birthday as a date time of

01:00.860 --> 01:03.950
course we can't just call it birthday three times.

01:03.950 --> 01:15.990
So we'll start with a birth date is a date then we'll have birth time is a time.

01:16.370 --> 01:21.930
Finally birth date time is kind of annoying.

01:22.220 --> 01:29.640
Let's just do D.T. is a date time just like that OK.

01:29.750 --> 01:35.640
So we have that table now with name birth date birth time birth date.

01:36.410 --> 01:41.950
So we're not going to spend a lot of time adding data in but let's insert at least two.

01:41.990 --> 01:42.630
So let's do it.

01:42.620 --> 01:55.070
Insert into people and all start with name birth date birth time birth date.

01:55.650 --> 01:57.580
OK just like that.

01:57.740 --> 02:03.390
And then on our new line this is going to be the worst part.

02:03.470 --> 02:05.150
So let's make up a date.

02:05.160 --> 02:14.260
Put a name first of all let's say you had and then the birth date.

02:14.520 --> 02:23.060
Remember we need that year year year dash month month Dasch day day format so we will do nineteen eighty

02:23.450 --> 02:29.760
three dash let's do 11 11.

02:29.910 --> 02:35.970
So that's the birth date and the first time needs to follow ours minute.

02:36.030 --> 02:39.990
Second of all our hour Colan minute minute call and second second.

02:40.290 --> 02:46.550
So let's say 10 post seven reps

02:49.690 --> 02:58.030
thirty five and then if you want to be accurate for the date time we'd basically combine these two.

02:58.270 --> 03:07.900
So we would have 1983 dash 11 dash 11 space and the same time OK.

03:08.310 --> 03:10.710
So that's kind of annoying to type.

03:10.710 --> 03:17.050
You're usually not doing things like this to be honest but just make sure you don't have any typos.

03:17.400 --> 03:18.750
Not missing any quotes.

03:19.760 --> 03:24.440
We'll see and see oh boy did you have a problem.

03:24.730 --> 03:25.930
And this is a silly one.

03:25.930 --> 03:28.320
We're missing the values keyword.

03:28.960 --> 03:31.260
Hopefully you caught that before me.

03:33.020 --> 03:33.820
OK.

03:34.360 --> 03:39.590
So I'm just going to recall that and just change some information so we have two people in there.

03:39.670 --> 03:50.420
So we had Padna Let's put Larry who was born in 1943

03:52.150 --> 03:58.300
and on December 25th on Christmas

04:01.380 --> 04:02.010
Pat

04:04.430 --> 04:07.980
stew for

04:11.280 --> 04:12.710
10.

04:13.660 --> 04:15.270
Forty two.

04:15.870 --> 04:17.860
And then I'll just copy this.

04:17.870 --> 04:19.650
You don't have to retype the whole thing.

04:21.630 --> 04:22.780
I apologize.

04:22.790 --> 04:25.260
It's a little bit painful to sit through.

04:25.390 --> 04:30.770
We're not doing much but we need some data to work with.

04:30.820 --> 04:31.200
OK.

04:31.200 --> 04:33.110
So that should be sufficient now.

04:33.180 --> 04:36.350
Just make sure that matches up.

04:36.360 --> 04:42.640
All right so now we do a select star from people to people in there.

04:42.720 --> 04:48.480
And then we're storing birth day information three different ways although they're not equivalent of

04:48.480 --> 04:53.960
course because we have just the date just the time and then the date and time together.

04:54.180 --> 04:59.310
So now that we have this data in there we're going to focus for a couple of videos pretty short videos

04:59.310 --> 05:01.440
on how we can work with this data.

05:01.440 --> 05:05.340
There are some functions that come with my as well.

05:05.390 --> 05:09.570
And we've seen a bunch of them but there some that work with dates and date times and times and we're

05:09.570 --> 05:13.250
going to focus on those to do things like format our data nicely.

05:13.260 --> 05:14.760
So how do we format dates.

05:14.880 --> 05:20.730
How do we get the day of the week based when based off of someone's day that we're born.

05:20.730 --> 05:24.160
Things like that and how do we print out a nice version.

05:24.210 --> 05:26.640
This is all a bit ugly.

05:26.820 --> 05:28.890
And then also how do we do math with dates.

05:28.890 --> 05:36.480
No we're not going to do any heavy duty math but things like calculating how many years it's been from

05:36.480 --> 05:40.910
1943 to now or how many days since pediment was born.

05:40.980 --> 05:42.080
Those sort of things.

05:42.180 --> 05:45.290
And we'll be able to do that now because we have this data in here.

05:45.600 --> 05:47.420
So thanks for sitting through that.

05:47.460 --> 05:48.890
I know it's probably a bit painful.
