<jupyter_start><jupyter_text>Resume Working with Data in Python This Notebook is a part of my studies for IBM Certification in Data Science Professional What I learned:- Acessing Data with Python and API's- SQL API COMMANDS- Writing code using DB-API- Creating tables, loading data and querying data with PANDAS- Using SQL magic commands Table of Contents1&nbsp;&nbsp;Acessing Data with Python2&nbsp;&nbsp;Writing code using DB-API3&nbsp;&nbsp;Creating tables, loading data and querying data4&nbsp;&nbsp;SQL magic commands  Acessing Data with Python MAIN API's SQL API COMMANDS  Writing code using DB-API    Creating tables, loading data and querying data   SQL magic commands<jupyter_code>Jupyter notebooks have a concept of Magic commands that can simplify working with Python, 
and are particularly useful for data analysis. Your notebooks can have two types of magic commands:

Cell magics: start with a double %% sign and apply to the entire cell

Line magics: start with a single % (percent) sign and apply to a particular line in a cell

Their usage is of the format:

%magicname arguments

So far in the course you learned to accessed data from a database using the Python DB-API 
(and specifically ibm_db). With this API execution of queries and fetching their results involves 
multiple steps. You can use the SQL Magic commands to execute queries more easily.

For example if you want to execute the a query to select some data from a table and fetch its results, 
you can simply enter a command like the following in your Jupyter notebook cell:

%sql select * from tablename

Although SQL magic simplifies working with databases, it has some limitations. 
For example, unlike DB-API, there are no explicit methods to close a connection and free up resources.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.03777777777777778, 'fraction_numerical': 0.0022222222222222222, 'mean_word_length': 4.847402597402597, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '389527', 'license': 'MIT', 'n_tokens_mistral': 459, 'n_tokens_neox': 441, 'n_words': 269, 'path': 'Working with Data in Python.ipynb', 'repo_name': 'wantor-stack/SQL', 'size': '1800'}