sillyql / tests / test-5.txt
test-5.txt
Raw
#join and insert/delete
CREATE friends 5 string string bool int string name vibe is_cool distance town
INSERT INTO friends 5 ROWS
Bri Fun false 100 Ann_Arbor
Jack Edgy true 1000 Ann_Arbor
Brian Smart true 1000 Ann_Arbor
Abby Loud false 10 Ann_Arbor
Ben Scary false 10000 Los_Angeles
PRINT FROM friends 3 name vibe town ALL
GENERATE FOR friends hash INDEX ON distance
PRINT FROM friends 3 name vibe town ALL
GENERATE FOR friends hash INDEX ON vibe
PRINT FROM friends 3 name vibe town WHERE distance < 1000
GENERATE FOR friends bst INDEX ON vibe
PRINT FROM friends 3 name vibe town ALL
GENERATE FOR friends hash INDEX ON town
DELETE FROM friends WHERE name = Bri
CREATE work 3 string bool bool kind working done
INSERT INTO work 3 ROWS
Coding true false
Serving false true
Crying true false
JOIN work AND friends WHERE done = is_cool AND PRINT 3 working 1 distance 2 distance 2
GENERATE FOR work bst INDEX ON kind
GENERATE FOR work hash INDEX ON done
JOIN work AND friends WHERE working = is_cool AND PRINT 3 kind 1 name 2 done 1
REMOVE friends
CREATE friends 5 string string bool int string name vibe is_cool distance town
REMOVE friends
REMOVE work
PRINT FROM work 2 kind working WHERE working = true
QUIT