<jupyter_start><jupyter_text>Bonus (Optional)As you examine the data, you are overcome with a creeping suspicion that the dataset is fake. You surmise that your boss handed you spurious data in order to test the data engineering skills of a new employee. To confirm your hunch, you decide to take the following steps to generate a visualization of the data, with which you will confront your boss:1. Import the SQL database into Pandas. (Yes, you could read the CSVs directly in Pandas, but you are, after all, trying to prove your technical mettle.) This step may require some research. Feel free to use the code below to get started. Be sure to make any necessary modifications for your username, password, host, port, and database name:   ```sql   from sqlalchemy import create_engine   engine = create_engine('postgresql://localhost:5432/')   connection = engine.connect()   ```* Consult [SQLAlchemy documentation](https://docs.sqlalchemy.org/en/latest/core/engines.htmlpostgresql) for more information.* If using a password, do not upload your password to your GitHub repository. See [https://www.youtube.com/watch?v=2uaTPmNvH0I](https://www.youtube.com/watch?v=2uaTPmNvH0I) and [https://martin-thoma.com/configuration-files-in-python/](https://martin-thoma.com/configuration-files-in-python/) for more information.2. Create a histogram to visualize the most common salary ranges for employees.3. Create a bar chart of average salary by title.<jupyter_code>import pandas as pd
# Dependencies
# ----------------------------------
# Imports the method used for connecting to DBs
from sqlalchemy import create_engine, Column, Integer, String, Float 

# Imports the methods needed to abstract classes into tables
from sqlalchemy.ext.declarative import declarative_base
import matplotlib.pyplot as plt
from config import key
engine = create_engine(f"postgresql://postgres:{key}@localhost:5432/SQL_Challenge")
connection = engine.connect()

salaries = engine.execute("SELECT t.title, s.salary FROM titles AS t JOIN salaries AS s ON s.emp_no=t.emp_no")

df = pd.DataFrame(salaries, columns=["title", "salary"])
avg_salary= df.groupby("title").mean()
avg_salary.style.format("${:.2f}")
avg_salary.plot.bar()
plt.title("Average Salary by Job Title")
plt.xlabel("Job Title")
plt.ylabel("Annual Salary in Dollars")
plt.ylim(35000,60000)
plt.show()<jupyter_output><empty_output><jupyter_text>EpilogueEvidence in hand, you march into your boss's office and present the visualization. With a sly grin, your boss thanks you for your work. On your way out of the office, you hear the words, "Search your ID number." You look down at your badge to see that your employee ID number is 499942.<jupyter_code>epilog = engine.execute("SELECT emp_no, first_name,last_name FROM employees where emp_no = 499942 ")
epilog_df = pd.DataFrame(epilog, columns=["Emp_Num","first_name","last_name"])

#select * from employees where emp_no = 499942
#select * from salaries where emp_no = 499942
epilog_df<jupyter_output><empty_output><jupyter_text>Submission* Create an image file of your ERD.* Create a `.sql` file of your table schemata.* Create a `.sql` file of your queries.* (Optional) Create a Jupyter Notebook of the bonus analysis.* Create and upload a repository with the above files to GitHub and post a link on BootCamp Spot.<jupyter_code>connection.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09940652818991098, 'fraction_numerical': 0.01483679525222552, 'mean_word_length': 5.162705667276051, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '380122', 'license': 'ADSL', 'n_tokens_mistral': 1022, 'n_tokens_neox': 962, 'n_words': 384, 'path': '.ipynb_checkpoints/Bonus-checkpoint.ipynb', 'repo_name': 'zelson71/sql-challenge', 'size': '3370'}