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 phone number and email address of customer "Harold". [/INST]

Output: SELECT Customer_Phone ,  Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name  =  "Harold";


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: Show all the Store_Name of drama workshop groups. [/INST]

Output: SELECT Store_Name FROM Drama_Workshop_Groups;


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 store names of drama workshop groups? [/INST]

Output: SELECT Store_Name FROM Drama_Workshop_Groups;


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: Show the minimum, average, maximum order quantity of all invoices. [/INST]

Output: SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES;


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 minimum, average, and maximum quantities ordered? Check all the invoices. [/INST]

Output: SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES;


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 distinct payment method codes in all the invoices? [/INST]

Output: SELECT DISTINCT payment_method_code FROM INVOICES;


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: Show me the distinct payment method codes from the invoice record. [/INST]

Output: SELECT DISTINCT payment_method_code FROM INVOICES;


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 of the marketing region China? [/INST]

Output: SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name  =  "China";


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 marketing region description of China? [/INST]

Output: SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name  =  "China";


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: Show all the distinct product names with price higher than the average. [/INST]

Output: SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price  >  (SELECT avg(Product_Price) FROM PRODUCTS);


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 distinct names of the products that cost more than the average? [/INST]

Output: SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price  >  (SELECT avg(Product_Price) FROM PRODUCTS);


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 most expensive product? [/INST]

Output: SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price 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: Tell me the name of the most pricy product. [/INST]

Output: SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price 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: List all product names in ascending order of price. [/INST]

Output: SELECT Product_Name FROM Products ORDER BY Product_Price ASC;


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: Sort the names of products in ascending order of their price. [/INST]

Output: SELECT Product_Name FROM Products ORDER BY Product_Price ASC;


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 phone number of the performer Ashley? [/INST]

Output: SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name  =  "Ashley";


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 phone number of performer "Ashley". [/INST]

Output: SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name  =  "Ashley";


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: Show all payment method codes and the number of orders for each code. [/INST]

Output: SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_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 distinct payment method codes with the number of orders made [/INST]

Output: SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_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 payment method code used by the most orders? [/INST]

Output: SELECT payment_method_code FROM INVOICES GROUP BY payment_method_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 payment method that is used the most often in all the invoices. Give me its code. [/INST]

Output: SELECT payment_method_code FROM INVOICES GROUP BY payment_method_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: Which city is the address of the store named "FJA Filming" located 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";