<jupyter_start><jupyter_text>Exercise 03.04 | Exporting to SQLite3We continue to use our internet users dataset (from exercises 2 and 3).Somehow, the data ended up as HDF5 (the key is "iu"), but we would like to prepare the data for a web application, which will require the data as an relational database. We convinced the web team to start with sqlite3.You task:* Read the HDF5 into a DataFrame (key: "iu").* Export the DataFrame as sqlite database.The web team requires the following database schema:```CREATE TABLE internet_users (        "index" BIGINT,         "Country" TEXT,         "Population" BIGINT,         "Internet users" BIGINT,         "Ratio" FLOAT);```---- DiscussionImport Pandas and load the HDF5 file.<jupyter_code>import pandas as pd
df = pd.read_hdf("mdf.h5", key="iu")
df.to_sql("internet_users", "sqlite:///mdf.db", if_exists="replace")<jupyter_output><empty_output><jupyter_text>We can verify the schema.<jupyter_code>!sqlite3 mdf.db .schema<jupyter_output>CREATE TABLE internet_users (
	"index" BIGINT, 
	"Country" TEXT, 
	"Population" BIGINT, 
	"Internet users" BIGINT, 
	"Ratio" FLOAT
);
CREATE INDEX ix_internet_users_index ON internet_users ("index");
{'fraction_non_alphanumeric': 0.10336134453781512, 'fraction_numerical': 0.010924369747899159, 'mean_word_length': 4.565420560747664, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '465456', 'license': 'MIT', 'n_tokens_mistral': 395, 'n_tokens_neox': 369, 'n_words': 133, 'path': 'Chapter03/Exercise03.04/Exercise03.04.ipynb', 'repo_name': 'miku/The-Pandas-Workshop', 'size': '1190'}