Dludora/DAIL-BIRD huggingface dataset:
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: What is the highest profit order in the East superstore of customers from Houston, Texas? highest profit refers to max(Profit); Houston, Texas refers to City = 'Houston' and State = 'Texas' */
SELECT 
SELECT T1.`Order ID` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.City = 'Houston' AND T2.State = 'Texas' ORDER BY T1.Profit DESC LIMIT 1
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: How many furniture products were ordered at central superstore? furniture products refers to Category = 'Furniture' */
SELECT 
SELECT COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: What are the names of the products that had been shipped in March 2013 at central superstore? names of the products refers to Product Name; shipped in March 2013 refers to "Ship Date" = '2013-03%' */
SELECT 
SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE strftime('%Y-%m', T1.`Ship Date`) = '2013-03'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: How many orders were made by customers who live in Texas at the Central superstore? customer live in Texas refers to State = 'Texas' */
SELECT 
SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.State = 'Texas'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: How many orders were made by Alan Barnes in 2015 at the Central superstore? in 2015 refers to "Order Date" = '2015%' */
SELECT 
SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Alan Barnes' AND STRFTIME('%Y', T2.`Order Date`) = '2015'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: What is the product name of order CA-2011-115791 in the East superstore? order CA-2011-115791 refers to "Order ID" = 'CA-2011-115791' */
SELECT 
SELECT DISTINCT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-141817'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: What is the percentage of orders with 0.2 discount in the Central superstore were purchased by customers who live in Texas? live in Texas refers to State = 'Texas'; percentage = divide(sum(Order ID) when Discount = 0.2, sum(Order ID)) as percentage */
SELECT 
SELECT CAST(SUM(CASE WHEN T2.Discount = 0.2 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.State = 'Texas'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: Who order from the west region on August 12, 2013, and received a discount of 0.2? Who refers to "Customer Name"; on August 12, 2013 refers to "Order Date" = '2013-08-12'; discount of 0.2 refers to discount = 0.2 */
SELECT 
SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order Date` = '2013-08-12' AND T1.Discount = 0.2 AND T1.Region = 'West'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: What is the order ID of the security-Tint Envelopes product ordered on June 3, 2013, in the Central region? Security-Tint Envelopes' refers to "Product Name"; ordered on June 3, 2013 refers to "Order Date" = '2013-06-03' */
SELECT 
SELECT DISTINCT T1.`Order ID` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Security-Tint Envelopes' AND T1.`Order Date` = '2013-06-03'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: List the product's name bought by the customer named Bill Shonely from the Central region. */
SELECT 
SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Bill Shonely' AND T2.Region = 'Central'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: Please give the name of customers from the West region that bought exactly 8 items in their purchase. name of customers refers to "Customer Name"; bought exactly 8 items refers to Quantity = 8 */
SELECT 
SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Quantity = 8 AND T1.Region = 'West'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: Among the customers from Houston, Texas, what is the total profit of their orders in the Central region? customers from Houston, Texas refers to State = 'Texas' and City = 'Houston'; total profit = sum(Profit) */
SELECT 
SELECT SUM(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.City = 'Houston' AND T1.State = 'Texas' AND T2.Region = 'Central'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: Who is the customer with an order shipped on March 5, 2013, in the eastern region? Who is the customer refers to Customer Name; shipped on March 5, 2013 refers to "Ship Date" = '2013-03-05'; eastern region refers to Region = 'East' */
SELECT 
SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Ship Date` = '2013-03-05'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: Among the orders from 2016 in the Central region, what is the product with the lowest profit? orders from 2016 refers to "Order Date" = '2016%'; product refers to "Product Name"; lowest profit refers to min(Profit) */
SELECT 
SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND STRFTIME('%Y', T1.`Order Date`) = '2016' ORDER BY T1.Profit ASC LIMIT 1
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: Who ordered the order ID CA-2011-118976 from the East region? Who refers to "Customer Name" */
SELECT 
SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order ID` = 'CA-2011-118976' AND T2.Region = 'East'
/* Given the following database schema: */
CREATE TABLE people
(
    "Customer ID"   TEXT,
    "Customer Name" TEXT,
    Segment         TEXT,
    Country         TEXT,
    City            TEXT,
    State           TEXT,
    "Postal Code"   INTEGER,
    Region          TEXT,
    primary key ("Customer ID", Region)
)

CREATE TABLE product
(
    "Product ID"   TEXT,
    "Product Name" TEXT,
    Category       TEXT,
    "Sub-Category" TEXT,
    Region         TEXT,
    primary key ("Product ID", Region)
)

CREATE TABLE central_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE east_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE south_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

CREATE TABLE west_superstore
(
    "Row ID"      INTEGER
            primary key,
    "Order ID"    TEXT,
    "Order Date"  DATE,
    "Ship Date"   DATE,
    "Ship Mode"   TEXT,
    "Customer ID" TEXT,
    Region        TEXT,
    "Product ID"  TEXT,
    Sales         REAL,
    Quantity      INTEGER,
    Discount      REAL,
    Profit        REAL,
    foreign key ("Customer ID", Region) references people("Customer ID",Region),
    foreign key ("Product ID", Region) references product("Product ID",Region)
)

/* Answer the following: Provide the product's name of the product with the highest sales in the South region. highest sales refers to max(Sales) */
SELECT 
SELECT T2.`Product Name` FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'South' ORDER BY T1.Sales DESC LIMIT 1