question_id
int64
1
75.7k
db_id
stringclasses
33 values
db_name
stringclasses
4 values
question
stringlengths
19
259
partition
stringclasses
4 values
difficulty
stringclasses
3 values
SQL
stringlengths
25
862
801
sales_in_weather
bird
How many items were sold by store 9 during a snowy day?
train
hard
SELECT COUNT(DISTINCT item_nbr) FROM weather AS t1 INNER JOIN relation AS t2 ON t1.station_nbr = t2.station_nbr INNER JOIN sales_in_weather AS t3 ON t2.store_nbr = t3.store_nbr WHERE t3.store_nbr = 9 AND t1.snowfall <> 0 AND NOT t1.snowfall IS NULL
802
sales_in_weather
bird
List out stations number and items sold by store 17.
train
hard
SELECT t1.station_nbr, t2.item_nbr FROM relation AS t1 INNER JOIN sales_in_weather AS t2 ON t1.store_nbr = t2.store_nbr WHERE t1.store_nbr = 17 GROUP BY t1.station_nbr, t2.item_nbr
803
sales_in_weather
bird
List out dates when haze is recorded in store 35.
train
hard
select t1.`date` from weather as t1 inner join relation as t2 on t1.station_nbr = t2.station_nbr where t2.store_nbr = 35 and t1.codesum like '%' or 'hz' or '%'
804
sales_in_weather
bird
What is the sea level and average speed for store number 3 and store number 4?
train
hard
SELECT t1.sealevel, t1.avgspeed FROM weather AS t1 INNER JOIN relation AS t2 ON t1.station_nbr = t2.station_nbr WHERE t2.store_nbr = 3 OR t2.store_nbr = 4
805
sales_in_weather
bird
Which items from store 1 have the highest units sold during rainy day?
train
hard
select t2.item_nbr from weather as t1 inner join sales_in_weather as t2 on t1.`date` = t2.`date` inner join relation as t3 on t2.store_nbr = t3.store_nbr and t1.station_nbr = t3.station_nbr where t2.store_nbr = 1 and t1.codesum like '%' or 'ra' or '%' group by t2.item_nbr order by t2.units desc limit 1
806
sales_in_weather
bird
What is the ratio of the highest and lowest temperature in store 11?
train
hard
SELECT CAST((MAX(t1.tmax) - MIN(t1.tmin)) AS REAL) / MIN(t1.tmin) FROM weather AS t1 INNER JOIN relation AS t2 ON t1.station_nbr = t2.station_nbr WHERE t2.store_nbr = 11
807
sales_in_weather
bird
What was the difference of number of units sold in station number 1 and number 2 on year 2012?
train
hard
select sum(case when t1.station_nbr = 1 then units else 0 end) - sum(case when t1.station_nbr = 2 then units else 0 end) from relation as t1 inner join sales_in_weather as t2 on t1.store_nbr = t2.store_nbr where t2.`date` like '%2012%'
808
sales_in_weather
bird
What was the average temperature difference between store number 18 and 19 on 16 September 2022?
train
hard
select sum(case when t1.store_nbr = 18 then t2.tavg else 0 end) - sum(case when t1.store_nbr = 19 then t2.tavg else 0 end) from relation as t1 inner join weather as t2 on t1.station_nbr = t2.station_nbr where t2.`date` = '2012-09-16'
809
sales_in_weather
bird
How many units are being sold for item 1 when the average temperature is 83?
train
hard
select sum(units) from weather as t1 inner join sales_in_weather as t2 on t1.`date` = t2.`date` inner join relation as t3 on t2.store_nbr = t3.store_nbr where t2.item_nbr = 1 and t1.tavg = 83
810
sales_in_weather
bird
What is the difference between the units sold for item 1 when the sunset was the earliest and the latest?
train
hard
select ( select sum(t2.units) as sumunit from weather as t1 inner join sales_in_weather as t2 on t1.`date` = t2.`date` inner join relation as t3 on t2.store_nbr = t3.store_nbr where t2.item_nbr = 5 and sunset is not null group by t1.sunset order by t1.sunset limit 1 ) - ( select sum(t2.units) as sumunit from weather as...
811
sales_in_weather
bird
What was the total unit sold for item 10 when the average temperature was below the median temperature?
train
hard
select sum(t5.units) from weather as t4 inner join sales_in_weather as t5 on t4.`date` = t5.`date` inner join relation as t6 on t5.store_nbr = t6.store_nbr where t5.item_nbr = 10 and t4.tavg < ( select avg(t1.tavg) from weather as t1 inner join sales_in_weather as t2 on t1.`date` = t2.`date` inner join relation as t3 o...
812
sales_in_weather
bird
What was the average temperature differences during May 2012 for store number 6 and 7?
train
hard
select ( select cast(sum(tavg) as real) / count(`date`) from weather as t1 inner join relation as t2 on t1.station_nbr = t2.station_nbr and t1.`date` like '%2012-05%' and t2.store_nbr = 6 ) - ( select cast(sum(tavg) as real) / count(`date`) from weather as t1 inner join relation as t2 on t1.station_nbr = t2.station_nbr...
813
e_commerce
spider
List the id, first name and last name of the customers who both have placed more than 2 orders and have bought at least 3 items.
test
hard
SELECT t1.customer_id, t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id HAVING COUNT(*) > 2 INTERSECT SELECT t1.customer_id, t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_...
814
e_commerce
spider
What are the ids, first and last names of the customers who have ordered more than twice and have bought at least 3 items?
test
hard
SELECT t1.customer_id, t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id HAVING COUNT(*) > 2 INTERSECT SELECT t1.customer_id, t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_...
815
e_commerce
spider
For the orders with any produts, how many products does each orders contain ? List the order id, status and the number.
test
hard
SELECT t1.order_id, t1.order_status_code, COUNT(*) FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id GROUP BY t1.order_id
816
e_commerce
spider
For every order, how many products does it contain, and what are the orders' statuses and ids?
test
hard
SELECT t1.order_id, t1.order_status_code, COUNT(*) FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id GROUP BY t1.order_id
817
e_commerce
spider
List the dates of the orders which were placed at the earliest time or have more than 1 items.
test
hard
SELECT MIN(date_order_placed) FROM orders UNION SELECT t1.date_order_placed FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id GROUP BY t1.order_id HAVING COUNT(*) > 1
818
e_commerce
spider
What are the dates of the earliest order and the dates of all orders with more than 1 item?
test
hard
SELECT MIN(date_order_placed) FROM orders UNION SELECT t1.date_order_placed FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id GROUP BY t1.order_id HAVING COUNT(*) > 1
819
e_commerce
spider
Which customers did not make any orders? List the first name, middle initial and last name.
test
hard
SELECT customer_first_name, customer_middle_initial, customer_last_name FROM customers EXCEPT SELECT t1.customer_first_name, t1.customer_middle_initial, t1.customer_last_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id
820
e_commerce
spider
WHat are the first and last names, and middle initials of all customers who did not make any orders?
test
hard
SELECT customer_first_name, customer_middle_initial, customer_last_name FROM customers EXCEPT SELECT t1.customer_first_name, t1.customer_middle_initial, t1.customer_last_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id
821
e_commerce
spider
What are the id, name, price and color of the products which have not been ordered for at least twice?
test
hard
SELECT product_id, product_name, product_price, product_color FROM products EXCEPT SELECT t1.product_id, t1.product_name, t1.product_price, t1.product_color FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN orders AS t3 ON t2.order_id = t3.order_id GROUP BY t1.product_id HAVING COUNT(*) >...
822
e_commerce
spider
What are the ids , names , prices , and colors of all products that have been listed in less than two orders ?
test
hard
SELECT t1.product_id, t1.product_name, t1.product_price, t1.product_color FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN orders AS t3 ON t2.order_id = t3.order_id GROUP BY t1.product_id HAVING COUNT(*) < 2
823
e_commerce
spider
Which orders have at least 2 products on it? List the order id and date.
test
hard
SELECT t1.order_id, t1.date_order_placed FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id GROUP BY t1.order_id HAVING COUNT(*) >= 2
824
e_commerce
spider
What are the ids and dates of the orders with at least two products?
test
hard
SELECT t1.order_id, t1.date_order_placed FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id GROUP BY t1.order_id HAVING COUNT(*) >= 2
825
e_commerce
spider
Which product are listed in orders most frequently? List the id, product name and price.
test
hard
SELECT t1.product_id, t1.product_name, t1.product_price FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1
826
e_commerce
spider
What are the ids, names, and prices of all products that are ordered most frequently?
test
hard
SELECT t1.product_id, t1.product_name, t1.product_price FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1
827
e_commerce
spider
Which order have the least sum of the product prices. List the order id and sum.
test
hard
SELECT t1.order_id, SUM(t2.product_price) FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.order_id ORDER BY SUM(t2.product_price) ASC LIMIT 1
828
e_commerce
spider
What is the order that total cost the least , and how much is the total cost ?
test
hard
SELECT t1.order_id, SUM(t2.product_price) FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.order_id ORDER BY SUM(t2.product_price) ASC LIMIT 1
829
e_commerce
spider
What is the most popular payment method?
test
hard
SELECT payment_method_code FROM customer_payment_methods GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1
830
e_commerce
spider
What is the payment method that most customers use?
test
hard
SELECT payment_method_code FROM customer_payment_methods GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1
831
e_commerce
spider
How many number of products does each gender of customers buy? List the gender and the number
test
hard
SELECT t1.gender_code, COUNT(*) FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.gender_code
832
e_commerce
spider
How many products does each gender buy?
test
hard
SELECT t1.gender_code, COUNT(*) FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.gender_code
833
e_commerce
spider
How many orders has each gender of customers placed?
test
hard
SELECT t1.gender_code, COUNT(*) FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.gender_code
834
e_commerce
spider
How many orders has each gender placed?
test
hard
SELECT t1.gender_code, COUNT(*) FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.gender_code
835
e_commerce
spider
List the customers' first name, middle initial, last name and payment methods.
test
hard
SELECT t1.customer_first_name, t1.customer_middle_initial, t1.customer_last_name, t2.payment_method_code FROM customers AS t1 JOIN customer_payment_methods AS t2 ON t1.customer_id = t2.customer_id
836
e_commerce
spider
What are the first names, middle initials, last names, and payment methods of all customers?
test
hard
SELECT t1.customer_first_name, t1.customer_middle_initial, t1.customer_last_name, t2.payment_method_code FROM customers AS t1 JOIN customer_payment_methods AS t2 ON t1.customer_id = t2.customer_id
837
e_commerce
spider
List the invoices' status, date and the date of shipment.
test
hard
SELECT t1.invoice_status_code, t1.invoice_date, t2.shipment_date FROM invoices AS t1 JOIN shipments AS t2 ON t1.invoice_number = t2.invoice_number
838
e_commerce
spider
What are the statuses, dates, and shipment dates for all invoices?
test
hard
SELECT t1.invoice_status_code, t1.invoice_date, t2.shipment_date FROM invoices AS t1 JOIN shipments AS t2 ON t1.invoice_number = t2.invoice_number
839
e_commerce
spider
List the names of the products being shipped and the corresponding shipment date.
test
hard
SELECT t1.product_name, t4.shipment_date FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN shipment_items AS t3 ON t2.order_item_id = t3.order_item_id JOIN shipments AS t4 ON t3.shipment_id = t4.shipment_id
840
e_commerce
spider
What are the names of the products tht have been shipped, and on what days were they shipped?
test
hard
SELECT t1.product_name, t4.shipment_date FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN shipment_items AS t3 ON t2.order_item_id = t3.order_item_id JOIN shipments AS t4 ON t3.shipment_id = t4.shipment_id
841
e_commerce
spider
What is the status code of the items being ordered and shipped and its corresponding shipment tracking number?
test
hard
SELECT t1.order_item_status_code, t3.shipment_tracking_number FROM order_items AS t1 JOIN shipment_items AS t2 ON t1.order_item_id = t2.order_item_id JOIN shipments AS t3 ON t2.shipment_id = t3.shipment_id
842
e_commerce
spider
What is the status code of the items have been ordered and shipped, and also what are their shipment tracking numbers?
test
hard
SELECT t1.order_item_status_code, t3.shipment_tracking_number FROM order_items AS t1 JOIN shipment_items AS t2 ON t1.order_item_id = t2.order_item_id JOIN shipments AS t3 ON t2.shipment_id = t3.shipment_id
843
e_commerce
spider
What is the product name and the color of the ordered items which have been shipped?
test
hard
SELECT t1.product_name, t1.product_color FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN shipment_items AS t3 ON t2.order_item_id = t3.order_item_id JOIN shipments AS t4 ON t3.shipment_id = t4.shipment_id
844
e_commerce
spider
What are the names and colors of all products that have been shipped?
test
hard
SELECT t1.product_name, t1.product_color FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN shipment_items AS t3 ON t2.order_item_id = t3.order_item_id JOIN shipments AS t4 ON t3.shipment_id = t4.shipment_id
845
e_commerce
spider
List all the distinct product names, price and descriptions which are bought by female customers.
test
hard
SELECT DISTINCT t1.product_name, t1.product_price, t1.product_description FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN orders AS t3 ON t2.order_id = t3.order_id JOIN customers AS t4 ON t3.customer_id = t4.customer_id WHERE t4.gender_code = 'female'
846
e_commerce
spider
What are the different names, prices, and descriptions for all products bought by female customers?
test
hard
SELECT DISTINCT t1.product_name, t1.product_price, t1.product_description FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id JOIN orders AS t3 ON t2.order_id = t3.order_id JOIN customers AS t4 ON t3.customer_id = t4.customer_id WHERE t4.gender_code = 'female'
847
e_commerce
spider
What are invoices status of all the orders which have not been shipped?
test
easy
SELECT invoice_status_code FROM invoices WHERE NOT invoice_number IN (SELECT invoice_number FROM shipments)
848
e_commerce
spider
What are the invoice statuses for all orderes that have not been shipped out yet?
test
easy
SELECT invoice_status_code FROM invoices WHERE NOT invoice_number IN (SELECT invoice_number FROM shipments)
849
e_commerce
spider
What are the total cost of all the orders ? List the order id , date , and total cost .
test
hard
SELECT t1.order_id, t1.date_order_placed, SUM(t3.product_price) FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id JOIN products AS t3 ON t2.product_id = t3.product_id GROUP BY t1.order_id
850
e_commerce
spider
For each order, what is its id, date, and total amount paid?
test
hard
SELECT t1.order_id, t1.date_order_placed, SUM(t3.product_price) FROM orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id JOIN products AS t3 ON t2.product_id = t3.product_id GROUP BY t1.order_id
851
e_commerce
spider
How many customers have placed any order?
test
easy
SELECT COUNT(DISTINCT customer_id) FROM orders
852
e_commerce
spider
How many different customers have ordered things?
test
easy
SELECT COUNT(DISTINCT customer_id) FROM orders
853
e_commerce
spider
How many item states are there in the orders?
test
easy
SELECT COUNT(DISTINCT order_item_status_code) FROM order_items
854
e_commerce
spider
How many different item status codes are there listed in ordered items?
test
easy
SELECT COUNT(DISTINCT order_item_status_code) FROM order_items
855
e_commerce
spider
How many different payment methods are there?
test
easy
SELECT COUNT(DISTINCT payment_method_code) FROM customer_payment_methods
856
e_commerce
spider
How many different payment methods can customers choose from?
test
easy
SELECT COUNT(DISTINCT payment_method_code) FROM customer_payment_methods
857
e_commerce
spider
What are the login names and passwords of the customers whose phone number have the prefix '+12'?
test
easy
SELECT login_name, login_password FROM customers WHERE phone_number LIKE '+12%'
858
e_commerce
spider
What are the usernames and passwords of all customers whose phone number starts with '+12'?
test
easy
SELECT login_name, login_password FROM customers WHERE phone_number LIKE '+12%'
859
e_commerce
spider
What are the product sizes of the products whose name has the substring 'Dell'?
test
easy
SELECT product_size FROM products WHERE product_name LIKE '%dell%'
860
e_commerce
spider
What are the sizes of all products whose name includes the word 'Dell'?
test
easy
SELECT product_size FROM products WHERE product_name LIKE '%dell%'
861
e_commerce
spider
What are the product price and the product size of the products whose price is above average?
test
easy
SELECT product_price, product_size FROM products WHERE product_price > (SELECT AVG(product_price) FROM products)
862
e_commerce
spider
What are the prices and sizes of all products whose price is above the mean?
test
easy
SELECT product_price, product_size FROM products WHERE product_price > (SELECT AVG(product_price) FROM products)
863
e_commerce
spider
How many kinds of products have not been sold?
test
medium
SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM order_items)
864
e_commerce
spider
What is the number of products that have not been ordered yet?
test
medium
SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM order_items)
865
e_commerce
spider
How many customers do not have any payment method?
test
easy
SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_payment_methods)
866
e_commerce
spider
How many customers do not have a listed payment method?
test
easy
SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_payment_methods)
867
e_commerce
spider
What are all the order status and all the dates of orders?
test
easy
SELECT order_status_code, date_order_placed FROM orders
868
e_commerce
spider
What are the status codes and dates placed for all of the orders?
test
easy
SELECT order_status_code, date_order_placed FROM orders
869
e_commerce
spider
List the address, town and county information of the customers who live in the USA.
test
easy
SELECT address_line_1, town_city, county FROM customers WHERE country = 'usa'
870
e_commerce
spider
What are the addresses, towns, and county information for all customers who live in the United States?
test
easy
SELECT address_line_1, town_city, county FROM customers WHERE country = 'usa'
871
e_commerce
spider
List all the pairs of buyer first names and product names.
test
hard
SELECT t1.customer_first_name, t4.product_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id
872
e_commerce
spider
What are the first names of all buyers and what products did they buy? List them in pairs.
test
hard
SELECT t1.customer_first_name, t4.product_name FROM customers AS t1 JOIN orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id
873
e_commerce
spider
How many items are shipped?
test
easy
SELECT COUNT(*) FROM shipment_items
874
e_commerce
spider
How many products have been shipped?
test
easy
SELECT COUNT(*) FROM shipment_items
875
e_commerce
spider
What is the product average price?
test
easy
SELECT AVG(product_price) FROM products
876
e_commerce
spider
How much do the products cost on average?
test
easy
SELECT AVG(product_price) FROM products
877
e_commerce
spider
What is the average price of the products being ordered?
test
hard
SELECT AVG(t1.product_price) FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id
878
e_commerce
spider
What is the price of all products being ordered on average?
test
hard
SELECT AVG(t1.product_price) FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id
879
e_commerce
spider
What are the email address, town and county of the customers who are of the least common gender?
test
easy
SELECT email_address, town_city, county FROM customers WHERE gender_code = (SELECT gender_code FROM customers GROUP BY gender_code ORDER BY COUNT(*) ASC LIMIT 1)
880
e_commerce
spider
What are the email addresses, cities, and counties listed for all cusomters who are from the gender that orders less often?
test
easy
SELECT email_address, town_city, county FROM customers WHERE gender_code = (SELECT gender_code FROM customers GROUP BY gender_code ORDER BY COUNT(*) ASC LIMIT 1)
881
e_commerce
spider
List the order date of the orders who are placed by customers with at least 2 payment methods.
test
hard
SELECT date_order_placed FROM orders WHERE customer_id IN (SELECT t1.customer_id FROM customers AS t1 JOIN customer_payment_methods AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id HAVING COUNT(*) >= 2)
882
e_commerce
spider
What is the date of all orders that have been placed by customers with at least 2 payment methods?
test
hard
SELECT date_order_placed FROM orders WHERE customer_id IN (SELECT t1.customer_id FROM customers AS t1 JOIN customer_payment_methods AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id HAVING COUNT(*) >= 2)
883
e_commerce
spider
What is the most uncommon order status?
test
hard
SELECT order_status_code FROM orders GROUP BY order_status_code ORDER BY COUNT(*) LIMIT 1
884
e_commerce
spider
What is the least common order status?
test
hard
SELECT order_status_code FROM orders GROUP BY order_status_code ORDER BY COUNT(*) LIMIT 1
885
e_commerce
spider
For all the products sold for more than 3 times, list their id and description.
test
hard
SELECT t1.product_id, t1.product_description FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id HAVING COUNT(*) > 3
886
e_commerce
spider
For all products sold more than 3 times, what are their ids and descriptions?
test
hard
SELECT t1.product_id, t1.product_description FROM products AS t1 JOIN order_items AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id HAVING COUNT(*) > 3
887
e_commerce
spider
List the invoice dates and ids of the invoices causing at least 2 shipments.
test
hard
SELECT t1.invoice_date, t1.invoice_number FROM invoices AS t1 JOIN shipments AS t2 ON t1.invoice_number = t2.invoice_number GROUP BY t1.invoice_number HAVING COUNT(*) >= 2
888
e_commerce
spider
What are the dates and ids of the invoices that are related to at least 2 shipments?
test
hard
SELECT t1.invoice_date, t1.invoice_number FROM invoices AS t1 JOIN shipments AS t2 ON t1.invoice_number = t2.invoice_number GROUP BY t1.invoice_number HAVING COUNT(*) >= 2
889
e_commerce
spider
what are all shipment tracking numbers and shipment dates?
test
easy
SELECT shipment_tracking_number, shipment_date FROM shipments
890
e_commerce
spider
What are the tracking numbers and dates for all shipments listed?
test
easy
SELECT shipment_tracking_number, shipment_date FROM shipments
891
e_commerce
spider
What are the color, description and size of the products priced below the maximum price.
test
easy
SELECT product_color, product_description, product_size FROM products WHERE product_price < (SELECT MAX(product_price) FROM products)
892
e_commerce
spider
What are the colors , descriptions , and sizes for all products that are not at the maximum price ?
test
easy
SELECT product_color, product_description, product_size FROM products WHERE product_price <> (SELECT MAX(product_price) FROM products)
893
customers_and_orders
spider
How many addresses do we have?
test
easy
SELECT COUNT(*) FROM addresses
894
customers_and_orders
spider
Count the number of addresses.
test
easy
SELECT COUNT(*) FROM addresses
895
customers_and_orders
spider
List all address ids and address details.
test
easy
SELECT address_id, address_details FROM addresses
896
customers_and_orders
spider
What are all the address ids and address details?
test
easy
SELECT address_id, address_details FROM addresses
897
customers_and_orders
spider
How many products do we have?
test
easy
SELECT COUNT(*) FROM products
898
customers_and_orders
spider
Count the number of products.
test
easy
SELECT COUNT(*) FROM products
899
customers_and_orders
spider
Show all product ids, product type codes, and product name.
test
easy
SELECT product_id, product_type_code, product_name FROM products
900
customers_and_orders
spider
What are the ids, type codes, and names for all products?
test
easy
SELECT product_id, product_type_code, product_name FROM products