input: Write a function to create a Flask application that submits form data containing name, email, and phone number and stores it in a SQLite database. If the form submission is successful, it should redirect to the home page. The function should return the Flask application.
  assert create_flask_app().route('/submit', methods=['POST'])(lambda: None).status == '200 OK'
  assert create_flask_app().route('/')(lambda: None).status == '200 OK'
  assert 'data.db' in [file.name for file in os.scandir('.')] == True
  assert sqlite3.connect('data.db').cursor().execute("SELECT name FROM sqlite_master WHERE type='table';").fetchone()[0] == 'data'
  assert len(sqlite3.connect('data.db').cursor().execute("SELECT * FROM data;").fetchall()) == 0
output: 
  def create_flask_app():
      from flask import Flask, request, redirect
      import sqlite3
  
      app = Flask(__name__)
  
      def create_table():
          conn = sqlite3.connect('data.db')
          c = conn.cursor()
          c.execute('''CREATE TABLE IF NOT EXISTS data
                       (name TEXT, email TEXT, phone TEXT)''')
          conn.commit()
          conn.close()
  
      create_table()
  
      @app.route('/')
      def home():
          return "Home Page"
  
      @app.route('/submit', methods=['POST'])
      def submit():
          name = request.form['name']
          email = request.form['email']
          phone = request.form['phone']
          
          conn = sqlite3.connect('data.db')
          c = conn.cursor()
          c.execute("INSERT INTO data (name, email, phone) VALUES (?, ?, ?)", (name, email, phone))
          conn.commit()
          conn.close()
          
          return redirect('/')
  
      return app
  