import sqlite3


def is_slug_used(slug:str) -> bool:
    """
    Returns a boolean value whether the given slug has been used or not.
    """
    conn = sqlite3.connect("./urls.db")
    c = conn.cursor()
    c.execute("CREATE TABLE IF NOT EXISTS urls(original_url text, slug text)")
    c.execute("SELECT (slug) FROM urls")
    used_slugs = {i[0] for i in c.fetchall()}

    return slug in used_slugs