def register_sql(spark, files, schema=None, sep=None, table_name="table", return_count=False):
    """
    Register a list of files as a SQL temporary view.

    parameters:
    - files is overloaded: can be one file path or list of file paths.
    - spark: pyspark.sql.SparkSession
    - table_name: this is how we will refer to table in SQL query
    Schema of files must be the same for the table

    Example usage after registering table:
    >> DF = spark.sql("SELECT * FROM table")
    """
    tempFiles = spark.read.csv(files, schema=schema, sep=sep, header=True)
    tempFiles.createOrReplaceTempView(table_name)
    if return_count:
        return spark.sql("SELECT * FROM {}".format(table_name)).count()