diff --git a/OUTPUT.txt b/OUTPUT.txt index 2d883ab..3e44c42 100755 --- a/OUTPUT.txt +++ b/OUTPUT.txt @@ -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-------------------------------- - Relation name: table1 +correct: x +incorrect: x - Attribute name: name - Elements: Fry Bender Leela Zoidberg - Attribute name: age - Elements: 22 5 22 50 +Set Difference: +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: - - engine.project((engine.getTableFromName("table1")), "name"); +correct: CLOSE people ; +incorrect: CLOSE ; +Save: -This will display: +correct: SAVE people ; +incorrect: SAVE ; - -----------Initiated Query Projection--------- - Column Title: name - Fry - Bender - Leela - Zoidberg +Exit: +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); - -SHOW animals; +Update: +correct: x +incorrect: x +Insert: -//insert +correct: INSERT INTO people VALUES FROM ( 12, "Benny" ) ; +incorrect: INSERT INTO people 12 "Benny" ; -//delete +Delete: -//select - -//product \ No newline at end of file +correct: x +incorrect: x