Complete the code to import the pandas library.
import [1] as pd
We use import pandas as pd to work with data tables easily.
Complete the code to create a connection to a SQLite database file named 'data.db'.
import sqlite3 conn = sqlite3.[1]('data.db')
We use sqlite3.connect() to open a connection to the database file.
Fix the error in the code to read a SQL query into a pandas DataFrame.
df = pd.read_sql_query([1], conn)The SQL query must be a string, so it needs quotes around it.
Fill both blanks to create a DataFrame from a SQL table named 'employees' using pandas.
df = pd.read_sql_table([1], [2])
We pass the table name as a string and the connection object to read the table.
Fill all three blanks to read data from a SQL database using SQLAlchemy engine and pandas.
from sqlalchemy import [1] engine = [2]('sqlite:///data.db') df = pd.read_sql([3], engine)
We import create_engine, use it to make an engine, then pass a SQL query string to pd.read_sql.
