So now that we've seen how to use source we're going to take advantage of it to get some sample data
going for the next couple of videos and exercises.
Cats are kind of boring.
They're pretty simple at this point.
Name and age and breed and we need some more complicated data.
And that's a little something that's a little more real world.
So we're still not working with you know something straight out of a production app because we haven't
seen some of the features that we need to know for that to work.
So it's still kind of simplified data but what we're working with is books data.
So this is what we have.
I've given you this file so you can find it in the file section or if the downloadable section of this
video.
Basically there's two parts for creating a Books table.
And I'll go over that in just a second.
And then after that table is created there is a bunch of values that I'd like for you to insert and
I didn't want you to have to type these all at once but I want us to all have the same data so we can
be on the same page when we run exercises.
So all of this data is actually real data about books from Amazon.
And basically it has every book has a book ID so that should not be new.
There's a title to our.
Then we have an author first name and author last name.
So if we look at one Here's the namesake.
That's the title The author first name is Juba and her last name is Lahiri.
Then we have the released year.
So what year was it released.
And this is an example where we're using kind of the I don't wanna say dumbed down but simplified version
of data because typically you would probably store a date an actual date not just a number like 2003.
So we'll see how to do that when we talk about dates.
But for now we just have 2003 and then the next thing is stock quantity.
And this is just an arbitrary number I picked.
The idea here is that we have a fictional bookshop and we're keeping track of all the books and how
many we have in stock.
So for the name sake we have 32 copies in stock for a hologram for the king we have 154 copies in stock.
Then the final thing is the pages how many pages are in that book so you can see some books are really
long like the Amazing Adventures of Kavalier and Clay has 634 pages and some are much shorter like what
we talked about when we talk about love by Raymond Carver.
Really good short stories if you like short stories.
176 pages.
So a note about these books.
I started off by just picking off the best sellers on Amazon.
As of writing today so I think that's where this one Norse mythology final game came from but I then
just decided to create a variety of years and page numbers.
Some of my favorite authors.
It's a whole mix of things.
So it is real world in a sense but it's also sort of I plan certain things to work a certain way so
we have certain you know we have some really long titles and some short titles.
We have some really long books and short books we have some books from the 2000s and some from the 9900
and so on.
Basically I wanted a variety of things that we could practice with.
So go ahead create a file in cloud nine and put all of this in there.
Now if you want to type it go ahead.
But I would recommend that you don't just say that you don't accidently mess something up.
We want our data to be consistent.
So go ahead copy it make a new file and then we need to execute that file.
And I want to make a new database right now if we do select database.
We're working with cat app I want to create a database and we'll call it bookshop and then use bookshop
and we should have a blank slate.
If we do show tables there should be nothing here.
Perfect.
So what you want to do is make sure this file has been saved and then we just execute it.
So it's a pretty straightforward source.
And then you need to make sure you either are referencing the correct path.
So in my case I'm running my CFI and my root directory.
So all I have to do is book data as well whatever you call it.
You don't need to refer to.
I recommend just putting in the main directory for now but we could you know you could have a separate
folder if you wanted to.
And you just need to refer to it correctly anyways.
Source Book data as well.
And here we go.
All right.
First thing we get this message and that tells us the create table worked and then we get 16 rows affected.
And that tells us the Insearch statement worked.
So let's just verify those do describe books.
Here we go.
Here's all that we created in that table.
And let's just do a simple select start from books and you can see it's pretty messy.
And that's still a bit.
We're going to work on ways.
We're going to see ways of refining this and making things shorter.
Collapsing data and so on.
So that's all we're doing in this video just getting set up now that we have it in there and our database
will be able to work with it and be on the same page.
Awesome.