This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: Q3 :) | |
<result>{ | |
let $m := map:map() | |
let $build := | |
for $sales in doc("sales-records.xml")/*/record | |
let $state := doc("stores.xml")/*/store[ | |
store-number = $sales/store-number]/state | |
let $product := doc("products.xml")/*/product[ | |
name = $sales/product-name] | |
let $category := $product/category |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: Q8 :) | |
<result>{ | |
let $m := map:map() | |
let $build := | |
for $book in doc("books.xml")/*/book | |
let $author-list := fn:string-join($book/author, ', ') | |
return map:put($m, $author-list, $book) | |
for $author-list in map:keys($m) | |
order by $author-list | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: Q7 :) | |
<result>{ | |
let $m := map:map() | |
let $build := | |
for $book in doc("books.xml")/*/book | |
for $author in $book/author | |
return map:put( | |
$m, $author, (map:get($m, $author), $book)) | |
for $author in map:keys($m) | |
order by $author |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: Q6 :) | |
<result>{ | |
let $m := map:map() | |
let $build := | |
for $sales in doc("sales-records.xml")/*/record | |
let $storeno := $sales/store-number, | |
$product := doc("products.xml")/*/product[ | |
name = $sales/product-name], | |
$prd := $product, | |
$profit := $sales/qty * ($prd/price - $prd/cost) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: Q5 :) | |
<result>{ | |
let $m := map:map() | |
let $build := | |
for $sales in doc("sales-records.xml")/*/record | |
let $storeno := $sales/store-number | |
return map:put($m, $storeno, (map:get($m, $storeno), $sales)) | |
for $storeno in map:keys($m) | |
let $sales := map:get($m, $storeno) | |
order by $storeno |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: Q4 :) | |
<result>{ | |
let $m-state-storenumber := map:map() | |
let $build := | |
for $store in doc("stores.xml")/*/store | |
let $state := $store/state | |
return map:put( | |
$m-state-storenumber, $state, | |
(map:get($m-state-storenumber, $state), $store/store-number)) | |
let $m-category-pname := map:map() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from ip-10-91-9-230 to ip-10-87-117-148 | |
$ sudo traceroute -T -p 22 ip-10-87-117-148 | |
traceroute to ip-10-87-117-148 (10.87.117.148), 30 hops max, 60 byte packets | |
1 ip-10-91-8-2.ec2.internal (10.91.8.2) 0.549 ms 0.551 ms 0.535 ms | |
2 ip-10-1-194-16.ec2.internal (10.1.194.16) 0.522 ms ip-10-1-194-18.ec2.internal (10.1.194.18) 0.370 ms ip-10-1-194-16.ec2.internal (10.1.194.16) 0.467 ms | |
3 ip-10-1-100-7.ec2.internal (10.1.100.7) 0.423 ms ip-10-1-100-75.ec2.internal (10.1.100.75) 0.756 ms ip-10-1-100-1.ec2.internal (10.1.100.1) 0.453 ms | |
4 ip-10-1-120-34.ec2.internal (10.1.120.34) 5.579 ms ip-10-1-104-34.ec2.internal (10.1.104.34) 0.432 ms ip-10-1-102-34.ec2.internal (10.1.102.34) 0.529 ms | |
5 ip-10-87-117-148.ec2.internal (10.87.117.148) 0.560 ms 0.551 ms 0.596 ms | |
# from ip-10-87-117-148 to ip-10-91-9-230 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from ip-10-87-69-9 to ip-10-87-117-148 | |
$ sudo traceroute -T -p 22 ip-10-87-117-148 | |
traceroute to ip-10-87-117-148 (10.87.117.148), 30 hops max, 60 byte packets | |
1 ip-10-87-68-3.ec2.internal (10.87.68.3) 15.294 ms 15.289 ms 15.274 ms | |
2 ip-10-87-117-148.ec2.internal (10.87.117.148) 0.431 ms 0.461 ms 0.433 ms | |
# from ip-10-87-117-148 to ip-10-87-69-9 | |
$ sudo traceroute -T -p 22 ip-10-87-69-9 | |
traceroute to ip-10-87-69-9 (10.87.69.9), 30 hops max, 40 byte packets | |
1 ip-10-87-116-3.ec2.internal (10.87.116.3) 0.500 ms 0.652 ms 0.628 ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let ((x 1) | |
(y (+ x 1))) | |
y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0"; | |
let $x := 1 | |
return 1 + $x |