diff --git a/data/questions.py b/data/questions.py index f2c74f6..aa35a6a 100644 --- a/data/questions.py +++ b/data/questions.py @@ -16,7 +16,7 @@ def connect_db(): def question_1_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT customer_name, country FROM customers;') data = cursor.fetchall() cursor.close() connection.close() @@ -26,7 +26,7 @@ def question_1_query(): def question_2_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT * FROM orders ORDER BY total_amount DESC LIMIT 5;') data = cursor.fetchall() cursor.close() connection.close() @@ -36,7 +36,7 @@ def question_2_query(): def question_3_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT product_name, price FROM products ORDER BY price ASC LIMIT 3;') data = cursor.fetchall() cursor.close() connection.close() @@ -46,7 +46,7 @@ def question_3_query(): def question_4_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT * FROM customers ORDER BY signup_date ASC LIMIT 10;') data = cursor.fetchall() cursor.close() connection.close() @@ -56,7 +56,7 @@ def question_4_query(): def question_5_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT product_name, stock_quantity FROM products ORDER BY stock_quantity DESC LIMIT 1;') data = cursor.fetchall() cursor.close() connection.close() @@ -66,7 +66,7 @@ def question_5_query(): def question_6_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT * FROM orders ORDER BY order_date DESC LIMIT 1;') data = cursor.fetchall() cursor.close() connection.close() @@ -76,7 +76,7 @@ def question_6_query(): def question_7_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT product_name FROM products ORDER BY product_name ASC;') data = cursor.fetchall() cursor.close() connection.close() @@ -86,7 +86,7 @@ def question_7_query(): def question_8_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT customer_id, email FROM customers ORDER BY customer_id ASC LIMIT 5;') data = cursor.fetchall() cursor.close() connection.close() @@ -96,7 +96,7 @@ def question_8_query(): def question_9_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute('SELECT order_id, total_amount FROM orders ORDER BY total_amount ASC LIMIT 3;') data = cursor.fetchall() cursor.close() connection.close() @@ -106,10 +106,11 @@ def question_9_query(): def question_10_query(): connection = connect_db() cursor = connection.cursor() - cursor.execute('') + cursor.execute("SELECT * FROM customers WHERE country = 'Turkey' ORDER BY customer_name ASC;") data = cursor.fetchall() cursor.close() connection.close() return data + + - \ No newline at end of file