-- name: GetFullLearningTree :many
SELECT
    c.id AS course_id,
    c.title AS course_title,
    sc.id AS sub_course_id,
    sc.title AS sub_course_title,
    sc.level AS sub_course_level
FROM courses c
LEFT JOIN sub_courses sc ON sc.course_id = c.id AND sc.is_active = true
WHERE c.is_active = true
ORDER BY c.id, sc.display_order, sc.id;
