output.txt

This commit is contained in:
Rebecca Schofield 2015-09-22 22:49:17 -05:00
parent d60f663272
commit a7463a1e89

View file

@ -1,70 +1,84 @@
Assuming previously defined Attribute, compiled in a vector known as 'vec' and with subsequent numbers added show incorrect/correct example for each cmd/query
To create a table: ---------------
Queries
---------------
engine.createTable("table1", vec); Selection:
correct: select ( age == 12 ) people ;
incorrect: select ( age ))))) people ;
This creates a Relation object with the appropriate Attribute objects. It displays nothing. Projection:
To display the table: correct: project ( age ) people ;
incorrect: x
engine.showTables(engine.getTableFromName("table1")); Renaming:
correct: rename ( age, years old ) ;
incorrect: x
This results in such output: Set Union:
Display of relation-------------------------------- correct: x
Relation name: table1 incorrect: x
Attribute name: name Set Difference:
Elements: Fry Bender Leela Zoidberg
Attribute name: age
Elements: 22 5 22 50
correct: x
incorrect: x
With table3 having an equal domain to table1, this: Cross Product:
cout << engine.unionComp(engine.getTableFromName("table1"), engine.getTableFromName("table3")); correct: x
incorrect: x
-------------------
Commands
-------------------
This will display: Open:
1 correct: OPEN people ;
incorrect: OPEN ;
Close:
To project a table's column: correct: CLOSE people ;
incorrect: CLOSE ;
engine.project((engine.getTableFromName("table1")), "name");
Save:
This will display: correct: SAVE people ;
incorrect: SAVE ;
-----------Initiated Query Projection--------- Exit:
Column Title: name
Fry
Bender
Leela
Zoidberg
correct: EXIT ;
incorrect: EXIT people ;
With an arbitrary vector of strings as cmds (until we are able to parse effectively): Show:
engine.saveToFile(cmds); correct: SHOW people ;
incorrect: SHOW ;
Create:
This will result in a db file with the contents: correct: CREATE TABLE people ( age INTEGER, name VARCHAR ( 20 ) ) PRIMARY KEY ( name ) ;
incorrect: CREATE TABLE people age name ;
CREATE TABLE animals (name VARCHAR(20), kind VARCHAR(8), years INTEGER) PRIMARY KEY (name, kind); Update:
SHOW animals;
correct: x
incorrect: x
Insert:
//insert correct: INSERT INTO people VALUES FROM ( 12, "Benny" ) ;
incorrect: INSERT INTO people 12 "Benny" ;
//delete Delete:
//select correct: x
incorrect: x
//product