WITH active_users AS (
SELECT DISTINCT user_id AS id
FROM Reservations
UNION
SELECT DISTINCT owner_id
FROM Rooms
JOIN Reservations
ON Reservations.room_id = Rooms.id
)
SELECT
ROUND(100.0 * COUNT(id) / (
SELECT COUNT(id) FROM Users
), 2) AS percent
FROM active_users;
https://sql-academy.org/ru/trainer/tasks/71