1 SELECT strftime('%s','now');
2 CREATE TABLE test (x INT, `key` VARBINARY(200));
3 SELECT * FROM test WHERE x IS NOT NULL;
4 CREATE INDEX `key` ON test(`key`(20));
5 SELECT avg(x) FROM test;
6 SELECT count(*) FROM test;
7 SELECT x FROM test WHERE ? >= `key` ORDER BY `key` DESC LIMIT 1;
8 SELECT x FROM test WHERE `key` < ?;
10 CREATE TABLE appointments (alert_at DATETIME);
11 INSERT INTO `appointments` (
14 NOW() + INTERVAL @delay SECOND
16 SELECT SUM(CASE WHEN x > 10 THEN 1 ELSE 0 END) FROM test;
18 CREATE TABLE issue14 (x integer);
19 INSERT INTO issue14 (x) VALUES (@x);
20 INSERT INTO issue14 SET x = @x;
21 INSERT INTO issue14 (x) SELECT @x;
23 INSERT INTO test VALUES (20, 'twenty') ON DUPLICATE KEY UPDATE x = x + ?;
24 INSERT INTO test VALUES (20, 'twenty') ON DUPLICATE KEY UPDATE x = VALUES(x) + ?;
25 INSERT INTO test VALUES (20, $$twenty$$);
26 INSERT INTO test VALUES (200,
33 RETURN ($1 ~ $q$[\t\r\n\v\\]$q$);
37 INSERT INTO `test` (`x`, `key`) VALUES
42 INSERT INTO test VALUES
48 SELECT count(*) > 0 FROM test;
49 SELECT count(*) * avg(x) FROM test;
52 INSERT INTO test VALUES
57 INSERT INTO `appointments` ( `alert_at`) VALUES (@alert);
58 INSERT INTO `appointments` ( `alert_at`) VALUES (FROM_UNIXTIME(@alert));
61 SELECT COUNT(x) FROM test;
64 SELECT COUNT(DISTINCT x), SUM(DISTINCT x) FROM test;
67 SELECT 0 <=> 0, 0 <=> null, null <=> 0, null <=> null;
70 SELECT 0 is 0, 0 is null, null is 0, null is null;
73 SELECT 42 is not distinct from null, 42 is distinct from null;
75 CREATE TABLE workareas (work_id int, about text);
78 and not exists (select 1 from workareas where work_id = test.x);