Commit 9372afb9 authored by Nadine Steinmetz's avatar Nadine Steinmetz
Browse files

Update queryDataset.tsv

parent e793a5e2
......@@ -8,6 +8,7 @@ How many types of products were sold in the third quarter of 1998 in each of the
How many Magazines were sold in Vancouver Canada in 1998? 1 SELECT COUNT(product.product_id) FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_category = 'Magazines' AND store.store_city = 'Vancouver' AND store.store_country = 'Canada' AND time_by_day.the_year = '1998' ;
How much meat was sold in Mexico in 1998? 1 SELECT COUNT(product.product_id) FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_department = 'Meat' AND store.store_country = 'Mexico' AND time_by_day.the_year = '1998' ;
Show the total sales from 1998 from the Deluxe Supermarket stores located in Canada? 2 SELECT SUM(sales_fact.store_sales) , SUM(sales_fact.unit_sales), SUM(sales_fact.store_cost) , store.store_id FROM sales_fact INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id INNER JOIN store ON store.store_id = sales_fact.store_id WHERE time_by_day.the_year = '1998' AND store.store_type = 'Deluxe Supermarket' AND store.store_country = 'Canada' GROUP BY store.store_id ORDER BY SUM(sales_fact.store_sales) DESC ;
Show the top 5 stores which sold the least pasta in January 1998? 2 SELECT DISTINCT(store.store_id), SUM(sales_fact.unit_sales) FROM sales_fact INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_subcategory = 'Pasta' AND time_by_day.the_month = 'January' AND time_by_day.the_year = '1998' GROUP BY store.store_id ORDER BY SUM(sales_fact.unit_sales) ASC LIMIT 5;
What were the total sales in Seattle in 1997? 1 SELECT SUM(sales_fact.store_sales) , SUM(sales_fact.unit_sales), SUM(sales_fact.store_cost) FROM sales_fact INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE store.store_city = 'Seattle' AND time_by_day.the_year = '1997'
Show for each brand the total sales in 1998. 2 SELECT product.brand_name , SUM(sales_fact.store_sales) , SUM(sales_fact.unit_sales), SUM(sales_fact.store_cost) FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE time_by_day.the_year = '1998' GROUP BY product.brand_name ORDER BY SUM(sales_fact.store_sales) DESC ;
How many snack foods were sold in Canada in 1998. 1 SELECT COUNT(product.product_id) FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_department = 'Snack Foods' AND store.store_country = 'Canada' AND time_by_day.the_year = '1998' ;
......@@ -33,3 +34,9 @@ What is the net weight of bread that was sold most in February 1998? 3 SELECT pr
What were the total sales per region in 1998? 2 SELECT SUM(sales_fact.store_sales) , SUM(sales_fact.unit_sales), SUM(sales_fact.store_cost) , region.sales_region FROM sales_fact INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN region ON region.region_id = store.region_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE time_by_day.the_year = '1998' GROUP BY region.sales_region ORDER BY SUM(sales_fact.store_sales) DESC ;
What is the highest sales for bread in May 1998? 2 SELECT DISTINCT(MAX(sales_fact.store_sales) ) , MAX(sales_fact.unit_sales), MAX(sales_fact.store_cost) FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_category = 'Bread' AND time_by_day.the_month = 'May' AND time_by_day.the_year = '1998' ;
What were the total sales for pasta in the business year 1997/98? 4 SELECT SUM(sales_fact.unit_sales) FROM sales_fact INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id WHERE (time_by_day.month_of_year > 8 AND time_by_day.the_year = '1997' AND product_class.product_subcategory = 'Pasta') OR (time_by_day.month_of_year < 9 AND time_by_day.the_year = '1998' AND product_class.product_subcategory = 'Pasta') ;
Which city sold more paper wipes than Los Angeles in January 1997? 3 SELECT store.store_city, COUNT(product.product_id) FROM sales_fact INNER JOIN store store ON store.store_id = sales_fact.store_id INNER JOIN product product ON product.product_id = sales_fact.product_id INNER JOIN product_class product_class ON product_class.product_class_id = product.product_class_id INNER JOIN customer customer ON customer.customer_id = sales_fact.customer_id INNER JOIN time_by_day time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_subcategory = 'Paper Wipes' AND time_by_day.the_month = 'January' AND time_by_day.the_year = '1997' GROUP BY store.store_city, store.store_city HAVING COUNT(product.product_id) < (SELECT COUNT(product.product_id) FROM sales_fact INNER JOIN store store ON store.store_id = sales_fact.store_id INNER JOIN product product ON product.product_id = sales_fact.product_id INNER JOIN product_class product_class ON product_class.product_class_id = product.product_class_id INNER JOIN customer customer ON customer.customer_id = sales_fact.customer_id INNER JOIN time_by_day time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_subcategory = 'Paper Wipes' AND store.store_city = 'Los Angeles' AND time_by_day.the_month = 'January' AND time_by_day.the_year = '1997');
What were the total costs per store in May 1998 compared to January 1997? 3 SELECT t0.store_id, t0.amount as amount_May1998 , t1.store_id, t1.amount as amount_January1997 FROM (SELECT SUM(expense_fact.amount) as amount , store.store_id FROM expense_fact INNER JOIN store store ON store.store_id = expense_fact.store_id INNER JOIN time_by_day time_by_day ON time_by_day.time_id = expense_fact.time_id WHERE time_by_day.the_month = 'May' AND time_by_day.the_year = '1998' GROUP BY store.store_id) as t0 FULL OUTER JOIN (SELECT SUM(expense_fact.amount) as amount , store.store_id FROM expense_fact INNER JOIN store store ON store.store_id = expense_fact.store_id INNER JOIN time_by_day time_by_day ON time_by_day.time_id = expense_fact.time_id WHERE time_by_day.the_month = 'January' AND time_by_day.the_year = '1997' GROUP BY store.store_id) as t1 ON t0.store_id = t1.store_id ORDER BY t0.store_id, t1.store_id ;
Show the top 5 stores which sold the most beverages in July 1998? 2 SELECT DISTINCT(store.store_id), SUM(sales_fact.unit_sales) FROM sales_fact INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_department = 'Beverages' AND time_by_day.the_month = 'July' AND time_by_day.the_year = '1998' GROUP BY store.store_id ORDER BY SUM(sales_fact.unit_sales) DESC LIMIT 5;
How many different stores in Mexico have sold seafood in 1998? 1 SELECT COUNT(DISTINCT(store.store_id) ) FROM sales_fact INNER JOIN store ON store.store_id = sales_fact.store_id INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE store.store_country = 'Mexico' AND product_class.product_department = 'Seafood' AND time_by_day.the_year = '1998' ;
What is the brand name of beer that was sold most in August 1998? 3 SELECT product.brand_name, SUM(sales_fact.unit_sales) FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_subcategory = 'Beer' AND time_by_day.the_month = 'August' AND time_by_day.the_year = '1998' GROUP BY product.brand_name ORDER BY SUM(sales_fact.unit_sales) DESC;
Which product was sold more than beer in August 1998? 3 SELECT product_class.product_subcategory FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE time_by_day.the_month = 'August' AND time_by_day.the_year = '1998' GROUP BY product_class.product_subcategory HAVING SUM(sales_fact.unit_sales) > (SELECT SUM(sales_fact.unit_sales) FROM sales_fact INNER JOIN product ON product.product_id = sales_fact.product_id INNER JOIN product_class ON product_class.product_class_id = product.product_class_id INNER JOIN time_by_day ON time_by_day.time_id = sales_fact.time_id WHERE product_class.product_subcategory = 'Beer' AND time_by_day.the_month = 'August' AND time_by_day.the_year = '1998') ;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment