CREATE TABLE Ref_Payment_Methods (
    payment_method_code TEXT PRIMARY KEY,
    payment_method_description TEXT
);
CREATE TABLE Ref_Service_Types (
    Service_Type_Code TEXT PRIMARY KEY,
    Parent_Service_Type_Code TEXT,
    Service_Type_Description TEXT
);
CREATE TABLE Addresses (
    Address_ID TEXT PRIMARY KEY,
    Line_1 TEXT,
    Line_2 TEXT,
    City_Town TEXT,
    State_County TEXT,
    Other_Details TEXT
);
CREATE TABLE Products (
    Product_ID TEXT PRIMARY KEY,
    Product_Name TEXT,
    Product_Price NUMBER,
    Product_Description TEXT,
    Other_Product_Service_Details TEXT
);
CREATE TABLE Marketing_Regions (
    Marketing_Region_Code TEXT PRIMARY KEY,
    Marketing_Region_Name TEXT,
    Marketing_Region_Descriptrion TEXT,
    Other_Details TEXT
);
CREATE TABLE Clients (
    Client_ID NUMBER PRIMARY KEY,
    Address_ID NUMBER,
    Customer_Email_Address TEXT,
    Customer_Name TEXT,
    Customer_Phone TEXT,
    Other_Details TEXT,
    FOREIGN KEY ("Address_ID") REFERENCES Addresses("Address_ID")
);
CREATE TABLE Drama_Workshop_Groups (
    Workshop_Group_ID NUMBER PRIMARY KEY,
    Address_ID NUMBER,
    Currency_Code TEXT,
    Marketing_Region_Code TEXT,
    Store_Name TEXT,
    Store_Phone TEXT,
    Store_Email_Address TEXT,
    Other_Details TEXT,
    FOREIGN KEY ("Address_ID") REFERENCES Addresses("Address_ID")
);
CREATE TABLE Performers (
    Performer_ID NUMBER PRIMARY KEY,
    Address_ID NUMBER,
    Customer_Name TEXT,
    Customer_Phone TEXT,
    Customer_Email_Address TEXT,
    Other_Details TEXT,
    FOREIGN KEY ("Address_ID") REFERENCES Addresses("Address_ID")
);
CREATE TABLE Customers (
    Customer_ID TEXT PRIMARY KEY,
    Address_ID NUMBER,
    Customer_Name TEXT,
    Customer_Phone TEXT,
    Customer_Email_Address TEXT,
    Other_Details TEXT,
    FOREIGN KEY ("Address_ID") REFERENCES Addresses("Address_ID")
);
CREATE TABLE Stores (
    Store_ID TEXT PRIMARY KEY,
    Address_ID NUMBER,
    Marketing_Region_Code TEXT,
    Store_Name TEXT,
    Store_Phone TEXT,
    Store_Email_Address TEXT,
    Other_Details TEXT,
    FOREIGN KEY ("Marketing_Region_Code") REFERENCES Marketing_Regions("Marketing_Region_Code"),
    FOREIGN KEY ("Address_ID") REFERENCES Addresses("Address_ID")
);
CREATE TABLE Bookings (
    Booking_ID NUMBER PRIMARY KEY,
    Customer_ID NUMBER,
    Workshop_Group_ID TEXT,
    Status_Code TEXT,
    Store_ID NUMBER,
    Order_Date TIME,
    Planned_Delivery_Date TIME,
    Actual_Delivery_Date TIME,
    Other_Order_Details TEXT,
    FOREIGN KEY ("Workshop_Group_ID") REFERENCES Drama_Workshop_Groups("Workshop_Group_ID"),
    FOREIGN KEY ("Customer_ID") REFERENCES Clients("Client_ID")
);
CREATE TABLE Performers_in_Bookings (
    Order_ID NUMBER PRIMARY KEY,
    Performer_ID NUMBER,
    FOREIGN KEY ("Order_ID") REFERENCES Bookings("Booking_ID"),
    FOREIGN KEY ("Performer_ID") REFERENCES Performers("Performer_ID")
);
CREATE TABLE Customer_Orders (
    Order_ID NUMBER PRIMARY KEY,
    Customer_ID NUMBER,
    Store_ID NUMBER,
    Order_Date TIME,
    Planned_Delivery_Date TIME,
    Actual_Delivery_Date TIME,
    Other_Order_Details TEXT,
    FOREIGN KEY ("Store_ID") REFERENCES Stores("Store_ID"),
    FOREIGN KEY ("Customer_ID") REFERENCES Customers("Customer_ID")
);
CREATE TABLE Order_Items (
    Order_Item_ID NUMBER PRIMARY KEY,
    Order_ID NUMBER,
    Product_ID NUMBER,
    Order_Quantity TEXT,
    Other_Item_Details TEXT,
    FOREIGN KEY ("Product_ID") REFERENCES Products("Product_ID"),
    FOREIGN KEY ("Order_ID") REFERENCES Customer_Orders("Order_ID")
);
CREATE TABLE Invoices (
    Invoice_ID NUMBER PRIMARY KEY,
    Order_ID NUMBER,
    payment_method_code TEXT,
    Product_ID NUMBER,
    Order_Quantity TEXT,
    Other_Item_Details TEXT,
    Order_Item_ID NUMBER,
    FOREIGN KEY ("payment_method_code") REFERENCES Ref_Payment_Methods("payment_method_code"),
    FOREIGN KEY ("Order_ID") REFERENCES Bookings("Booking_ID"),
    FOREIGN KEY ("Order_ID") REFERENCES Customer_Orders("Order_ID")
)

