Recursive query in tree MySQL8 / MariaDB10

I have a tree-like structure for categories on my database: create table cat( id int auto_increment primary key, url varchar(50), parent int references cat(id) ) How can i build the …

Calculate the time taken by a recursive function each time it is called… in SQL

I have the data like below id | Function_name | event | time 1 function_a start 12:01 2 function_a start 12:02 3 function_a start 12:03 4 function_a end 12:04 …

detect cycles in a graph in SQL using recursive common table expression

Given a directed graph having a cycle, how do you detect and list the cycle using only standard SQL ? input = graph edges and a root node from which we compute the transitive closure. Output = …

Use SQL Server recursive common table expression to get full path of all files in a folder(with subfolders)

There is a SQL Server undocumented extended stored procedure called xp_dirtree, which can return all files and folders name (include subfolders) in a table format. To practice my understanding of …