Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Project Task Dependency Resolution | Recursive CTEs and Hierarchical Data
/
Mastering Common Table Expressions (CTEs) in SQL
Sección 2. Capítulo 5
single

single

bookChallenge: Project Task Dependency Resolution

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write a recursive CTE that retrieves all tasks (direct and indirect) that must be completed before a specified project task can begin. Use the sample data provided, which contains task dependencies for multiple projects. Your query should return the task IDs and names of all prerequisite tasks for the given task_id.

  • Start the recursion from the immediate dependencies of the specified task_id.
  • In each recursive step, find dependencies of the tasks found in the previous step.
  • Continue until all transitive dependencies are found.
  • Return each prerequisite task's ID and name.
  • The output should include only the prerequisite tasks, not the specified task_id itself.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 5
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt