/* 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 name of the corporate customer from Rhode Island who had the highest number of orders in 2016 from the east superstore? corporate customer refers to Segment = 'Corporate'; Rhode Island refers to State = 'Rhode Island'; in 2016 refers to "Order Date" BETWEEN '2016-01-01' AND '2016-12-31'; east superstore refers to Region = 'East'; highest number of orders refers to max(order_number); name of corporate customer refers to "Customer Name" */
SELECT 
SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Segment = 'Corporate' AND T2.State = 'Rhode Island' AND T2.Region = 'East' AND STRFTIME('%Y', T1.`Order Date`) = '2016' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1