This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dmspine64backup/OUTPUT.txt

70 lines
1.3 KiB
Text
Raw Normal View History

2015-09-15 23:13:28 -05:00
Assuming previously defined Attribute, compiled in a vector known as 'vec' and with subsequent numbers added
To create a table:
engine.createTable("table1", vec);
2015-09-15 23:21:38 -05:00
2015-09-15 23:13:28 -05:00
This creates a Relation object with the appropriate Attribute objects. It displays nothing.
To display the table:
engine.showTables(engine.getTableFromName("table1"));
2015-09-15 23:21:38 -05:00
2015-09-15 23:13:28 -05:00
This results in such output:
Display of relation--------------------------------
Relation name: table1
Attribute name: name
Elements: Fry Bender Leela Zoidberg
Attribute name: age
Elements: 22 5 22 50
2015-09-15 23:21:38 -05:00
2015-09-15 23:13:28 -05:00
With table3 having an equal domain to table1, this:
cout << engine.unionComp(engine.getTableFromName("table1"), engine.getTableFromName("table3"));
This will display:
1
2015-09-15 23:21:38 -05:00
2015-09-15 23:13:28 -05:00
To project a table's column:
engine.project((engine.getTableFromName("table1")), "name");
This will display:
-----------Initiated Query Projection---------
Column Title: name
Fry
Bender
Leela
Zoidberg
2015-09-15 23:21:38 -05:00
With an arbitrary vector of strings as cmds (until we are able to parse effectively):
engine.saveToFile(cmds);
2015-09-17 17:14:28 -05:00
This will result in a db file with the contents:
2015-09-15 23:21:38 -05:00
CREATE TABLE animals (name VARCHAR(20), kind VARCHAR(8), years INTEGER) PRIMARY KEY (name, kind);
SHOW animals;
2015-09-17 17:14:28 -05:00
2015-09-15 23:21:38 -05:00
//insert
//delete
//select
//product