Question: Give me all the phone numbers and email addresses of the workshop groups where services are performed.
SQL: SELECT T1.Store_Phone ,  T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID  =  T2.Workshop_Group_ID

Question: What are the names of workshop groups in which services with product name "film" are performed?
SQL: SELECT T1.Store_Phone ,  T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID  =  T2.Workshop_Group_ID WHERE T2.Product_Name  =  "film"

Question: Find the names of the workshop groups where services with product name "film" are performed.
SQL: SELECT T1.Store_Phone ,  T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID  =  T2.Workshop_Group_ID WHERE T2.Product_Name  =  "film"

Question: What are the different product names? What is the average product price for each of them?
SQL: SELECT Product_Name ,  avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name

Question: For each distinct product name, show its average product price.
SQL: SELECT Product_Name ,  avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name

Question: What are the product names with average product price smaller than 1000000?
SQL: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price)  <  1000000

Question: Find the product names whose average product price is below 1000000.
SQL: SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price)  <  1000000

Question: What are the total order quantities of photo products?
SQL: SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID  =  T2.Product_ID WHERE T2.Product_Name  =  "photo"

Question: Compute the total order quantities of the product "photo".
SQL: SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID  =  T2.Product_ID WHERE T2.Product_Name  =  "photo"

Question: What are the order details of the products with price higher than 2000?
SQL: SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID  =  T2.Product_ID WHERE T2.Product_price  >  2000

Question: Find the order detail for the products with price above 2000.
SQL: SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID  =  T2.Product_ID WHERE T2.Product_price  >  2000

Question: What are the actual delivery dates of orders with quantity 1?
SQL: SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID  =  T2.Order_ID WHERE T2.Order_Quantity  =  1

Question: List the actual delivery date for all the orders with quantity 1
SQL: SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID  =  T2.Order_ID WHERE T2.Order_Quantity  =  1

Question: What are the order dates of orders with price higher than 1000?
SQL: SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID  =  T2.Order_ID JOIN Products AS T3 ON T2.Product_ID  =  T3.Product_ID WHERE T3.Product_price  >  1000

Question: Find the order dates of the orders with price above 1000.
SQL: SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID  =  T2.Order_ID JOIN Products AS T3 ON T2.Product_ID  =  T3.Product_ID WHERE T3.Product_price  >  1000

Question: How many distinct currency codes are there for all drama workshop groups?
SQL: SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups

Question: Find the number of distinct currency codes used in drama workshop groups.
SQL: SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups

Question: What are the names of the drama workshop groups with address in Feliciaberg city?
SQL: SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T1.City_Town  =  "Feliciaberg"