2 CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT,descr TEXT);
3 -- [sqlgg] name=select_all
5 SELECT name,descr FROM test;
6 INSERT INTO test VALUES;
8 INSERT INTO test (name,descr) VALUES;
9 SELECT * FROM test WHERE name = @name LIMIT @limit;
10 -- [sqlgg] name=select_distinct_limit
12 FROM test ORDER BY id DESC LIMIT ?;
13 -- [sqlgg] name=Delete
14 DELETE FROM test WHERE id = ?;
15 -- [sqlgg] name=Exaggerate
16 UPDATE test -- comment
17 SET descr = @extra || ' ' || descr;
19 CREATE TABLE loc (id INTEGER PRIMARY KEY AUTOINCREMENT, city TEXT, test_id INTEGER);
20 SELECT test.id FROM test JOIN loc ON test_id = test.id;
21 SELECT test.id FROM test WHERE id = ? UNION SELECT test.id FROM test WHERE id = ?;
22 SELECT id+test_id AS x,? FROM loc ORDER BY x,?/x LIMIT ?,100;
25 SELECT test.id,@text || city AS city, name FROM loc JOIN test ON test_id=test.id;
27 SELECT x,z FROM (SELECT name as x,
28 city || ' ' || descr as "y""",
29 max(length(city),random(*)) as z FROM test LEFT JOIN (SELECT name AS city FROM test WHERE id=@id)) WHERE x > @xlo AND z < @zhi;