Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Latest commit

 

History

History
29 lines (25 loc) · 862 Bytes

restrict.md

File metadata and controls

29 lines (25 loc) · 862 Bytes
SELECT product_name, unit_price
FROM products
WHERE unit_price >= 1.25;
############################################# SCHEMA #############################################
define
product sub entity,
    key product_name,
    has unit_price;

product_name sub attribute, datatype string;
unit_price sub attribute, datatype double;

############################################# DATA #############################################
insert $p isa product, has product_name "Carrot", has unit_price 1.22;
insert $p isa product, has product_name "Tomato", has unit_price 1.98;
insert $p isa product, has product_name "Brocolli", has unit_price 1.10;

############################################# QUERY #############################################
match
$p isa product,
    has product_name $pn,
    has unit_price $up;
$up >= 1.25;
get $pn, $up;