as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write a script to delete all the users who have not been active for the past 3 months
user
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()
assistant