remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git] / unfinished / sql / sql-tests.factor
blob0b57c2d8faa3556f6a740ee8d3be1673a3f4ca1b
1 USING: kernel namespaces db.sql sequences math ;
2 IN: db.sql.tests
4 ! TUPLE: person name age ;
5 : insert-1
6     { insert
7         {
8             { table "person" }
9             { columns "name" "age" }
10             { values "erg" 26 }
11         }
12     } ;
14 : update-1
15     { update "person"
16        { set { "name" "erg" }
17              { "age" 6 } }
18        { where { "age" 6 } }
19     } ;
21 : select-1
22     { select
23         { columns
24                 "branchno"
25                 { count "staffno" as "mycount" }
26                 { sum "salary" as "mysum" } }
27         { from "staff" "lol" }
28         { where
29                 { "salary" > all
30                     { select
31                         { columns "salary" }
32                         { from "staff" }
33                         { where { "branchno" = "b003" } }
34                     }
35                 }
36                 { "branchno" > 3 } }
37         { group-by "branchno" "lol2" }
38         { having { count "staffno" > 1 } }
39         { order-by "branchno" }
40         { offset 40 }
41         { limit 20 }
42     } ;