input: Write a function to fetch JSON data from an API and save it to a SQLite database.
  assert fetch_and_save_to_db('https://api.example.com/data') == True
  assert fetch_and_save_to_db('https://api.example.com/empty') == False
  assert fetch_and_save_to_db('https://api.example.com/malformed') == False
output: def fetch_and_save_to_db(url):
      import requests
      import sqlite3
      import json
  
      try:
          response = requests.get(url)
          response.raise_for_status()  # Raise an error for bad status codes
          data = response.json()
  
          if not data:  # Check if the data is empty
              return False
  
          # Connect to SQLite database (or create it if it doesn't exist)
          conn = sqlite3.connect('data.db')
          cursor = conn.cursor()
  
          # Create table if it doesn't exist
          cursor.execute('''
              CREATE TABLE IF NOT EXISTS api_data (
                  id INTEGER PRIMARY KEY AUTOINCREMENT,
                  json_data TEXT NOT NULL
              )
          ''')
  
          # Insert JSON data into the table
          cursor.execute('INSERT INTO api_data (json_data) VALUES (?)', (json.dumps(data),))
  
          # Commit the transaction and close the connection
          conn.commit()
          conn.close()
  
          return True
  
      except (requests.exceptions.RequestException, json.JSONDecodeError, sqlite3.DatabaseError):
          return False