So now that you've seen the three data types we're talking about here around dates which are date time
and date time let's hop over to cloud 9 and just try them out and briefly.
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
types to three different columns.
Of course so that we can compare and contrast how they work and you'll see that they're pretty similar
honestly.
Which is why I didn't want to make three separate videos because it would be pretty boring if be a lot
of repetition.
So let's go ahead and do this.
Now we're going to make a table called people
and people we will have we're going to work with.
Well we'll start with name which will just be of our chart.
So somebody's name.
Then we're also going to have birth day as a date birthday as a time and birthday as a date time of
course we can't just call it birthday three times.
So we'll start with a birth date is a date then we'll have birth time is a time.
Finally birth date time is kind of annoying.
Let's just do D.T. is a date time just like that OK.
So we have that table now with name birth date birth time birth date.
So we're not going to spend a lot of time adding data in but let's insert at least two.
So let's do it.
Insert into people and all start with name birth date birth time birth date.
OK just like that.
And then on our new line this is going to be the worst part.
So let's make up a date.
Put a name first of all let's say you had and then the birth date.
Remember we need that year year year dash month month Dasch day day format so we will do nineteen eighty
three dash let's do 11 11.
So that's the birth date and the first time needs to follow ours minute.
Second of all our hour Colan minute minute call and second second.
So let's say 10 post seven reps
thirty five and then if you want to be accurate for the date time we'd basically combine these two.
So we would have 1983 dash 11 dash 11 space and the same time OK.
So that's kind of annoying to type.
You're usually not doing things like this to be honest but just make sure you don't have any typos.
Not missing any quotes.
We'll see and see oh boy did you have a problem.
And this is a silly one.
We're missing the values keyword.
Hopefully you caught that before me.
OK.
So I'm just going to recall that and just change some information so we have two people in there.
So we had Padna Let's put Larry who was born in 1943
and on December 25th on Christmas
Pat
stew for
10.
Forty two.
And then I'll just copy this.
You don't have to retype the whole thing.
I apologize.
It's a little bit painful to sit through.
We're not doing much but we need some data to work with.
OK.
So that should be sufficient now.
Just make sure that matches up.
All right so now we do a select star from people to people in there.
And then we're storing birth day information three different ways although they're not equivalent of
course because we have just the date just the time and then the date and time together.
So now that we have this data in there we're going to focus for a couple of videos pretty short videos
on how we can work with this data.
There are some functions that come with my as well.
And we've seen a bunch of them but there some that work with dates and date times and times and we're
going to focus on those to do things like format our data nicely.
So how do we format dates.
How do we get the day of the week based when based off of someone's day that we're born.
Things like that and how do we print out a nice version.
This is all a bit ugly.
And then also how do we do math with dates.
No we're not going to do any heavy duty math but things like calculating how many years it's been from
1943 to now or how many days since pediment was born.
Those sort of things.
And we'll be able to do that now because we have this data in here.
So thanks for sitting through that.
I know it's probably a bit painful.