This page demonstrates how to download and install a sample database — the Sakila sample database.
Why Install a Sample Database?
You can use a sample database to experiment with, without being concerned about accidentally deleting the wrong data or dropping the wrong tables, etc. If this happens, you can always re-install the DB (just run two scripts).
Also, one of the hardest things when developing your skills with databases is finding a database that contains enough data. So far we've used a very small database for our examples. That works fine for simple examples, but it can become quite limiting if you want to try out queries on a larger set of data.
The more complex your queries become, the more they will narrow the data down further. This is a crucial part of SQL programming. If your queries become complex, but you still only have a handful of records in the database, all your queries are going to return zero results!
Furthermore, if you only have two tables in your database, you can't really stretch out with more advanced queries.
This is when you need a larger database.
About the Sakila Sample Database
The Sakila sample database was created for the purposes of tutorials, books, examples, etc. It's also designed to take advantage of the various aspects of MySQL, including any new features.
Download the Sakila Database
First of all, download the Sakila database from the MySQL website.
This will give you two scripts to run (compressed into a Zip or TGZ file).
Install the Sakila Database
You install the database by running the two SQL scripts (one for the DB structure, one for the data).
The Result
Go ahead, use this database to experiment with. Select, delete, drop, create… it doesn't matter — you can always restore the DB at any time using the method above. Just run the two scripts. Simple!
No comments:
Post a Comment
Hey, It's Been Grabbed