I'm having a lot of issues writing this query. Can someone please advise!
Select all from bookings table where
bookings.product_id = product.id
then based on the return, i want to say if a field in the returned results (created_at) is greater than "7" then return 1 otherwise return 0.