First, create a new namespace called “Test”:
CREATE NAMESPACE Test;
and make it the current namespace:
USE Test;
Now, let’s create a new table within the current namespace:
CREATE TABLE fruits (color, energy, protein, vitamins);
and insert some data:
INSERT INTO fruits VALUES ("apple", "color", "red"),
("apple", "energy", "207KJ"),
("apple", "protein", "0.4g"),
("apple", "vitamins:C", "15mg"),
("apple", "vitamins:B1", "0.02mg");
INSERT INTO fruits VALUES ("banana", "color", "yellow"),
("banana", "energy", "375KJ"),
("banana", "protein", "1.2g"),
("banana", "vitamins:C", "10mg"),
("banana", "vitamins:B1", "0.04mg");
Finally, issue some queries, for example:
SELECT CELLS * FROM fruits;
SELECT CELLS * FROM fruits WHERE ROW=”banana”;
SELECT CELLS vitamins FROM fruits WHERE ROW=”apple”;
SELECT CELLS vitamins:B1 FROM fruits;