CREATE VIEW orchestration_session_script AS
SELECT
os.orchestration_session_id,
onature.nature AS orchestration_nature,
COUNT(*) AS script_count
FROM orchestration_session os
JOIN orchestration_nature onature ON os.orchestration_nature_id = onature.orchestration_nature_id
JOIN orchestration_session_entry ose ON os.orchestration_session_id = ose.session_id
GROUP BY os.orchestration_session_id, onature.nature