input: Write a python function to delete user preferences from the database.
  assert deleteUserPreferences(1) == True
  assert deleteUserPreferences(2) == False
output: def deleteUserPreferences(user_id):
      # Assuming we have a database connection and a cursor object
      connection = get_database_connection()
      cursor = connection.cursor()
      
      try:
          # Execute the delete query
          cursor.execute("DELETE FROM user_preferences WHERE user_id = %s", (user_id,))
          
          # Check if the row was deleted
          if cursor.rowcount > 0:
              connection.commit()
              return True
          else:
              return False
      except Exception as e:
          # Handle exceptions (log them, rethrow them, etc.)
          print(f"An error occurred: {e}")
          return False
      finally:
          cursor.close()
          connection.close()