JSON/q

A JSON-based data access specification

Query

{
  "as": "c", 
  "from": "Customers", 
  "select": {
    "customerId": "c.customerId", 
    "orderCount": "count(c.orders)"
  }
}

Results

[
  {
    "customerId": "ALFKI", 
    "orderCount": 6
  }, 
  {
    "customerId": "ANATR", 
    "orderCount": 4
  }, 
  {
    "customerId": "ANTON", 
    "orderCount": 7
  }, 
  {
    "customerId": "AROUT", 
    "orderCount": 13
  }, 
  {
    "customerId": "BERGS", 
    "orderCount": 18
  }, 
  {
    "customerId": "BLAUS", 
    "orderCount": 7
  }, 
  {
    "customerId": "BLONP", 
    "orderCount": 11
  }, 
  {
    "customerId": "BOLID", 
    "orderCount": 3
  }, 
  {
    "customerId": "BONAP", 
    "orderCount": 17
  }, 
  {
    "customerId": "BOTTM", 
    "orderCount": 14
  }, 
  {
    "customerId": "BSBEV", 
    "orderCount": 10
  }, 
  {
    "customerId": "CACTU", 
    "orderCount": 6
  }, 
  {
    "customerId": "CENTC", 
    "orderCount": 1
  }, 
  {
    "customerId": "CHOPS", 
    "orderCount": 8
  }, 
  {
    "customerId": "COMMI", 
    "orderCount": 5
  }, 
  {
    "customerId": "CONSH", 
    "orderCount": 3
  }, 
  {
    "customerId": "DRACD", 
    "orderCount": 6
  }, 
  {
    "customerId": "DUMON", 
    "orderCount": 4
  }, 
  {
    "customerId": "EASTC", 
    "orderCount": 8
  }, 
  {
    "customerId": "ERNSH", 
    "orderCount": 30
  }, 
  {
    "customerId": "FAMIA", 
    "orderCount": 7
  }, 
  {
    "customerId": "FISSA", 
    "orderCount": 0
  }, 
  {
    "customerId": "FOLIG", 
    "orderCount": 5
  }, 
  {
    "customerId": "FOLKO", 
    "orderCount": 19
  }, 
  {
    "customerId": "FRANK", 
    "orderCount": 15
  }, 
  {
    "customerId": "FRANR", 
    "orderCount": 3
  }, 
  {
    "customerId": "FRANS", 
    "orderCount": 6
  }, 
  {
    "customerId": "FURIB", 
    "orderCount": 8
  }, 
  {
    "customerId": "GALED", 
    "orderCount": 5
  }, 
  {
    "customerId": "GODOS", 
    "orderCount": 10
  }, 
  {
    "customerId": "GOURL", 
    "orderCount": 9
  }, 
  {
    "customerId": "GREAL", 
    "orderCount": 11
  }, 
  {
    "customerId": "GROSR", 
    "orderCount": 2
  }, 
  {
    "customerId": "HANAR", 
    "orderCount": 14
  }, 
  {
    "customerId": "HILAA", 
    "orderCount": 18
  }, 
  {
    "customerId": "HUNGC", 
    "orderCount": 5
  }, 
  {
    "customerId": "HUNGO", 
    "orderCount": 19
  }, 
  {
    "customerId": "ISLAT", 
    "orderCount": 10
  }, 
  {
    "customerId": "KOENE", 
    "orderCount": 14
  }, 
  {
    "customerId": "LACOR", 
    "orderCount": 4
  }, 
  {
    "customerId": "LAMAI", 
    "orderCount": 14
  }, 
  {
    "customerId": "LAUGB", 
    "orderCount": 3
  }, 
  {
    "customerId": "LAZYK", 
    "orderCount": 2
  }, 
  {
    "customerId": "LEHMS", 
    "orderCount": 15
  }, 
  {
    "customerId": "LETSS", 
    "orderCount": 4
  }, 
  {
    "customerId": "LILAS", 
    "orderCount": 14
  }, 
  {
    "customerId": "LINOD", 
    "orderCount": 12
  }, 
  {
    "customerId": "LONEP", 
    "orderCount": 8
  }, 
  {
    "customerId": "MAGAA", 
    "orderCount": 10
  }, 
  {
    "customerId": "MAISD", 
    "orderCount": 7
  }, 
  {
    "customerId": "MEREP", 
    "orderCount": 13
  }, 
  {
    "customerId": "MORGK", 
    "orderCount": 5
  }, 
  {
    "customerId": "NORTS", 
    "orderCount": 3
  }, 
  {
    "customerId": "OCEAN", 
    "orderCount": 5
  }, 
  {
    "customerId": "OLDWO", 
    "orderCount": 10
  }, 
  {
    "customerId": "OTTIK", 
    "orderCount": 9
  }, 
  {
    "customerId": "PARIS", 
    "orderCount": 0
  }, 
  {
    "customerId": "PERIC", 
    "orderCount": 6
  }, 
  {
    "customerId": "PICCO", 
    "orderCount": 10
  }, 
  {
    "customerId": "PRINI", 
    "orderCount": 6
  }, 
  {
    "customerId": "QUEDE", 
    "orderCount": 9
  }, 
  {
    "customerId": "QUEEN", 
    "orderCount": 13
  }, 
  {
    "customerId": "QUICK", 
    "orderCount": 28
  }, 
  {
    "customerId": "RANCH", 
    "orderCount": 5
  }, 
  {
    "customerId": "RATTC", 
    "orderCount": 18
  }, 
  {
    "customerId": "REGGC", 
    "orderCount": 12
  }, 
  {
    "customerId": "RICAR", 
    "orderCount": 11
  }, 
  {
    "customerId": "RICSU", 
    "orderCount": 10
  }, 
  {
    "customerId": "ROMEY", 
    "orderCount": 5
  }, 
  {
    "customerId": "SANTG", 
    "orderCount": 6
  }, 
  {
    "customerId": "SAVEA", 
    "orderCount": 31
  }, 
  {
    "customerId": "SEVES", 
    "orderCount": 9
  }, 
  {
    "customerId": "SIMOB", 
    "orderCount": 7
  }, 
  {
    "customerId": "SPECD", 
    "orderCount": 4
  }, 
  {
    "customerId": "SPLIR", 
    "orderCount": 9
  }, 
  {
    "customerId": "SUPRD", 
    "orderCount": 12
  }, 
  {
    "customerId": "THEBI", 
    "orderCount": 4
  }, 
  {
    "customerId": "THECR", 
    "orderCount": 3
  }, 
  {
    "customerId": "TOMSP", 
    "orderCount": 5
  }, 
  {
    "customerId": "TORTU", 
    "orderCount": 10
  }, 
  {
    "customerId": "TRADH", 
    "orderCount": 7
  }, 
  {
    "customerId": "TRAIH", 
    "orderCount": 3
  }, 
  {
    "customerId": "VAFFE", 
    "orderCount": 11
  }, 
  {
    "customerId": "VICTE", 
    "orderCount": 10
  }, 
  {
    "customerId": "VINET", 
    "orderCount": 4
  }, 
  {
    "customerId": "WANDK", 
    "orderCount": 10
  }, 
  {
    "customerId": "WARTH", 
    "orderCount": 15
  }, 
  {
    "customerId": "WELLI", 
    "orderCount": 9
  }, 
  {
    "customerId": "WHITC", 
    "orderCount": 14
  }, 
  {
    "customerId": "WILMK", 
    "orderCount": 8
  }, 
  {
    "customerId": "WOLZA", 
    "orderCount": 7
  }
]