input: def fetch_data_from_sql_as_json():
      """Develop an API in Python that fetches data from an SQL database and presents the data in the form of JSON.
      Example:
      When the API endpoint is accessed with a GET request, it should return a JSON response containing all the rows from the 'users' table.
      Assuming the 'users' table contains rows with columns 'id', 'name', and 'age', the output might look like:
      [
          {"id": 1, "name": "John Doe", "age": 28},
          {"id": 2, "name": "Jane Smith", "age": 34}
      ]
      """
output:     
      import sqlite3
      import json
  
      def fetch_data_from_sql_as_json():
          # Connect to the SQLite database (or create it)
          conn = sqlite3.connect('example.db')
          cursor = conn.cursor()
  
          # Execute a query to fetch all rows from the 'users' table
          cursor.execute("SELECT * FROM users")
          rows = cursor.fetchall()
  
          # Get the column names
          columns = [description[0] for description in cursor.description]
  
          # Convert the rows to a list of dictionaries
          result = []
          for row in rows:
              result.append(dict(zip(columns, row)))
  
          # Close the connection
          conn.close()
  
          # Return the result as a JSON string
          return json.dumps(result)
  