input: Write a function to search movies in a SQLite database and return the results as a list of tuples.
  assert search_movies("Inception", "Sci-Fi") == [("Inception", "Sci-Fi")]
  assert search_movies("", "Action") == [("Die Hard", "Action"), ("Mad Max", "Action")]
  assert search_movies("Titanic", "") == [("Titanic", "Romance")]
  assert search_movies("", "") == [("Inception", "Sci-Fi"), ("Die Hard", "Action"), ("Titanic", "Romance"), ("Mad Max", "Action")]
output: def search_movies(title, genre):
      import sqlite3
      conn = sqlite3.connect(':memory:')
      cursor = conn.cursor()
      
      cursor.execute('''CREATE TABLE movies (title TEXT, genre TEXT)''')
      cursor.executemany('''INSERT INTO movies (title, genre) VALUES (?, ?)''', [
          ("Inception", "Sci-Fi"),
          ("Die Hard", "Action"),
          ("Titanic", "Romance"),
          ("Mad Max", "Action")
      ])
      
      query = "SELECT title, genre FROM movies WHERE 1=1"
      params = []
      
      if title:
          query += " AND title = ?"
          params.append(title)
          
      if genre:
          query += " AND genre = ?"
          params.append(genre)
      
      cursor.execute(query, params)
      results = cursor.fetchall()
      
      conn.close()
      return results