And we finally hit the end of the section where we have an exercise.
So it's time to get some practice working with the different data types we've covered.
And this exercise involves a couple of free response questions, I guess you would call it.
The first one is what is a good use case for CHA or car?
Just make one up.
You don't have to write any code.
Just what is it?
Good use case.
Why would you use one over of cha cha then fill in the blanks.
What would the types be that are appropriate for this table we're making?
It's called inventory.
We have an item name.
You don't really have to worry about the length of each of these, but you know, item name, it's going
to be text.
What type of text price here is always going to be less than $1 million and it will only ever have two
decimals.
So what data type makes sense there?
And then quantity.
Let's say we can only have a whole number of an item after that Explain out loud or in your head what's
the difference between date, time and time stamp?
How are they similar?
How are they different?
Then a little bit of code.
Write a select statement to print out the current time.
Just the time.
And then do the same thing, but to print out the current date without the time.
So just the date.
After that, you'll have to print out the current day of the week as a number.
So we saw how to do this.
You'll have to use something to get the current time or the current day rather, and then you'll have
to pass that through to something that will give you the day of the week and then do the same thing,
but get the name of the day, the day name.
So whatever day it is that you're running this on, it should say Monday or Saturday or Friday.
Then print out the current current date and time using this format.
So I want there to be slashes there.
I want it to be two digits of the month, slash two days slash all four digits of the year.
So you'll need to format it using some special stuff that we covered and then do that again.
But this time, print out the current date in time using this format where we have the full month name
and then the what is it called where you get the suffix first, second, third, 27th, and then at
and then the time here.
So hours, colon minutes.
And I didn't specify if this is 12 hour or 24 hour time, so let's just say 24 hour time.
And then finally create a new table called tweets.
It's a simple table.
It has something to store the tweet content.
And let's say I think a tweet has to be 180 characters or fewer.
I don't remember.
I know it changed.
It used to be hundred and 40, I think I'm not on Twitter, but make it some number.
Let's call it 180 of characters and then a username and then the time the tweet was created.
And I want this to automatically be filled in by my SQL.
So use one of those defaults that we learned about.
Okay.
So once you finish that, you can pat yourself on the back.
This has been a bit of a slog of this section.
I know.
I mean, there's a reason we didn't cover all these data types upfront when I was just I just wanted
to make sure I didn't lose anybody at the beginning.
We got to just have the basics select, insert, update, create table.
So I just showed the very basics of int and var char.
But as we saw in this section, there's a lot more data types and it can be a little tedious to cover
them all.
Anyway, get some practice, do this exercise and I'll be back with a solution.