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

single

bookChallenge: Project Task Dependency Resolution

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 5
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt