Here's an example of a function that censors curse words in a given string using a database table called CURSE_WORDS_TABLE and a column called WORD.

```python
import sqlite3

def censor_words(input_string):
    # Connect to the database file
    conn = sqlite3.connect('mydatabase.db')
    cursor = conn.cursor()

    # Select all words from the curse words table
    cursor.execute("SELECT WORD FROM CURSE_WORDS_TABLE;")
    curse_words = cursor.fetchall()

    # Replace each curse word in the input string with asterisks
    for word in curse_words:
        input_string = input_string.replace(word[0], '*' * len(word[0]))

    # Close the database connection
    cursor.close()
    conn.close()

    # Return the censored input string
    return input_string
```

The function first connects to a database file (assumed to be named `mydatabase.db`). It then selects all rows from the CURSE_WORDS_TABLE and stores them in a variable called `curse_words`. 

Then it iterates through each curse word and replaces it with asterisks using Python's built-in `replace` method.

Finally, it closes the database connection and returns the censored input string.
Scrivi una funzione che censuri le parolacce all'interno di una stringa. Prende quelle parolacce da un database SQL. La tabella delle parolacce si chiama CURSE_WORDS_TABLE. La colonna delle parolacce si chiama WORD.