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: How many bookings do we have?
SQL: SELECT count(*) FROM BOOKINGS

Question: Count the total number of bookings made.
SQL: SELECT count(*) FROM BOOKINGS

Question: List the order dates of all the bookings.
SQL: SELECT Order_Date FROM BOOKINGS

Question: What is the order date of each booking?
SQL: SELECT Order_Date FROM BOOKINGS

Question: Show all the planned delivery dates and actual delivery dates of bookings.
SQL: SELECT Planned_Delivery_Date ,  Actual_Delivery_Date FROM BOOKINGS

Question: What are the planned delivery date and actual delivery date for each booking?
SQL: SELECT Planned_Delivery_Date ,  Actual_Delivery_Date FROM BOOKINGS

Question: How many customers do we have?
SQL: SELECT count(*) FROM CUSTOMERS

Question: Count the number of customers recorded.
SQL: SELECT count(*) FROM CUSTOMERS

Question: What are the phone and email for customer Harold?
SQL: SELECT Customer_Phone ,  Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name  =  "Harold"

Question: Find the phone number and email address of customer "Harold".
SQL: SELECT Customer_Phone ,  Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name  =  "Harold"

Question: Show all the Store_Name of drama workshop groups.
SQL: SELECT Store_Name FROM Drama_Workshop_Groups

Question: What are the store names of drama workshop groups?
SQL: SELECT Store_Name FROM Drama_Workshop_Groups

Question: Show the minimum, average, maximum order quantity of all invoices.
SQL: SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES

Question: What are the minimum, average, and maximum quantities ordered? Check all the invoices.
SQL: SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES

Question: What are the distinct payment method codes in all the invoices?
SQL: SELECT DISTINCT payment_method_code FROM INVOICES

Question: Show me the distinct payment method codes from the invoice record.
SQL: SELECT DISTINCT payment_method_code FROM INVOICES

Question: What is the description of the marketing region China?
SQL: SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name  =  "China"

Question: Find the marketing region description of China?
SQL: SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name  =  "China"

Question: Show all the distinct product names with price higher than the average.
SQL: SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price  >  (SELECT avg(Product_Price) FROM PRODUCTS)

Question: What are the distinct names of the products that cost more than the average?
SQL: SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price  >  (SELECT avg(Product_Price) FROM PRODUCTS)

Question: What is the name of the most expensive product?
SQL: SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1

Question: Tell me the name of the most pricy product.
SQL: SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1

Question: List all product names in ascending order of price.
SQL: SELECT Product_Name FROM Products ORDER BY Product_Price ASC

Question: Sort the names of products in ascending order of their price.
SQL: SELECT Product_Name FROM Products ORDER BY Product_Price ASC

Question: What is the phone number of the performer Ashley?
SQL: SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name  =  "Ashley"

Question: Find the phone number of performer "Ashley".
SQL: SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name  =  "Ashley"

Question: Show all payment method codes and the number of orders for each code.
SQL: SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_code

Question: List the distinct payment method codes with the number of orders made
SQL: SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_code