Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Find the city the store named "FJA Filming" is in. [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the states or counties of the address of the stores with marketing region code "CA"? [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Find the states or counties where the stores with marketing region code "CA" are located. [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the marketing region that the store Rob Dinning belongs to? [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Return the name of the marketing region the store Rob Dinning is located in. [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the descriptions of the service types with product price above 100? [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Give me the descriptions of the service types that cost more than 100. [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What is the description, code and the corresponding count of each service type? [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: List the description, code and the number of services for each service type. [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What is the description and code of the type of service that is performed the most often? [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Find the description and code of the service type that is performed the most times. [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the phones and emails of workshop groups in which services are performed? [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Give me all the phone numbers and email addresses of the workshop groups where services are performed. [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of workshop groups in which services with product name "film" are performed? [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Find the names of the workshop groups where services with product name "film" are performed. [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the different product names? What is the average product price for each of them? [/INST]

Output: SELECT Product_Name ,  avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: For each distinct product name, show its average product price. [/INST]

Output: SELECT Product_Name ,  avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the product names with average product price smaller than 1000000? [/INST]

Output: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price)  <  1000000;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Find the product names whose average product price is below 1000000. [/INST]

Output: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price)  <  1000000;


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the total order quantities of photo products? [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: Compute the total order quantities of the product "photo". [/INST]

Output: 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";


Input:
[INST] Here is a database schema:
Ref_Payment_Methods :
payment_method_code [ TEXT ] primary_key
payment_method_description [ TEXT ]

Ref_Service_Types :
Service_Type_Code [ TEXT ] primary_key
Parent_Service_Type_Code [ TEXT ]
Service_Type_Description [ TEXT ]

Addresses :
Address_ID [ TEXT ] primary_key
Line_1 [ TEXT ]
Line_2 [ TEXT ]
City_Town [ TEXT ]
State_County [ TEXT ]
Other_Details [ TEXT ]

Products :
Product_ID [ TEXT ] primary_key
Product_Name [ TEXT ]
Product_Price [ INT ]
Product_Description [ TEXT ]
Other_Product_Service_Details [ TEXT ]

Marketing_Regions :
Marketing_Region_Code [ TEXT ] primary_key
Marketing_Region_Name [ TEXT ]
Marketing_Region_Descriptrion [ TEXT ]
Other_Details [ TEXT ]

Clients :
Client_ID [ INT ] primary_key
Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID
Customer_Email_Address [ TEXT ]
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Other_Details [ TEXT ]

Drama_Workshop_Groups :
Workshop_Group_ID [ INT ] primary_key
Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID
Currency_Code [ TEXT ]
Marketing_Region_Code [ TEXT ]
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Performers :
Performer_ID [ INT ] primary_key
Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Customers :
Customer_ID [ TEXT ] primary_key
Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID
Customer_Name [ TEXT ]
Customer_Phone [ TEXT ]
Customer_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Stores :
Store_ID [ TEXT ] primary_key
Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID
Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code
Store_Name [ TEXT ]
Store_Phone [ TEXT ]
Store_Email_Address [ TEXT ]
Other_Details [ TEXT ]

Bookings :
Booking_ID [ INT ] primary_key
Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID
Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Status_Code [ TEXT ]
Store_ID [ INT ]
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Performers_in_Bookings :
Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID
Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID

Customer_Orders :
Order_ID [ INT ] primary_key
Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID
Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID
Order_Date [ TEXT ]
Planned_Delivery_Date [ TEXT ]
Actual_Delivery_Date [ TEXT ]
Other_Order_Details [ TEXT ]

Order_Items :
Order_Item_ID [ INT ] primary_key
Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID
Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]

Invoices :
Invoice_ID [ INT ] primary_key
Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID
payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code
Product_ID [ INT ]
Order_Quantity [ TEXT ]
Other_Item_Details [ TEXT ]
Order_Item_ID [ INT ]

Services :
Service_ID [ INT ] primary_key
Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code
Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID
Product_Description [ TEXT ]
Product_Name [ TEXT ]
Product_Price [ INT ]
Other_Product_Service_Details [ TEXT ]

Bookings_Services :
Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID
Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID

Invoice_Items :
Invoice_Item_ID [ INT ] primary_key
Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID
Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID
Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID
Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID
Order_Quantity [ INT ]
Other_Item_Details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the order details of the products with price higher than 2000? [/INST]

Output: 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;