cancel
Showing results for 
Search instead for 
Did you mean: 

PQL Advanced Quiz - Answers

Highlighted

PQL Advanced Quiz - Answers

1. Create a PQL query to show the current date in the format Month/Day/Year

 

   SELECT DatePart(Month, now()) + '/' + DatePart(Day, now()) + '/' + DatePart(Year, now())

 

2. Display the name of all processes running on the current Prognosis node without repetition

 

   SELECT ProcessName FROM NtProcess GROUP BY ProcessName

  

3. Display the busiest Prognosis process in all Prognosis nodes, showing the node name, Prognosis process name without the initial ‘ir’ (example: pqlsrv instead of irpqlsrv), and the busy percentage of the process.

 

   SELECT TOP 1 Meta.Node, substring(ProcessName, 3), BusyPercent

      FROM NtProcess

      WHERE ProcessName MATCHES 'ir*'

      LIMIT 1 BY BusyPercent DESC

      NODE ALL 

      ORDER BY BusyPercent DESC

     

4. Display the busiest, excluding the idle process, and the least busy process in the current Prognosis node, with the busiest process in the first row and the least busy process in the second row. The first how must contain the text ‘Busiest’, followed by the process name and the busy percentage. The second row must contain the word ‘Least Busy’, followed by the process name and busy percent

 

   SELECT 'Busiest', ProcessName, BusyPercent

      FROM NtProcess

      WHERE ProcessName != 'Idle'

      LIMIT 1 BY BusyPercent DESC

   UNION

      SELECT 'Least Busy', ProcessName, BusyPercent

      FROM NtProcess

      WHERE ProcessName != 'Idle'

      LIMIT 1 BY BusyPercent ASC