Test your knowledge
We've learned how to retrieve and store data in Python, and it's a good idea to practice what you learned to lock in the knowledge. In the GitHub repository for this book, the Chapter 3 folder contains a folder called test_your_knowledge
. Create a Jupyter notebook in this folder, and complete the following:
- Load the
bitcoin_price.json
data file by opening the file using the built-injson
module. - Save this data to a SQLite database.
- Query the database using
sqlite3
for the following:- The earliest and latest dates (hint: the
MAX
andMIN
aggregate functions will help) - The maximum price for each year (grouped by year) and sorted by year
- The earliest and latest dates (hint: the
- Connect to the
chinook.db sqlite3
database with SQLAlchemy. - Find the genre names with the longest average song length. (Hint: join the tables with the genre name and song length and use the SQLite aggregate function for the average along with a
GROUP BY...