Design a Python application that interacts with a Cassandra database to store and retrieve user information such as name, email, and phone number.
PLAINFORMAT
from cassandra.cluster import Cluster
from cassandra.query import SimpleStatement
from cassandra.auth import PlainTextAuthProvider
import uuid

# Set up a connection to the Cassandra cluster
auth_provider = PlainTextAuthProvider(username='cassandra', password='cassandra')
cluster = Cluster(['127.0.0.1'], auth_provider=auth_provider)
session = cluster.connect()

# Create a keyspace and table for storing user information
keyspace = "user_data"
table = "users"

session.execute(f"CREATE KEYSPACE IF NOT EXISTS {keyspace} WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': 1}}")
session.set_keyspace(keyspace)

session.execute(f"""
    CREATE TABLE IF NOT EXISTS {table} (
        id UUID PRIMARY KEY,
        name TEXT,
        email TEXT,
        phone TEXT
    )
""")

# Define functions to insert, retrieve, and delete user data
def insert_user(name, email, phone):
    user_id = uuid.uuid4()
    query = f"INSERT INTO {table} (id, name, email, phone) VALUES (%s, %s, %s, %s)"
    session.execute(query, (user_id, name, email, phone))
    return user_id

def get_user(user_id):
    query = f"SELECT * FROM {table} WHERE id=%s"
    result = session.execute(query, (user_id,))
    return result.one()

def delete_user(user_id):
    query = f"DELETE FROM {table} WHERE id=%s"
    session.execute(query, (user_id,))

# Example usage
user_id = insert_user("John Doe", "john.doe@example.com", "+1234567890")
print(f"Inserted user with ID: {user_id}")

user_data = get_user(user_id)
print(f"Retrieved user data: {user_data}")

delete_user(user_id)
print(f"Deleted user with ID: {user_id}")