@@ -12,6 +12,17 @@ def select(self, table, cols, _print=True):
1212 statement = "SELECT " + cols_str + " FROM " + wrap (table )
1313 return self ._fetch (statement , _print )
1414
15+ def select_all (self , table ):
16+ """Query all rows and columns from a table."""
17+ # Concatenate statement
18+ statement = "SELECT * FROM " + wrap (table )
19+ return self ._fetch (statement )
20+
21+ def select_all_join (self , table1 , table2 , key ):
22+ """Left join all rows and columns from two tables where a common value is shared."""
23+ # TODO: Write function to run a select * left join query
24+ pass
25+
1526 def select_where (self , table , cols , where ):
1627 """Query certain columns from a table where a particular value is found."""
1728 # Either join list of columns into string or set columns to * (all)
@@ -26,17 +37,6 @@ def select_where(self, table, cols, where):
2637 statement = ("SELECT " + cols_str + " FROM " + wrap (table ) + ' WHERE ' + str (where_col ) + '=' + str (where_val ))
2738 self ._fetch (statement )
2839
29- def select_all (self , table ):
30- """Query all rows and columns from a table."""
31- # Concatenate statement
32- statement = "SELECT * FROM " + wrap (table )
33- return self ._fetch (statement )
34-
35- def select_all_join (self , table1 , table2 , key ):
36- """Left join all rows and columns from two tables where a common value is shared."""
37- # TODO: Write function to run a select * left join query
38- pass
39-
4040 def insert (self , table , columns , values ):
4141 """Insert a singular row into a table"""
4242 # Concatenate statement
@@ -96,4 +96,4 @@ def truncate(self, table):
9696 def drop_table (self , table ):
9797 """Drop a table from a database."""
9898 self .execute ('DROP TABLE ' + wrap (table ))
99- return table
99+ return table
0 commit comments