input: import sqlite3
  
  def query_database(db_name: str, table_name: str, category: str) -> list:
      """
      Executes a SELECT query on the specified database and table with a given category.
      Returns a list of rows that match the query.
  
      >>> query_database('movies.db', 'Movies', 'horror')
      [('Shutter Island', 'horror', 2010), ('Hereditary', 'horror', 2018)]
      """
  
      conn = sqlite3.connect(db_name) 
      cursor = conn.cursor()
  
      cursor.execute(f"SELECT * FROM {table_name} WHERE category = '{category}'")
  
      result = cursor.fetchall()
      conn.close()
      
      return result
output:     conn = sqlite3.connect(db_name) 
      cursor = conn.cursor()
  
      cursor.execute(f"SELECT * FROM {table_name} WHERE category = '{category}'")
  
      result = cursor.fetchall()
      conn.close()
      
      return result