You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
autograders/neo4j/source/solution.py

58 lines
2.1 KiB

7 months ago
sols = [
'''
MATCH (region:Region)-[:IS_LOCATED_IN]-(continent:Continent)
RETURN region.name, continent.name
''',
'''
MATCH (region:Region)-[:HAS_ISOLATED]-(azone:AvailabilityZone)
RETURN region.name,azone.name
''',
'''
MATCH(e:EC2InstanceType)
return e.family, count(*)
''',
'''
MATCH(e:EC2InstanceType)--(p:Price)
with e, p.cost_per_hour/e.memory as price_per_GB
Order by price_per_GB
Return e.name, price_per_GB
Limit 1
''',
'''
match (service:Service)-[:OFFERS_SERVICE]-(region:Region)
with service, count(region) as number_of_region, collect(region.name) as region_name_collection
where number_of_region > 5
return service.name, number_of_region,region_name_collection
order by number_of_region desc, service.name asc
''',
'''
match (instance:EC2InstanceType)--(price:Price)--(region:Region {name: "N. Virginia"})
where price.cost_per_hour > 1
return instance.name, price.cost_per_hour, region.name
''',
'''
match(a:Service)--(:Region)--(c:Continent)
with a, count(distinct c) as number_of_continent
where number_of_continent = 5
return a.name, number_of_continent
''',
'''
match (r:Region)-[:OFFERS_SERVICE]->(s1:Service {name:'AWS Data Pipeline'}), (r)-[:OFFERS_SERVICE]->(s2:Service {name:'Amazon Kinesis'})
return r.name
''',
'''
match (r:Region)-[:OFFERS_SERVICE]->(s1:Service {name:'Amazon Simple Email Service'})
WHERE NOT (r)-[:OFFERS_SERVICE]->(:Service {name:'AWS Data Pipeline'})
return r.name
''',
'''
match(a:Service)<-[]-(e:EC2InstanceType {name: 'Â i2.2xlarge'})
where NOT (a)<-[]-(:EC2InstanceType {name: 'c3.2xlarge'})
return a.name, 'offered only on i2.2xlarge' as description
union
match(a:Service)<-[]-(e:EC2InstanceType {name: 'Â i2.2xlarge'})
where (a)<-[]-(:EC2InstanceType {name: 'c3.2xlarge'})
return a.name, 'offered on i2.2xlarge and c3.2xlarge' as description
'''
]