import sqlite3


def initialize_db(db):
    """
    Initializes the database and creates the table if necessary
    :param db: (string) The database to use
    :return:
    """
    conn = sqlite3.connect(db)
    c = conn.cursor()
    c.execute("CREATE TABLE IF NOT EXISTS `Assignments` ( "
              "`GlobalID` TEXT UNIQUE, "
              "PRIMARY KEY(`GlobalID`) )")
    conn.commit()
    return conn