id
int64
0
8.66k
db_id
stringclasses
146 values
schema
stringclasses
146 values
question
stringlengths
3
224
output
stringlengths
18
577
6,100
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Return the the "active to date" of the latest contact channel used by the customer named "Tillman Ernser".
SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser"
6,101
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the average time span of contact channels in the database?
SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels
6,102
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Compute the average active time span of contact channels.
SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels
6,103
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the channel code and contact number of the customer contact channel that was active for the longest time?
SELECT channel_code , contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
6,104
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Return the channel code and contact number of the customer contact channel whose active duration was the longest.
SELECT channel_code , contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
6,105
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the name and active date of the customer that use email as the contact channel.
SELECT t1.customer_name , t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'
6,106
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What are the name and active date of the customers whose contact channel code is email?
SELECT t1.customer_name , t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'
6,107
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the name of the customer that made the order with the largest quantity?
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = ( SELECT max(order_quantity) FROM order_items)
6,108
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the name of the customer who made the order of the largest amount of goods.
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = ( SELECT max(order_quantity) FROM order_items)
6,109
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the name of the customer that has purchased the most items?
SELECT t1.customer_name FROM customers AS t1 JOIN customer_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.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1
6,110
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Give me the name of the customer who ordered the most items in total.
SELECT t1.customer_name FROM customers AS t1 JOIN customer_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.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1
6,111
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the payment method of the customer that has purchased the least quantity of items?
SELECT t1.payment_method FROM customers AS t1 JOIN customer_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.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1
6,112
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Tell me the payment method used by the customer who ordered the least amount of goods in total.
SELECT t1.payment_method FROM customers AS t1 JOIN customer_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.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1
6,113
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
How many types of products have Rodrick Heaney bought in total?
SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney"
6,114
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the number of distinct products Rodrick Heaney has bought so far.
SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney"
6,115
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the total quantity of products purchased by "Rodrick Heaney"?
SELECT sum(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney"
6,116
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Tell me the total quantity of products bought by the customer called "Rodrick Heaney".
SELECT sum(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney"
6,117
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
How many customers have at least one order with status "Cancelled"?
SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status = "Cancelled"
6,118
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Return the number of customers who have at least one order with "Cancelled" status.
SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status = "Cancelled"
6,119
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
How many orders have detail "Second time"?
SELECT count(*) FROM customer_orders WHERE order_details = "Second time"
6,120
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Tell me the number of orders with "Second time" as order detail.
SELECT count(*) FROM customer_orders WHERE order_details = "Second time"
6,121
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the customer name and date of the orders that have the status "Delivered".
SELECT t1.customer_name , t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered"
6,122
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What are the customer name and date of the orders whose status is "Delivered".
SELECT t1.customer_name , t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered"
6,123
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the total number of products that are in orders with status "Cancelled"?
SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = "Cancelled"
6,124
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the total quantity of products associated with the orders in the "Cancelled" status.
SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = "Cancelled"
6,125
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the total amount of products ordered before 2018-03-17 07:13:53.
SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < "2018-03-17 07:13:53"
6,126
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the total amount of products purchased before 2018-03-17 07:13:53?
SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < "2018-03-17 07:13:53"
6,127
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Who made the latest order?
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1
6,128
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the name of the customer who made an order most recently.
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1
6,129
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Which product has been ordered most number of times?
SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY count(*) DESC LIMIT 1
6,130
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the most frequently ordered product? Tell me the detail of the product
SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY count(*) DESC LIMIT 1
6,131
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the name and ID of the product whose total order quantity is the largest.
SELECT t2.product_details , t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY sum(t1.order_quantity) LIMIT 1
6,132
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What are the name and ID of the product bought the most.
SELECT t2.product_details , t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY sum(t1.order_quantity) LIMIT 1
6,133
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona"
6,134
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona"
6,135
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the name of customers who did not pay with Cash.
SELECT customer_name FROM customers WHERE payment_method != 'Cash'
6,136
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What is the name of customers who do not use Cash as payment method.
SELECT customer_name FROM customers WHERE payment_method != 'Cash'
6,137
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the names of customers who never ordered product Latte.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_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 WHERE t4.product_details = 'Latte'
6,138
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What are names of customers who never ordered product Latte.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_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 WHERE t4.product_details = 'Latte'
6,139
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the names of customers who never placed an order.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id
6,140
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What are the names of customers who never made an order.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id
6,141
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
Find the names of customers who ordered both products Latte and Americano.
SELECT t1.customer_name FROM customers AS t1 JOIN customer_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 WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN custo...
6,142
customers_and_addresses
CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `address_content` VARCHAR( 80 ), `city` VARCHAR( 50 ), `zip_postcode` VARCHAR( 20 ), `state_province_county` VARCHAR( 50 ), `country` VARCHAR( 50 ), `other_address_details` VARCHAR( 255 ) ); CREATE TABLE `Products` ( `produ...
What are the names of customers who have purchased both products Latte and Americano?
SELECT t1.customer_name FROM customers AS t1 JOIN customer_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 WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN custo...
6,143
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
How many artists are there?
SELECT count(*) FROM artist
6,144
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Count the number of artists.
SELECT count(*) FROM artist
6,145
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
List the age of all music artists.
SELECT Age FROM artist
6,146
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the ages of all music artists?
SELECT Age FROM artist
6,147
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What is the average age of all artists?
SELECT avg(Age) FROM artist
6,148
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the average age across all artists.
SELECT avg(Age) FROM artist
6,149
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the famous titles of the artist "Triumfall"?
SELECT Famous_Title FROM artist WHERE Artist = "Triumfall"
6,150
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the famous titles of the artist called "Triumfall".
SELECT Famous_Title FROM artist WHERE Artist = "Triumfall"
6,151
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the distinct Famous release dates?
SELECT distinct(Famous_Release_date) FROM artist
6,152
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Give the distinct famous release dates for all artists.
SELECT distinct(Famous_Release_date) FROM artist
6,153
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the dates of ceremony and the results of all music festivals
SELECT Date_of_ceremony , RESULT FROM music_festival
6,154
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the dates of ceremony and results for each music festival?
SELECT Date_of_ceremony , RESULT FROM music_festival
6,155
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the category of music festivals with result "Awarded"?
SELECT Category FROM music_festival WHERE RESULT = "Awarded"
6,156
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the categories of music festivals that have the result "Awarded".
SELECT Category FROM music_festival WHERE RESULT = "Awarded"
6,157
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the maximum and minimum week on top of all volumes?
SELECT max(Weeks_on_Top) , min(Weeks_on_Top) FROM volume
6,158
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Give the maximum and minimum weeks on top across all volumes.
SELECT max(Weeks_on_Top) , min(Weeks_on_Top) FROM volume
6,159
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the songs in volumes with more than 1 week on top?
SELECT Song FROM volume WHERE Weeks_on_Top > 1
6,160
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Give the songs included in volumes that have more than 1 week on top.
SELECT Song FROM volume WHERE Weeks_on_Top > 1
6,161
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Please list all songs in volumes in ascending alphabetical order.
SELECT Song FROM volume ORDER BY Song
6,162
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the the songs in volumes, listed in ascending order?
SELECT Song FROM volume ORDER BY Song
6,163
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
How many distinct artists do the volumes associate to?
SELECT COUNT(DISTINCT Artist_ID) FROM volume
6,164
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Count the number of distinct artists who have volumes.
SELECT COUNT(DISTINCT Artist_ID) FROM volume
6,165
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Please show the date of ceremony of the volumes that last more than 2 weeks on top.
SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2
6,166
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the dates of ceremony at music festivals corresponding to volumes that lasted more than 2 weeks on top?
SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2
6,167
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Please show the songs that have result "nominated" at music festivals.
SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = "Nominated"
6,168
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the songs in volumes that have resulted in a nomination at music festivals?
SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = "Nominated"
6,169
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the issue dates of volumes associated with the artist "Gorgoroth"?
SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = "Gorgoroth"
6,170
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the issue dates of volumes that are by the artist named Gorgoroth.
SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = "Gorgoroth"
6,171
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the songs in volumes associated with the artist aged 32 or older?
SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32
6,172
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return names of songs in volumes that are by artists that are at least 32 years old.
SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32
6,173
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What is the average weeks on top of volumes associated with the artist aged 25 or younger?
SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25
6,174
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the average number of weeks on top for volumes by artists that are at most 25 years old.
SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25
6,175
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the famous title of the artists associated with volumes with more than 2 weeks on top?
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2
6,176
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the famous titles for artists that have volumes that lasted more than 2 weeks on top.
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2
6,177
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Please list the age and famous title of artists in descending order of age.
SELECT Famous_Title , Age FROM artist ORDER BY Age DESC
6,178
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the famous titles and ages of each artist, listed in descending order by age?
SELECT Famous_Title , Age FROM artist ORDER BY Age DESC
6,179
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What is the famous release date of the artist with the oldest age?
SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1
6,180
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the famous release date for the oldest artist.
SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1
6,181
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Please show the categories of the music festivals and the count.
SELECT Category , COUNT(*) FROM music_festival GROUP BY Category
6,182
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the number of music festivals of each category.
SELECT Category , COUNT(*) FROM music_festival GROUP BY Category
6,183
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What is the most common result of the music festival?
SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
6,184
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the result that is most frequent at music festivals.
SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
6,185
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Please show the categories of the music festivals with count more than 1.
SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1
6,186
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the categories of music festivals for which there have been more than 1 music festival?
SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1
6,187
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What is the song in the volume with the maximum weeks on top?
SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
6,188
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the song in the volume that has spent the most weeks on top?
SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
6,189
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Find the famous titles of artists that do not have any volume.
SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
6,190
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the famous titles of artists who do not have any volumes?
SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
6,191
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2
6,192
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top?
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2
6,193
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What are the date of ceremony of music festivals with category "Best Song" and result "Awarded"?
SELECT Date_of_ceremony FROM music_festival WHERE Category = "Best Song" AND RESULT = "Awarded"
6,194
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the dates of ceremony corresponding to music festivals that had the category "Best Song" and result "Awarded".
SELECT Date_of_ceremony FROM music_festival WHERE Category = "Best Song" AND RESULT = "Awarded"
6,195
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
What is the issue date of the volume with the minimum weeks on top?
SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
6,196
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Return the issue date of the volume that has spent the fewest weeks on top.
SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
6,197
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
How many distinct artists have volumes?
SELECT COUNT(DISTINCT Artist_ID) FROM volume
6,198
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Count the number of artists who have had volumes.
SELECT COUNT(DISTINCT Artist_ID) FROM volume
6,199
music_4
CREATE TABLE "artist" ( "Artist_ID" int, "Artist" text, "Age" int, "Famous_Title" text, "Famous_Release_date" text, PRIMARY KEY ( "Artist_ID" ) ); CREATE TABLE "volume" ( "Volume_ID" int, "Volume_Issue" text, "Issue_Date" text, "Weeks_on_Top" real, "Song" text...
Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.
SELECT RESULT , COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC