import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import sqlite3

con = sqlite3.connect('../input/database.sqlite')
cursor = con.cursor()
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")

def load(what='NationalNames'):
    assert what in ('NationalNames', 'StateNames')
    cols = ['Name', 'Year', 'Gender', 'Count']
    if what == 'StateNames':
        cols.append('State')
    df = pd.read_sql_query('SELECT {} from {}'.format(','.join(cols), what), con)
    return df

df = load(what='NationalNames')

df.query('Name=="Alice"')[['Year', 'Count']].groupby('Year').sum().plot()