How to retrieve the folder level role using a SQL Query in the Orchestrator database?

How to retrieve the folder-level role using a SQL query in the Orchestrator database?

Execute the below query:

select roleID,UserOrganizationUnits.TenantId, userID,Roles.Name from dbo.UserOrganizationUnits inner join Roles on UserOrganizationUnits.RoleId=Roles.Id where Roles.Type=2 and UserOrganizationUnits.IsDeleted=0 

Output looks like below: