🏠 Accueil
Benchmarks
📊 Tous les Benchmarks 🦖 Dinosaure v1 🦖 Dinosaure v2 ✅ To-Do List Apps 🎨 Pages Libres 🎯 FSACB - Showcase 🌍 Traduction
Modèles
🏆 Top 10 Modèles 🆓 Modèles Gratuits 📋 Tous les Modèles ⚙️ Modes Kilo Code
Ressources
💬 Prompts IA 📖 Glossaire IA 🔗 Liens Utiles
advanced

Hierarchical Data Querying

#sql #database #recursion

Construct a complex SQL query using Recursive Common Table Expressions.

Given a standard SQL schema for an employee management system containing an 'employees' table with columns 'id', 'name', and 'manager_id', write a recursive Common Table Expression (CTE) query. The query should return the organizational hierarchy for a specific employee ID, listing all direct and indirect reports in a depth-indented format, along with their total count of subordinates at every level.