Hackerrank SQL - Aggregation

  01 Dec 2019
   tsql

Following problems are discussed here. To solve the same, please visit hackerrank website.


Weather Observation Station 17

select cast(Long_w as decimal(9,4)) from station where lat_n = (select min(Lat_n)  from station where Lat_n  > 38.7780) 


  Hackerrank SQL - Advanced Select

  01 Dec 2019
   tsql

Following problems are discussed here. To solve the same, please visit hackerrank website.


New Companies

select 
company.company_code,
company.founder,
count(distinct lead_manager.lead_manager_code),
count(distinct senior_manager.senior_manager_code), 
count(distinct manager.manager_code),
count(distinct employee.employee_code)
from company
left join 
    lead_manager on company.company_code = lead_manager.company_code
left join 
    senior_manager on company.company_code = senior_manager.company_code and
    lead_manager.lead_manager_code = senior_manager.lead_manager_code
left join 
    manager on company.company_code = manager.company_code and
    lead_manager.lead_manager_code = manager.lead_manager_code and 
    senior_manager.senior_manager_code = manager.senior_manager_code
left join 
    employee on company.company_code = employee.company_code and
    lead_manager.lead_manager_code = employee.lead_manager_code and 
    senior_manager.senior_manager_code = employee.senior_manager_code and 
    manager.manager_code = employee.manager_code
group by company.company_code, company.founder
order by company.company_code


  List, Create and Move Folder within Azure Datalake Store Gen1 using R and Rest API

  15 Sep 2019
   azure, r

The following code snippets are on creating a connection to Azure Data Lake Storage Gen1 using R with Service-to-Service authentication with client secret and client id using REST API to list, create and move any folder in a azure data lake store gen1.

  • LISTSTATUS - To list everything in a folder
  • MKDIRS - To create new folder
  • RENAME - To move a folder to new location