user
Write a script to delete all the users who have not been active for the past 3 months


assistant
The following script is designed to delete all users who have not been active within the past three months:

# Get list of all users
SELECT * FROM `users`

# Iterate through list
FOR user IN users:
    # Get list of all user's recent activity 
    SELECT * FROM `activity` WHERE `user_id` = user.id
    IF activity.timestamp > (3 months ago):
        user.delete()