input: Write a python function to calculate the sum of all elements in a DataFrame using a SQL query.
  assert sum_dataframe_elements(pd.DataFrame([[1, 2], [3, 4], [5, 6]])) == 21
  assert sum_dataframe_elements(pd.DataFrame([[10, 20], [30, 40], [50, 60]])) == 210
  assert sum_dataframe_elements(pd.DataFrame([[7, 8], [9, 10]])) == 34
output: import pandas as pd
  import sqlite3
  
  def sum_dataframe_elements(df):
      conn = sqlite3.connect(':memory:')
      df.to_sql('data', conn, index=False, if_exists='replace')
      query = "SELECT SUM({}) FROM data".format("+".join(df.columns))
      result = pd.read_sql_query(query, conn)
      return result.iloc[0, 0]