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: What is the payment method code used by the most orders?
SQL: SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1

Question: Find the payment method that is used the most often in all the invoices. Give me its code.
SQL: SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1

Question: Which city is the address of the store named "FJA Filming" located in?
SQL: SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T2.Store_Name  =  "FJA Filming"

Question: Find the city the store named "FJA Filming" is in.
SQL: SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T2.Store_Name  =  "FJA Filming"

Question: What are the states or counties of the address of the stores with marketing region code "CA"?
SQL: SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T2.Marketing_Region_Code  =  "CA"

Question: Find the states or counties where the stores with marketing region code "CA" are located.
SQL: SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T2.Marketing_Region_Code  =  "CA"

Question: What is the name of the marketing region that the store Rob Dinning belongs to?
SQL: SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code  =  T2.Marketing_Region_Code WHERE T2.Store_Name  =  "Rob Dinning"

Question: Return the name of the marketing region the store Rob Dinning is located in.
SQL: SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code  =  T2.Marketing_Region_Code WHERE T2.Store_Name  =  "Rob Dinning"

Question: What are the descriptions of the service types with product price above 100?
SQL: SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code WHERE T2.Product_Price  >  100

Question: Give me the descriptions of the service types that cost more than 100.
SQL: SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code WHERE T2.Product_Price  >  100

Question: What is the description, code and the corresponding count of each service type?
SQL: SELECT T1.Service_Type_Description ,  T2.Service_Type_Code ,  COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code GROUP BY T2.Service_Type_Code

Question: List the description, code and the number of services for each service type.
SQL: SELECT T1.Service_Type_Description ,  T2.Service_Type_Code ,  COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code GROUP BY T2.Service_Type_Code

Question: What is the description and code of the type of service that is performed the most often?
SQL: SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1

Question: Find the description and code of the service type that is performed the most times.
SQL: SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code  =  T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1

Question: What are the phones and emails of workshop groups in which services are performed?
SQL: SELECT T1.Store_Phone ,  T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID  =  T2.Workshop_Group_ID