Update DBEngine.cpp
This commit is contained in:
parent
0e99c2e305
commit
758d3e55cc
1 changed files with 20 additions and 4 deletions
24
DBEngine.cpp
24
DBEngine.cpp
|
@ -3,7 +3,7 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
DBEngine::DBEngine(){
|
DBEngine::DBEngine(){
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
//create a new table in memory
|
//create a new table in memory
|
||||||
|
@ -42,10 +42,26 @@ void DBEngine::selectQuery(){
|
||||||
}
|
}
|
||||||
|
|
||||||
//return a subset of attributes (columns)
|
//return a subset of attributes (columns)
|
||||||
void DBEngine::projectQuery(){
|
/*
|
||||||
//
|
vector<string> DBEngine::projectQuery(Relation table, string query){
|
||||||
|
|
||||||
|
/*
|
||||||
|
So basically this is what's going on:
|
||||||
|
- Take the table to iterate through, this is the relation (input 1)
|
||||||
|
- Take a string that will be used for the program to search for in the attributes (input 2)
|
||||||
|
- Iterate through each attribute until the attribute (string) matches the input query
|
||||||
|
- For every iterator, have a counter that counts how many attributes are skipped over in the vector until the attribute is found
|
||||||
|
- This counter will be used to iterate through each vector (row) in the list, skip over that many attributes, and push that into a result vector
|
||||||
|
- Once all vector's elements at the specified attribute are pushed back, return the result vector
|
||||||
|
|
||||||
|
|
||||||
|
for(int i = 0; i < table.getSize(); i++) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//each row in the first table is paired with all the rows in the second table
|
//each row in the first table is paired with all the rows in the second table
|
||||||
void DBEngine::productQuery(){
|
void DBEngine::productQuery(){
|
||||||
//
|
//
|
||||||
|
|
Reference in a new issue