db_name
stringclasses
146 values
prompt
stringlengths
310
4.81k
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show all the Store_Name of drama workshop groups. # ### SQL: # # SELECT Store_Name FROM Drama_Workshop_Groups # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the store names of drama workshop groups? # ### SQL: # # SELECT Store_Name FROM Drama_Workshop_Groups # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show the minimum, average, maximum order quantity of all invoices. # ### SQL: # # SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the minimum, average, and maximum quantities ordered? Check all the invoices. # ### SQL: # # SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the distinct payment method codes in all the invoices? # ### SQL: # # SELECT DISTINCT payment_method_code FROM INVOICES # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show me the distinct payment method codes from the invoice record. # ### SQL: # # SELECT DISTINCT payment_method_code FROM INVOICES # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the description of the marketing region China? # ### SQL: # # SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = "China" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the marketing region description of China? # ### SQL: # # SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = "China" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show all the distinct product names with price higher than the average. # ### SQL: # # SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS) # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the distinct names of the products that cost more than the average? # ### SQL: # # SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS) # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the name of the most expensive product? # ### SQL: # # SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Tell me the name of the most pricy product. # ### SQL: # # SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # List all product names in ascending order of price. # ### SQL: # # SELECT Product_Name FROM Products ORDER BY Product_Price ASC # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Sort the names of products in ascending order of their price. # ### SQL: # # SELECT Product_Name FROM Products ORDER BY Product_Price ASC # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the phone number of the performer Ashley? # ### SQL: # # SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = "Ashley" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the phone number of performer "Ashley". # ### SQL: # # SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = "Ashley" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show all payment method codes and the number of orders for each code. # ### SQL: # # SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # List the distinct payment method codes with the number of orders made # ### SQL: # # SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the payment method code used by the most orders? # ### SQL: # # SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the payment method that is used the most often in all the invoices. Give me its code. # ### SQL: # # SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Which city is the address of the store named "FJA Filming" located in? # ### SQL: # # SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = "FJA Filming" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the city the store named "FJA Filming" is in. # ### SQL: # # SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = "FJA Filming" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the states or counties of the address of the stores with marketing region code "CA"? # ### SQL: # # SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "CA" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the states or counties where the stores with marketing region code "CA" are located. # ### SQL: # # SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "CA" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the name of the marketing region that the store Rob Dinning belongs to? # ### SQL: # # SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Return the name of the marketing region the store Rob Dinning is located in. # ### SQL: # # SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the descriptions of the service types with product price above 100? # ### SQL: # # SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Give me the descriptions of the service types that cost more than 100. # ### SQL: # # SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the description, code and the corresponding count of each service type? # ### SQL: # # SELECT T1.Service_Type_Description , T2.Service_Type_Code , COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # List the description, code and the number of services for each service type. # ### SQL: # # SELECT T1.Service_Type_Description , T2.Service_Type_Code , COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the description and code of the type of service that is performed the most often? # ### SQL: # # SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the description and code of the service type that is performed the most times. # ### SQL: # # SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the phones and emails of workshop groups in which services are performed? # ### SQL: # # SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Give me all the phone numbers and email addresses of the workshop groups where services are performed. # ### SQL: # # SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the names of workshop groups in which services with product name "film" are performed? # ### SQL: # # SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the names of the workshop groups where services with product name "film" are performed. # ### SQL: # # SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the different product names? What is the average product price for each of them? # ### SQL: # # SELECT Product_Name , avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # For each distinct product name, show its average product price. # ### SQL: # # SELECT Product_Name , avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the product names with average product price smaller than 1000000? # ### SQL: # # SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the product names whose average product price is below 1000000. # ### SQL: # # SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the total order quantities of photo products? # ### SQL: # # SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = "photo" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Compute the total order quantities of the product "photo". # ### SQL: # # SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = "photo" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the order details of the products with price higher than 2000? # ### SQL: # # SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the order detail for the products with price above 2000. # ### SQL: # # SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the actual delivery dates of orders with quantity 1? # ### SQL: # # SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # List the actual delivery date for all the orders with quantity 1 # ### SQL: # # SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the order dates of orders with price higher than 1000? # ### SQL: # # SELECT T1.Order_Date FROM Customer_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 WHERE T3.Product_price > 1000 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the order dates of the orders with price above 1000. # ### SQL: # # SELECT T1.Order_Date FROM Customer_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 WHERE T3.Product_price > 1000 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # How many distinct currency codes are there for all drama workshop groups? # ### SQL: # # SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the number of distinct currency codes used in drama workshop groups. # ### SQL: # # SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the names of the drama workshop groups with address in Feliciaberg city? # ### SQL: # # SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Return the the names of the drama workshop groups that are located in Feliciaberg city. # ### SQL: # # SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the email addresses of the drama workshop groups with address in Alaska state? # ### SQL: # # SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # List the email addresses of the drama workshop groups located in Alaska state. # ### SQL: # # SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show all cities along with the number of drama workshop groups in each city. # ### SQL: # # SELECT T1.City_Town , count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # How many drama workshop groups are there in each city? Return both the city and the count. # ### SQL: # # SELECT T1.City_Town , count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the marketing region code that has the most drama workshop groups? # ### SQL: # # SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Which marketing region has the most drama workshop groups? Give me the region code. # ### SQL: # # SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show all cities where at least one customer lives in but no performer lives in. # ### SQL: # # SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Which cities have at least one customer but no performer? # ### SQL: # # SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the most frequent status of bookings? # ### SQL: # # SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Which status code is the most common of all the bookings? # ### SQL: # # SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the names of the workshop groups that have bookings with status code "stop"? # ### SQL: # # SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Which workshop groups have bookings with status code "stop"? Give me the names. # ### SQL: # # SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Show the names of all the clients with no booking. # ### SQL: # # SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What are the names of the clients who do not have any booking? # ### SQL: # # SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the average quantities ordered with payment method code "MasterCard" on invoices? # ### SQL: # # SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Check the invoices record and compute the average quantities ordered with the payment method "MasterCard". # ### SQL: # # SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard" # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the product ID of the most frequently ordered item on invoices? # ### SQL: # # SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Find the id of the product ordered the most often on invoices. # ### SQL: # # SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1 # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # What is the description of the service type which offers both the photo product and the film product? # ### SQL: # # SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film' # ### End.
cre_Drama_Workshop_Groups
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Ref_Payment_Methods ( payment_method_code, payment_method_description ) # Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description ) # Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details ) # Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details ) # Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details ) # Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details ) # Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details ) # Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details ) # Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Performers_in_Bookings ( Order_ID, Performer_ID ) # Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details ) # Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details ) # Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID ) # Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details ) # Bookings_Services ( Order_ID, Product_ID ) # Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details ) # # Clients.Address_ID can be joined with Addresses.Address_ID # Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID # Performers.Address_ID can be joined with Addresses.Address_ID # Customers.Address_ID can be joined with Addresses.Address_ID # Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code # Stores.Address_ID can be joined with Addresses.Address_ID # Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings.Customer_ID can be joined with Clients.Client_ID # Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID # Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID # Customer_Orders.Store_ID can be joined with Stores.Store_ID # Customer_Orders.Customer_ID can be joined with Customers.Customer_ID # Order_Items.Product_ID can be joined with Products.Product_ID # Order_Items.Order_ID can be joined with Customer_Orders.Order_ID # Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code # Invoices.Order_ID can be joined with Bookings.Booking_ID # Invoices.Order_ID can be joined with Customer_Orders.Order_ID # Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code # Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID # Bookings_Services.Product_ID can be joined with Services.Service_ID # Bookings_Services.Order_ID can be joined with Bookings.Booking_ID # Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID # Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID # Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID # Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID # ### Question: # # Give me the description of the service type that offers not only the photo product but also the film product. # ### SQL: # # SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film' # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # How many bands are there? # ### SQL: # # SELECT count(*) FROM Band # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Find the number of bands. # ### SQL: # # SELECT count(*) FROM Band # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are all the labels? # ### SQL: # # SELECT DISTINCT label FROM Albums # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are the different album labels listed? # ### SQL: # # SELECT DISTINCT label FROM Albums # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Find all the albums in 2012. # ### SQL: # # SELECT * FROM Albums WHERE YEAR = 2012 # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # return all columns of the albums created in the year of 2012. # ### SQL: # # SELECT * FROM Albums WHERE YEAR = 2012 # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Find all the stage positions of the musicians with first name "Solveig" # ### SQL: # # SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are the different stage positions for all musicians whose first name is "Solveig"? # ### SQL: # # SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # How many songs are there? # ### SQL: # # SELECT count(*) FROM Songs # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Count the number of songs. # ### SQL: # # SELECT count(*) FROM Songs # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Find all the songs performed by artist with last name "Heilo" # ### SQL: # # SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are the names of the songs by the artist whose last name is "Heilo"? # ### SQL: # # SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Hom many musicians performed in the song "Flash"? # ### SQL: # # SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = "Flash" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # How many musicians play in the song "Flash"? # ### SQL: # # SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = "Flash" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Find all the songs produced by artists with first name "Marianne". # ### SQL: # # SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are the names of all songs produced by the artist with the first name "Marianne"? # ### SQL: # # SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Who performed the song named "Badlands"? Show the first name and the last name. # ### SQL: # # SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are the first and last names of the artist who perfomed the song "Badlands"? # ### SQL: # # SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name. # ### SQL: # # SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are the first and last names of the performer who was in the back stage position for the song "Badlands"? # ### SQL: # # SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back" # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # How many unique labels are there for albums? # ### SQL: # # SELECT count(DISTINCT label) FROM albums # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What are the unique labels for the albums? # ### SQL: # # SELECT count(DISTINCT label) FROM albums # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What is the label that has the most albums? # ### SQL: # # SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1 # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What is the label with the most albums? # ### SQL: # # SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1 # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What is the last name of the musician that have produced the most number of songs? # ### SQL: # # SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What is the last name of the musician who was in the most songs? # ### SQL: # # SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What is the last name of the musician that has been at the back position the most? # ### SQL: # # SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = "back" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 # ### End.
music_2
### Complete SQL query only and with no explanation ### SQL tables followed by foreign key information: # # Songs ( SongId, Title ) # Albums ( AId, Title, Year, Label, Type ) # Band ( Id, Firstname, Lastname ) # Instruments ( SongId, BandmateId, Instrument ) # Performance ( SongId, Bandmate, StagePosition ) # Tracklists ( AlbumId, Position, SongId ) # Vocals ( SongId, Bandmate, Type ) # # Instruments.BandmateId can be joined with Band.Id # Instruments.SongId can be joined with Songs.SongId # Performance.Bandmate can be joined with Band.Id # Performance.SongId can be joined with Songs.SongId # Tracklists.AlbumId can be joined with Albums.AId # Tracklists.SongId can be joined with Songs.SongId # Vocals.Bandmate can be joined with Band.Id # Vocals.SongId can be joined with Songs.SongId # ### Question: # # What is the last name of the musicians who has played back position the most? # ### SQL: # # SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = "back" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 # ### End.