db_id stringclasses 66 values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66 values |
|---|---|---|---|---|
retail_world | Identify the total number of orders placed by the customer 'Laughing Bacchus Wine Cellars' and it's average value. | 'Laughing Bacchus Wine Cellars' refers to CompanyName; calculation = DIVIDE(SUM(UnitPrice * Quantity * SUBTRACT(1, Discount)), COUNT(OrderID)) | SELECT COUNT(T2.OrderID) , SUM(T3.UnitPrice * T3.Quantity * (1 - T3.Discount)) / COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID WHERE T1.CompanyName = 'Laughing Bacchus Wine Cellars' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among the players from the ABA league, how many of them have the center position? | "ABA" is the lgID; center position refers to pos = 'C' or pos = 'F-C'; players refers to playerID | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'ABA' AND (T1.pos = 'C' OR T1.pos = 'F-C') | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | Please list the names of all the customers who had ordered the product "Telescoping Adjustable Floor Lamp". | "Telescoping Adjustable Floor Lamp" is a product name; names of all the customers refers to "Customer Name" | SELECT DISTINCT T1.`Customer 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 T3.`Product Name` = 'Telescoping Adjustable Floor Lamp' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | How many allergies does Mrs. Saundra Monahan have? | allergies refer to PATIENT from allergies; | SELECT COUNT(DISTINCT T2.code) FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Saundra' AND T1.last = 'Monahan' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | Describe the average income per month and yearly income of the geographic ID in which customer of ID "209556" and "290135". | the average income per month refers to INCOME_K; yearly income of geographic ID refers to GEOID where MULTIPLY(INHABITANTS_K, INCOME_K, 12); | SELECT T2.INCOME_K, T2.INHABITANTS_K * T2.INCOME_K * 12 FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.ID = 209556 OR T1.ID = 290135 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
world | How many countries have Socialistic Republic form of government? | Socialistic Republic form of government refers to GovernmentForm = 'Socialistic Republic'; | SELECT COUNT(Code) FROM Country WHERE GovernmentForm = 'Socialistic Republic' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | Name products and their quantity ordered by the company 'GROSELLA-Restaurante' in the sales order that was processed by Nancy Davolio. | name products refers to ProductName; 'GROSELLA-Restaurante' refers to CompanyName; 'Nancy Davolio' is the full name of an employee; full name refers to FirstName, LastName; | SELECT T4.ProductName, T3.Quantity FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID INNER JOIN Customers AS T5 ON T2.CustomerID = T5.CustomerID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio' AND T5.CompanyName = 'GROSELLA-Restaurante' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
software_company | Find the response status to customer whose geographic ID of 134. | GEOID = 134; | SELECT T2.RESPONSE FROM Customers AS T1 INNER JOIN mailings3 AS T2 ON T1.ID = T2.REFID WHERE T1.GEOID = 134 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
world | What is the local name of Ukraine that they are also known for? | Ukraine is a name of country; | SELECT LocalName FROM Country WHERE Name = 'Ukraine' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | Calculate the total number of orders placed by the company 'GROSELLA-Restaurante'. | 'GROSELLA-Restaurante' refers to CompanyName; | SELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.CompanyName = 'GROSELLA-Restaurante' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Which teams have winning rate less than 50%? | team with winning rate less than 50% refers to Divide (won, Sum(won, lost)) < 0.5 | SELECT name FROM teams WHERE CAST(won AS REAL) * 100 / (won + lost) < 50 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | Please list the names of all the products ordered by Aimee Bixby in 2016. | ordered by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; ordered n 2016 refers to strftime('%Y', "Order Date") = '2016'; | 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` = 'Aimee Bixby' AND STRFTIME('%Y', T2.`Ship Date`) = '2016' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | What is the most common condition among the patients who received influenza seasonal injectable preservative free immunization? | the most common condition refers to MAX(DESCRIPTION) from conditions; patients who received influenza seasonal injectable preservative free immunization refer to PATIENT where DESCRIPTION = 'Influenza seasonal injectable preservative free' from immunizations; | SELECT T2.DESCRIPTION FROM immunizations AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.DESCRIPTION = 'Influenza seasonal injectable preservative free' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1 | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | Among the geographic ID which has 33.658K of inhabitants, describe the education, occupation and age of female widow. | geographic ID which has 33.658K of inhabitants refers to GEOID where INHABITANTS_K = 33.658; education refers to EDUCATIONNUM; female widow refers to SEX = 'Female' where MARITAL_STATUS = 'Widowed'; | SELECT T1.EDUCATIONNUM, T1.OCCUPATION, T1.age FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INHABITANTS_K = 33.658 AND T1.SEX = 'Female' AND T1.MARITAL_STATUS = 'Widowed' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Provide the full name of the employee who processed the sales order with ID 10274. | full name refers to FirstName, LastName; sales order with ID 10274 refers to OrderID = 10274 | SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10274 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
superstore | Among the customers who have ordered the product "Telescoping Adjustable Floor Lamp", how many of them are consumers? | "Telescoping Adjustable Floor Lamp" is a "Product Name"; consumers refers to Segment = 'Consumer'; | SELECT COUNT(DISTINCT T1.`Customer 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 T3.`Product Name` = 'Telescoping Adjustable Floor Lamp' AND T1.Segment = 'Consumer' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
software_company | Find out the yearly income of geographic ID when the customer is female and occupation as sales. | yearly income of geographic ID refers to GEOID where MULTIPLY(INHABITANTS_K, INCOME_K, 12); SEX = 'Female'; | SELECT T2.INHABITANTS_K * T2.INCOME_K * 12 FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.OCCUPATION = 'Sales' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Find the percentage of discontinued products in Northwind's portfolio of products. | discontinued products refers to Discontinued = 1; calculation = DIVIDE(SUM(Discontinued = 1), COUNT(ProductID)) * 100 | SELECT CAST(COUNT(CASE WHEN Discontinued = 1 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(ProductID) FROM Products | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Who are the coaches for team with winning rate of 80% and above? | winning rate of 80% and above refers to Divide (won, Sum(won, lost)) > 0.8; coaches refers to coachID | SELECT coachID FROM coaches GROUP BY tmID, coachID, won, lost HAVING CAST(won AS REAL) * 100 / (won + lost) > 80 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | What is the age of the patient with hypertension named Giovanni Russel? | age refers to SUBTRACT(strftime('%Y', deathdate), strftime('%Y', birthdate)); hypertension refers to conditions where DESCRIPTION = 'Hypertension'; | SELECT strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) AS age FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Giovanni' AND T2.last = 'Russel' AND T1.DESCRIPTION = 'Hypertension' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | Point out the greater one between the number of actual responding and not responding to mailing. | COUNT(REFID where RESPONSE = 'true')>or<COUNT(REFID where RESPONSE = 'false'); | SELECT RESPONSE FROM Mailings1_2 GROUP BY RESPONSE ORDER BY COUNT(RESPONSE) DESC LIMIT 1 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | What is the average value of the sales order? | calculation = DIVIDE(SUM(UnitPrice * Quantity * SUBTRACT(1, Discount)), COUNT(OrderID)) | SELECT SUM(UnitPrice * Quantity * (1 - Discount)) / COUNT(OrderID) FROM `Order Details` | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among the players that went to high school in New York and have won the MVP, what is their average height? | high school in New York refers to highSchool like '%New York%'; won the MVP refers to award = 'Most Valuable Player'; average height = Divide (Sum(height), Count(playerID)) | SELECT AVG(T1.height) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' AND T1.birthCity = 'New York' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | How many orders has Aimee Bixby made? | Aimee Bixby made refers to "Customer Name" = 'Aimee Bixby'; | 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` = 'Aimee Bixby' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | How many Asian female patients take oxaliplatin 5 MG/ML [Eloxatin]? | female refers to gender = 'F'; oxaliplatin 5 MG/ML [Eloxatin] refers to medications where DESCRIPTION = 'oxaliplatin 5 MG/ML [Eloxatin]'; | SELECT COUNT(DISTINCT T2.patient) FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'oxaliplatin 5 MG/ML [Eloxatin]' AND T2.race = 'asian' AND T2.gender = 'F' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | What is the geographic ID and total income per year when the average income is above 3300 dollar. | total income per year refers to MULTIPLY(12, INHABITANTS_K, INCOME_K) where INCOME_K > 3300; geographic ID refers to GEOID; | SELECT GEOID, INHABITANTS_K * INCOME_K * 12 FROM Demog WHERE INCOME_K > 3300 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Identify the number of employees in Northern sales region. | Northern sales region refers to RegionDescription = 'Northern' | SELECT COUNT(T2.EmployeeID) FROM Territories AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.TerritoryID = T2.TerritoryID INNER JOIN Region AS T3 ON T1.RegionID = T3.RegionID WHERE T3.RegionDescription = 'Northern' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | How many total minutes has the Brooklyn-born player, known by the name of Superman, played during all of his NBA All-Star seasons? | "Brooklyn" is the birthCity of player; known by the name of Superman refers to nameNick like '%Superman%'; total minutes refers to Sum(minutes) | SELECT SUM(T2.minutes) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Brooklyn' AND T1.nameNick LIKE '%Superman%' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | What is the total quantity of "Telescoping Adjustable Floor Lamp" ordered from central superstores? | "Telescoping Adjustable Floor Lamp" is a "Product Name"; from central superstores refers to Region = 'Central'; | SELECT SUM(T1.Quantity) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Telescoping Adjustable Floor Lamp' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
software_company | What is the ratio of male and female among the age of teenager when the education is above 10? | ratio = DIVIDE(COUNT(SEX = 'Male' where age BETWEEN 13 AND 19 and EDUCATIONNUM > 10),COUNT(SEX = 'Female' where age BETWEEN 13 AND 19 and EDUCATIONNUM > 10)); | SELECT CAST(SUM(CASE WHEN SEX = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN SEX = 'Female' THEN 1 ELSE 0 END) FROM Customers WHERE age BETWEEN 13 AND 19 AND EDUCATIONNUM > 10 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Identify the customer, which placed the largest order in terms of value. | value refers to SUM(UnitPrice * Quantity * SUBTRACT(1, Discount)); the largest order in value refers to MAX(value) | SELECT T1.CompanyName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID GROUP BY T2.CustomerID ORDER BY SUM(T3.UnitPrice * T3.Quantity * (1 - T3.Discount)) DESC LIMIT 1 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
synthea | Calculate the average period of Mr. Wesley Lemke's care plans. | DIVIDE(SUBTRACT(stop time - start time), COUNT(ID))); | SELECT CAST(SUM(strftime('%J', T2.STOP) - strftime('%J', T2.START)) AS REAL) / COUNT(T1.patient) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Wesley' AND T1.last = 'Lemke' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | List the income and number of inhabitants of customers with a reference ID greater than the 50% of average of number of false response? | reference ID greater than the 50% of average of number of false response refers to REFID > DIVIDE(MULTIPLY(0.5, COUNT(RESPONSE = 'false')), COUNT(RESPONSE)); income refers to INCOME_K; number of inhabitants refer to INHABITANTS_K; | SELECT T2.INCOME_K, T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID INNER JOIN Mailings1_2 AS T3 ON T1.ID = T3.REFID WHERE T3.REFID > ( SELECT 0.5 * COUNT(CASE WHEN RESPONSE = 'false' THEN 1 ELSE NULL END) / COUNT(RESPONSE) FROM Mailings1_2 ) | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Identify the name and product category for the most expensive and the least expensive products. | name of product refers to ProductName; category of product refers to CategoryName; the most expensive products refers to MAX(UnitPrice); the least expensive products refers to MIN(UnitPrice); | SELECT T2.ProductName, T1.CategoryName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.UnitPrice IN (( SELECT MIN(UnitPrice) FROM Products ), ( SELECT MAX(UnitPrice) FROM Products )) | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Please list the top ten teams with the highest scores in 2000. | in 2000 refers to year = 2000; team with highest score refers to Max(o_fgm) | SELECT tmID FROM players_teams WHERE year = 2000 GROUP BY tmID ORDER BY SUM(PostPoints) DESC LIMIT 10 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | State the prevalence rate of condition no. 368581000119106. | condition no. 368581000119106 refers to conditions where CODE = '368581000119106'; | SELECT DISTINCT T1."PREVALENCE RATE" FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) WHERE T2.code = '368581000119106' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | In male customers with an occupation handlers or cleaners, what is the percentage of customers with a true response? | DIVIDE(COUNT(OCCUPATION = 'Handlers-cleaners', SEX = 'Male' and RESPONSE = 'true'), COUNT(OCCUPATION = 'Handlers-cleaners' and SEX = 'Male')) as percentage; | SELECT CAST(SUM(CASE WHEN T2.RESPONSE = 'true' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(T2.REFID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.OCCUPATION = 'Handlers-cleaners' AND T1.SEX = 'Male' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Calculate the production volume of the dairy product 'Mascarpone Fabioli'. | 'Mascarpone Fabioli' is a ProductName; calculation = SUM(UnitsInStock, UnitsOnOrder) | SELECT SUM(UnitsInStock + UnitsOnOrder) FROM Products WHERE ProductName = 'Mascarpone Fabioli' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | In which league did the player who weighs 40% less than the heaviest player and whose height is 80 inches play? | weigh 40% less than the heaviest player refers to weight = Multiply(Max (weight), 0.6); league refers to lgID | SELECT T2.lgID FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID GROUP BY T2.lgID, T1.weight HAVING T1.weight = MAX(T1.weight) - MAX(T1.weight) * 0.4 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | Please list the IDs of the orders made by Aimee Bixby with more than 3 kinds of products ordered. | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; with more than 3 kinds of products ordered refers to count("Product ID") > 3; | SELECT 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` = 'Aimee Bixby' GROUP BY T2.`Product ID` HAVING COUNT(T2.`Product ID`) > 3 | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | Give the procedure description of Ms. Jacquelyn Shanahan on 2009/8/9. | on 2009/8/9 refers to DATE = '2009-08-09'; | SELECT DISTINCT T2.description FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' AND T2.DATE = '2009-08-09' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | What is the occupation and response of female customers within the number of inhabitants range of 20 to 25? | female customers within the number of inhabitants range of 20 to 25 refer to SEX = 'Female' where INHABITANTS_K BETWEEN 20 AND 25; | SELECT DISTINCT T1.OCCUPATION, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.SEX = 'Female' AND T3.INHABITANTS_K >= 20 AND T3.INHABITANTS_K <= 25 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Identify the name of the most popular dairy product in terms of reorder quantity. | 'dairy product' refers to CategoryName; most popular reorder quantity refers to MAX(ReorderLevel) | SELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Dairy Products' AND T2.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products ) | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
superstore | Among all the orders made by Aimee Bixby, what was the longest shipment time? | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; longest shipment time refers to MAX(SUM(SUTRACT(julianday("Ship Date"), julianday("Order Date")), 1)) | SELECT MAX(strftime('%J', `Ship Date`) - strftime('%J', `Order Date`)) AS longestTimeDays FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | Why did Mrs. Annabelle Pouros take leucovorin 100 mg injection on 1970/12/19? State the reason. | reason why take leucovorin 100 mg injection refers to REASONDESCRIPTION where DESCRIPTION = 'Leucovorin 100 MG Injection'; on 1970/12/19 refers to START = '1970-12-19'; | SELECT T2.reasondescription FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Annabelle' AND T1.last = 'Pouros' AND T2.start = '1970-12-19' AND T2.description = 'Leucovorin 100 MG Injection' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | Among the divorced male customers, give the income and response of those who has an level of education of 6 and above. | divorced male customers refer to SEX = 'Male' where MARITAL_STATUS = 'Divorced'; | SELECT DISTINCT T3.INCOME_K, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.EDUCATIONNUM > 6 AND T1.SEX = 'Male' AND T1.MARITAL_STATUS = 'Divorced' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Under the in-charge of inside sales coordinator, provide the product lists which were shipped to Mexico in 1996. | shipped to Mexico refers to ShipCountry = 'Mexico'; in 1996 refers to year(ShippedDate) = 1996; charge of inside sales coordinator refers to Title = 'Inside Sales Coordinator' | SELECT T4.ProductName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID WHERE T1.Title = 'Inside Sales Coordinator' AND T2.ShippedDate LIKE '1996%' AND T2.ShipCountry = 'Mexico' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among the players who have won the award of Rookie of the year, what is the height of the tallest player? | "Rookie of the Year" is the award; tallest player refers to Max(height) | SELECT T1.height FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' ORDER BY T1.height DESC LIMIT 1 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | Who is the customer who purchased the largest total cost of products in a single order? | largest total cost refers to MAX(SUTRACT(MULTIPLY(DIVIDE(Sales, SUTRACT(1, discount)), Quantity), Profit)) | SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` GROUP BY T1.`Order ID`, T2.`Customer Name` ORDER BY SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) DESC LIMIT 1 | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | What is the prevalence percentage of condition no. 64859006? | condition no. 64859006 refers to conditions where CODE = '64859006'; | SELECT DISTINCT T1."PREVALENCE PERCENTAGE" FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) WHERE T2.code = '64859006' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | What is the age of female customers within the number of inhabitants below 30? | female customers within the number of inhabitants below 30 refer to SEX = 'Female' where INHABITANTS_K < 30; | SELECT age FROM Customers WHERE GEOID IN ( SELECT GEOID FROM Demog WHERE INHABITANTS_K < 30 ) AND SEX = 'Female' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Describe the ordered products which were the most overdue from required date. | the most overdue from required date refers to MIN(SUBTRACT(ShippedDate, RequiredDate) < 0) | SELECT DISTINCT T3.ProductName FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE DATEDIFF(T1.ShippedDate, T1.RequiredDate) < 0 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
synthea | List the procedures received by Emmy Waelchi. | procedures refer to DESCRIPTION from procedures; | SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Emmy' AND T1.last = 'Waelchi' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | List the marital status and response of female customers with an level of education of 8 and above. | female customers with an level of education of 8 and above refer to SEX = 'Female' where EDUCATIONNUM ≥ 8; | SELECT DISTINCT T1.MARITAL_STATUS, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.EDUCATIONNUM > 8 AND T1.SEX = 'Female' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Provide Speedy Express's phone number and number of shipped orders on 30th January, 1998. | Speedy Express's refers to CompanyName = 'Speedy Express'; orders on 30th January, 1998 refers to ShippedDate = '1998-01-30 00:00:00' | SELECT T2.Phone, COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Speedy Express' AND T1.ShippedDate LIKE '1998-01-30%' GROUP BY T2.Phone | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
software_company | What is the income of female customers ages from 30 to 55 years old and has an occupation of machine-op-inspct? | female customers ages from 30 to 55 years old refer to SEX = 'Female' where age BETWEEN 30 AND 55; income refers to INCOME_K; | SELECT T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.age >= 30 AND T1.age <= 55 AND T1.OCCUPATION = 'Machine-op-inspct' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Among the products under grains/cereals category, provide the contact person and title of the supplier with one digit ID. | grains/cereals category refers to CategoryName = 'Grains/Cereals'; supplier with one digit ID refers to SupplierID between 1 and 10; | SELECT DISTINCT T1.ContactName, T1.ContactTitle FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Grains/Cereals' AND T1.SupplierID BETWEEN 1 AND 10 LIMIT 1 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Please list the birth date of the player who has won the most MVPs. | won the most MVP refers to Max(Count(award = 'Most Valuable Player')) | SELECT T1.birthDate FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' GROUP BY T1.playerID, T1.birthDate ORDER BY COUNT(award) DESC LIMIT 1 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
software_company | List the educationnum and response of customers within the age of 20 to 30 that has the highest number of inhabitants among the group. | age of 20 to 30 refers to age BETWEEN 20 AND 30; the highest number of inhabitants refers to MAX(INHABITANTS_K); | SELECT T1.EDUCATIONNUM, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.age >= 20 AND T1.age <= 30 ORDER BY T3.INHABITANTS_K DESC LIMIT 1 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Provide the list of products ordered by ID 10979 and calculate its total payment. | ordered by ID 10979 refers to OrderID = '10979'; total payment refers to SUM(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount))) | SELECT T1.ProductName , SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10979 GROUP BY T1.ProductName | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among the players born in Whitestone, how many of them have won the MVP? | "Whitestone" is the birthCity of the player; won the MVP refers to award = 'Most Valuable Player' | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' AND T1.birthCity = 'Houston' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | Please list the names of all the products ordered in order CA-2011-112326 in superstores in the center. | names of all the products refers to "Product Name"; order CA-2011-112326 refers to "Order ID" = 'CA-2011-112326'; in the center refers to Region = 'Central'; | SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-112326' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
software_company | In male customers ages from 30 to 50, how many of them has an income ranges from 2000 to 2300? | male customers ages from 30 to 50 refer to SEX = 'Male' where age BETWEEN 30 AND 50; income ranges from 2000 to 2300 refers to INCOME_K BETWEEN 2000 AND 3000; | SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T1.age >= 30 AND T1.age <= 50 AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 2300 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Mention the supplier country of Ipoh Coffee and the order ID which had maximum in total payment. | Ipoh Coffee refers to ProductName = 'Ipoh Coffee'; maximum in total payment refers to MAX(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount))) | SELECT T3.Country, T1.OrderID FROM `Order Details` AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Suppliers AS T3 ON T2.SupplierID = T3.SupplierID WHERE T2.ProductName = 'Ipoh Coffee' ORDER BY T1.UnitPrice * T1.Quantity * (1 - T1.Discount) DESC LIMIT 1 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Please list the name of the coach who has served more than 2 NBA teams. | "NBA" is the lgID; server more than 2 teams refers to Count(tmID) = 2 | SELECT coachID FROM coaches GROUP BY coachID HAVING COUNT(DISTINCT tmID) > 2 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | What is the code of the prevalent disease with the highest occurrences? | null | SELECT T2.code FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON T1.ITEM = T2.DESCRIPTION ORDER BY T1.OCCURRENCES DESC LIMIT 1 | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | List the level of education and income of customers ages from 30 to 55 with a true response. | ages from 30 to 55 refer to age BETWEEN 30 AND 55; RESPONSE = 'true'; income refers to INCOME_K; education level refers to EDUCATIONNUM; | SELECT T1.EDUCATIONNUM, T3.INCOME_K FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.age >= 30 AND T1.age <= 55 AND T2.RESPONSE = 'true' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Among the supplied products from Australia, describe the discontinued products and the category. | from Australia refers to Country = 'Australia'; discontinued products refers to Discontinued = 1; | SELECT T2.ProductName, T3.CategoryName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T1.Country = 'Australia' AND T2.Discontinued = 1 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | For the players who belongs to the east conference, please list the name of the college they went to. | belong to the east conference refers to divID = 'EA' | SELECT DISTINCT T1.college FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.conference = 'East' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | Provide the number of encounters for Major D'Amore. | null | SELECT COUNT(T2.ID) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Major' AND T1.last = 'D''Amore' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | Among the female customers with an level of education of 3 and below, list their income. | female customers with level of education of 3 and below refer to SEX = 'Female' where EDUCATIONNUM ≤ 3; income refers to INCOME_K; | SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND SEX = 'Female' ) | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Calculate the total production for each product which were supplied from Japan | from Japan refers to Country = 'Japan'; total production refers to ADD(UnitsInstock, UnitsOnOrder) | SELECT SUM(T1.UnitsInStock + T1.UnitsOnOrder) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among the players from the NBL league, how many of them were born in Spencer? | "NBL" is the lgID; 'Spencer' is the birthCity | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Spencer' AND T2.lgID = 'NBL' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
software_company | What is the response and number of inhabitants of the oldest female customer? | number of inhabitants refers to INHABITANTS_K; oldest female customer refers to SEX = 'Female' where MAX(age); | SELECT T2.RESPONSE, T3.INHABITANTS_K FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.SEX = 'Female' ORDER BY T1.age DESC LIMIT 1 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Find the total payment of the orders by customers from San Francisco. | from San Francisco refers to City = 'San Francisco'; total payment refers to sum(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount))) | SELECT SUM(T3.UnitPrice * T3.Quantity * (1 - T3.Discount)) AS TOTALPAYMENT FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID WHERE T1.City = 'San Francisco' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | What is the maximum weight of USA all-star players? | "USA" is the birthCountry of player; maximum weight refers to Max(weight) | SELECT MAX(T1.weight) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'USA' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | Provide at least 5 social security numbers of patients with a prevalent disease with a prevalence percentage lower than 30% of the average prevalence percentage of conditions. | social security number refers to ssn; prevalence percentage lower than 30% of the average prevalence percentage of conditions refers to PREVALENCE PERCENTAGE < MULTIPLY(0.3, AVG(PREVALENCE PERCENTAGE)); | SELECT DISTINCT T2.ssn FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN all_prevalences AS T3 ON lower(T1.DESCRIPTION) = lower(T3.ITEM) WHERE CAST(T3."PREVALENCE PERCENTAGE" AS REAL) * 100 / ( SELECT AVG('PREVALENCE PERCENTAGE') FROM all_prevalences ) < 30 LIMIT 5 | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | List down the number of inhabitants of customers with a widowed marital status and false response . | number of inhabitants refers to INHABITANTS_K; RESPONSE = 'false'; | SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.MARITAL_STATUS = 'Widowed' AND T2.RESPONSE = 'true' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Calculate the average payment per product under confections category. | under confections category refers to CategoryName = 'Confections'; | SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) / COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Categories AS T3 ON T1.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Confections' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | What is the minimum weight of all-star players coming from UCLA college? | minimum weight refers to Min(weight) | SELECT MIN(T1.weight) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.college = 'UCLA' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | Give the social security number of the female Irish patient allergic to grass pollen. | social security number refers to ssn; female refers to gender = 'F'; Irish refers to ethnicity = 'irish'; allergic to grass pollen refers to allergies where DESCRIPTION = 'Allergy to grass pollen'; | SELECT T2.ssn FROM allergies AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Allergy to grass pollen' AND T2.ethnicity = 'irish' AND T2.gender = 'F' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | What is the marital status of the customer ages 62 with an level of education of 7? | customer ages 62 with an level of education of 7 refer age = 62 where EDUCATIONNUM = 7; | SELECT DISTINCT MARITAL_STATUS FROM Customers WHERE EDUCATIONNUM = 7 AND age = 62 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | List down the territory IDs and descriptions existed in Southern region. | in Southern region refers to RegionDescription = 'Southern'; | SELECT T1.TerritoryID, T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among players who were born after 1950, who had offence rebounds rates more than 30%? Please list their last names and first names. | born after 1950 refers to birthDate > = '1950-01-01'; offence rebound rate more than 30% refers to Divide (oRebounds, rebounds) > 0.3 | SELECT DISTINCT T1.lastName, T1.firstName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthDate > 1950 AND CAST(T2.o_rebounds AS REAL) * 100 / T2.rebounds > 30 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
software_company | In geographic identifier from 10 to 30, how many of them has an income below 2000? | GEOID BETWEEN 10 AND 30; INCOME_K < 2000; | SELECT COUNT(GEOID) FROM Demog WHERE INCOME_K < 2000 AND GEOID >= 10 AND GEOID <= 30 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Mention the oldest empoyee's full name, title, salary and number of orders which were shipped to USA by him. | full name refers to FirstName, LastName; shipped to USA refers to ShipCountry = 'USA' | SELECT T1.FirstName, T1.LastName, T1.Title, T1.Salary , COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE ShipCountry = 'USA' GROUP BY T1.FirstName, T1.LastName, T1.Title, T1.Salary, T1.BirthDate ORDER BY T1.BirthDate LIMIT 1 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among the players who went to high school in Chicago, how many of them belongs to the west conference? | high school in Chicago refers to hsCity = 'Chicago'; belong to the west conference refers to divID = 'WE' | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.hsCity = 'Chicago' AND T2.conference = 'West' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
software_company | List down the geographic identifier with an number of inhabitants less than 30. | geographic identifier with an number of inhabitants less than 30 refers to GEOID where INHABITANTS_K < 30; | SELECT GEOID FROM Demog WHERE INHABITANTS_K < 30 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Among orders shipping to Brazil, mention the supplier company of the order which was done by employee Anne Dodsworth in December, 1996 . | shipping to Brazil refers to ShipCountry = 'Brazil'; in December, 1996 refers to year(OrderDate) = 1996 and month(OrderDate) = 12; | SELECT T5.CompanyName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID INNER JOIN Suppliers AS T5 ON T4.SupplierID = T5.SupplierID WHERE T1.FirstName = 'Anne' AND T1.LastName = 'Dodsworth' AND T2.ShipCountry = 'Brazil' AND T2.OrderDate LIKE '1996-12%' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | From 1960 to 1970, what is the total point of all-star players who are still alive? | from 1960 to 1970 refers to season_id between 1960 and 1970; still alive refers to deathDate = '0000-00-00' | SELECT SUM(T2.points) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id BETWEEN 1960 AND 1970 AND T1.deathDate = '0000-00-00' | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | Among the orders made by Aimee Bixby, how many of them included at least one kind of product under the category "Furniture"? | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; | SELECT COUNT(DISTINCT T2.`Order ID`) 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 T3.Category = 'Furniture' AND T1.`Customer Name` = 'Aimee Bixby' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
software_company | What is the total number of widowed customers with an age below 50? | widowed customers with an age below 50 refer to MARITAL_STATUS = 'Widowed' where age < 50; | SELECT COUNT(ID) FROM Customers WHERE MARITAL_STATUS = 'Widowed' AND age < 50 | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Provide the products list which were ordered in 1996 by the company in Norway. | ordered in 1996 refers to year(OrderDate) = 1996; in Norway refers to Country = 'Norway' | SELECT T4.ProductName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID WHERE T1.Country = 'Norway' AND STRFTIME('%Y', T2.OrderDate) = '1996' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Among the coaches who have served more than 2 NBA teams, during which coach's period of coaching, a team has the least numbers of games lost in the post-season games? | served more than 2 NBA teams refers to count (tmID) > = 2; least number of game lost in post season refers to Min(post_losses) | SELECT coachID FROM coaches WHERE lgID = 'NBA' AND post_wins != 0 AND post_losses != 0 AND coachID IN ( SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING COUNT(tmID) > 2 ) ORDER BY post_losses ASC LIMIT 1 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
software_company | List down the customer's reference ID with true response. | reference ID refers to REFID; | SELECT REFID FROM Mailings1_2 WHERE RESPONSE = 'true' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | How many orders were made by the customers in Ireland. | in Ireland refers to Country = 'Ireland'; | SELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Country = 'Ireland' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Please list the team names which have at least 3 all-star players. | team with at least 3 all star player refers to tmID where Count(player_allstar.playerID) > = 3 | SELECT T1.tmID FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) >= 3 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
software_company | How many of the customer's reference ID that has a TRUE response? | reference ID refers to REFID; | SELECT COUNT(REFID) FROM Mailings1_2 WHERE RESPONSE = 'true' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
retail_world | Provide the list of product IDs and names under the meat/poultry category. | meat/poultry category refers to CategoryName = 'Meat/Poultry'; | SELECT T2.ProductName, T1.CategoryName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products ) | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Of all the teams coached by the winner of the 1994 NBA Coach of the Year award, which team has lost the most times playing at home? | of 1994 refers to year = 1994; 'NBA Coach of the Year' is the award; lost the most time at home refers to Max(homeLost) | SELECT T3.tmID FROM awards_coaches AS T1 INNER JOIN coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T1.year = 1994 AND T1.award = 'NBA Coach of the Year' GROUP BY T3.tmID ORDER BY SUM(T3.homeLost) DESC LIMIT 1 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.