1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
--
-- creating a table
--
CREATE TABLE another_test (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
value DOUBLE NOT NULL);
--
-- populating the table
--
INSERT INTO another_test (id, name, value) VALUES (NULL, 'alpha', 1.5);
INSERT INTO another_test (id, name, value) VALUES (NULL, 'beta', 2.5);
INSERT INTO another_test (id, name, value) VALUES (NULL, 'gamma', 3.5);
INSERT INTO another_test (id, name, value) VALUES (NULL, 'delta', 4.5);
INSERT INTO another_test (id, name, value) VALUES (NULL, 'epsilon', 5.5);
--
-- first check
--
SELECT * FROM another_test;
--
-- testing update
--
UPDATE another_test SET name = 'DELTA' WHERE vallue = 4.5;
--
-- testing delete
--
DELETE FROM another_test WHERE name = 'beta';
--
-- second check
--
SELECT * FROM another_test;
--
-- last check
--
SELECT * FROM another_test WHERE name = 'none';
|