{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 4 - SQLite" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1 Add the necessary libraries for SQLite3 and make a database named `test.db`." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "2 Create a connection to the database." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "3 Make the following table in the database, named `people`:\n", " \n", "| name | age | shoe_size |\n", "| ------------- |-------------| -----|\n", "| Prank | 88 | 47 |\n", "| Matt | 34 | 39 |\n", "| Ilona | 41 | 36 |\n", "| Sonja | 32 | 37 |\n", "\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "4 When the Table has been created, convert the table to the Pandas DataFrame object and add the column `hat_size' to it, then fill that column with the values ​​you choose." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "5 Make a copy of the DataFrame object with the name `person_table_copy` and add a row to it with the values ​you choose. Now save this modified dataframe object in the database as `person_table_copy` (will be created next to the previous table)." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "6 Finally, save the database changes and close the connection." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "#" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }