Can you write a SQL for this? Given the two tables below user and user history
Question: Write an SQL query that returns the name, phone number and most recent date for any user that has logged in over the last 30 days (you can tell a user has logged in if the action field in User History is set to "logged_on").
Select A. name, A. Phone_number, datediff(day, getdate(), date) as different
From User as A
Inner Join User History as B
ON A. User_id=B.User_id
Where different 1 between 30
Order by date desc;