input: Write a python function to create a table in a SQLite database and insert weather forecast data from an API response.
  assert len(retrieve_forecasts()) == 48  # Assuming the API always provides 48 hourly forecasts
  assert retrieve_forecasts()[0]['temperature'] is not None  # Check that the first forecast entry has a temperature value
  assert retrieve_forecasts()[-1]['humidity'] is not None  # Check that the last forecast entry has a humidity value
output: import sqlite3
  import requests
  
  def create_weather_table():
      conn = sqlite3.connect('weather.db')
      c = conn.cursor()
      c.execute('''
          CREATE TABLE IF NOT EXISTS weather (
              id INTEGER PRIMARY KEY,
              time TEXT,
              temperature REAL,
              humidity REAL
          )
      ''')
      conn.commit()
      conn.close()
  
  def insert_weather_data(data):
      conn = sqlite3.connect('weather.db')
      c = conn.cursor()
      c.executemany('''
          INSERT INTO weather (time, temperature, humidity) 
          VALUES (:time, :temperature, :humidity)
      ''', data)
      conn.commit()
      conn.close()
  
  def retrieve_forecasts():
      API_URL = "https://api.weather.com/v3/wx/forecast/hourly/48hour"
      API_KEY = "your_api_key"
      response = requests.get(API_URL, params={'apiKey': API_KEY, 'format': 'json'})
      forecasts = response.json()
      
      formatted_data = []
      for forecast in forecasts['hourlyForecasts']:
          formatted_data.append({
              'time': forecast['validTime'],
              'temperature': forecast['temperature'],
              'humidity': forecast['humidity']
          })
      
      create_weather_table()
      insert_weather_data(formatted_data)
      
      return formatted_data