Exercise 12 of 17
Regex filter and a computed column
Fixed training server
For sequences whose division matches the regular expression 'Basel.*', return the strain together with an added column 'area' set to the constant 'Basel'. Order by strain and return the first 10 rows.
The output should have this shape:
strain | area
---------- | -----
sample-001 | Basel
sample-002 | BaselWrite a query and run it. The result is compared with the reference answer without considering row order.
Loading query editor…
Loading query editor…
Explanation
Reference answer
default
.filter(division.like('Basel.*'))
.map({area := 'Basel'})
.project({strain, area})
.orderBy({strain})
.limit(10)