db_id stringclasses 66 values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66 values |
|---|---|---|---|---|
synthea | Among all the patients who once had cystitis, what was the percentage of them being married? | DIVIDE(COUNT(marital = 'M'), COUNT(patient)) as percentage where DESCRIPTION = 'Cystitis';
| SELECT CAST(SUM(CASE WHEN T1.marital = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.description = 'Cystitis' | 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 customers with an average income per inhabitant above 3000, what percentage are in their eighties? | average income per inhabitant above 3000 refers to INCOME_K > 3000; eighties refer to age BETWEEN 80 AND 89; DIVIDE(COUNT(INCOME_K > 3000 and age BETWEEN 80 AND 89), COUNT(INCOME_K > 3000 )) as percentage; | SELECT CAST(SUM(CASE WHEN T1.age BETWEEN 80 AND 89 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K > 3000 | 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 products were ordered by the customer ID "WILMK" which were required on 3/26/1998? | required on 3/26/1998 refers to RequiredDate = '1998-03-26 00:00:00'; products ordered refers to ProductName | SELECT 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 T1.RequiredDate LIKE '1998-03-26%' AND T1.CustomerID = 'WILMK' | 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 | Describe the encounter of Mr. Hubert Baumbach on 2008/10/25. | encounter refers to DESCRIPTION from encounters; on 2008/10/25 refers to DATE = '2008-10-25'; | SELECT T2.description FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Hubert' AND T1.last = 'Baumbach' AND T2.date = '2008-10-25' | 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 percentage of elderly customers who are never married in the place with geographic ID 24? | elderly customers refer to age > 65; DIVIDE(COUNT(ID where age > 65, MARITAL_STATUS = 'never married' and GEOID = 24), COUNT(ID where GEOID = 24)) as percentage; | SELECT CAST(SUM(CASE WHEN T1.MARITAL_STATUS = 'never married' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.GEOID = 24 | 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 were the products supplied by the company in Spain? | company in Spain refers to Country = 'Spain'; product supplied refers to ProductName | SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Spain' | 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 players received Rookie of the Year award from 1969 to 2010? | from 1969 to 2010 refers to year BETWEEN 1969 and 2010; 'Rookie of the Year' is the award | SELECT COUNT(playerID) FROM awards_players WHERE year BETWEEN 1969 AND 2010 AND award = 'Rookie of the Year' | 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 | Among the male customer in their twenties, how many are from places where the average income is more than 3000? | male customer in their twenties refer to SEX = 'Male' where age BETWEEN 20 AND 29; average income is more than 3000 refers to INCOME_K > 3000; | SELECT COUNT(T2.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T2.INCOME_K > 3000 AND T1.age >= 20 AND T1.age <= 29 | 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 the territory IDs, description and region description under the in-charge of Mrs. Margaret Peacock. | null | SELECT T3.TerritoryID, T3.TerritoryDescription, T4.RegionDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T1.TitleOfCourtesy = 'Mrs.' AND T1.LastName = 'Peacock' AND T1.FirstName = 'Margaret' | 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 | Provide the name of the patient who had a claim on 1947/9/11. | name of the patient implies full name and refers to first, last; on 1947/9/11 refers to BILLABLEPERIOD = '1947-09-11'; | SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T2.billableperiod = '1947-09-11' | 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 | Of customers who provide other services, how many are from places where inhabitants are more than 20000? | OCCUPATION = 'Other-service'; inhabitants are more than 20000 refer to INHABITANTS_K > 20; | SELECT COUNT(T2.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Other-service' AND T2.INHABITANTS_K > 20 | 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 contact person name, title and supplied products by "Escargots Nouveaux" company. | "Escargots Nouveaux" company refers to CompanyName = 'Escargots Nouveaux'; | SELECT T2.ContactName, T2.ContactTitle, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Escargots Nouveaux' | 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 last names and first names of all-star players whose team were ranked 1 for consecutive 3 years from 1937 to 1940. | from 1937 to 1940 refers to year between 1937 and 1940; rank 1 for 3 years refers to tmID where Count (rank = 1) > = 3 | SELECT T5.lastName, T5.firstName FROM players_teams AS T4 INNER JOIN players AS T5 ON T4.playerID = T5.playerID WHERE T4.year BETWEEN 1937 AND 1940 AND T4.tmID IN ( SELECT DISTINCT T1.tmID FROM teams AS T1 INNER JOIN teams AS T2 INNER JOIN teams AS T3 ON T1.tmID = T2.tmID AND T2.tmID = T3.tmID AND T3.year - T2.year = 1 AND T2.year - T1.year = 1 WHERE T1.rank = 1 AND T1.year BETWEEN 1937 AND 1940 ) | 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 teenagers are working as Machine-op-inspct? | teenager is a person aged between 13 and 19 years; OCCUPATION = 'Machine-op-inspct'; | SELECT COUNT(ID) teenager_number FROM Customers WHERE OCCUPATION = 'Machine-op-inspct' AND age >= 13 AND age <= 19 | 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 supplier companies, cities and products which total production amount is more than 120. | total production amount is more than 120 refers to ADD(UnitsInstock, UnitsOnOrder) > 120 | SELECT T2.CompanyName, T2.City, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitsInStock + UnitsOnOrder > 120 | 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 first name of the players from the NBA league with the forward position. | "NBA" is the lgID; with the forward position refers to pos = 'F' of pos = 'F-C' | SELECT DISTINCT T1.firstName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE (T1.pos = 'F' OR T1.pos = 'F-C') AND T2.lgID = 'NBA' | 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 | Calculate the number of customers who did not respond in February of 2007. | did not respond refers to RESPONSE = 'false'; February of 2007 refers to REF_DATE BETWEEN '2007-02-01 12:00:00.0'AND '2007-02-28 12:00:00.0'; | SELECT COUNT(REFID) custmoer_number FROM Mailings1_2 WHERE RESPONSE = 'false' AND REF_DATE BETWEEN '2007-02-01' AND '2007-02-28' | 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 all the product names and categories of the highest reorder level. | Highest reorder level refers to Max(ReorderLevel) | SELECT T2.ProductName, T1.CategoryName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID ORDER BY T2.ReorderLevel 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 | In 1937, how many teams whose players got at least 500 points? | in 1937 refers to year = 1937; player got at least 500 points refers to Sum(points) > = 500 | SELECT COUNT(*) FROM ( SELECT T2.name, SUM(T1.points) FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1937 GROUP BY T2.name HAVING SUM(points) >= 500 ) AS T3 | 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 geographic id of places where the income is above average. | geographic ID refers to GEOID; income is above average refers to INCOME_K > DIVIDE(SUM(INCOME_K), COUNT(GEOID)); | SELECT AVG(INCOME_K) FROM Demog | 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 production amount and product names which had "10 - 500 g pkgs." as quantity per unit. | total production amount refers to ADD(UnitsInstock, UnitsOnOrder) | SELECT UnitsInStock + UnitsOnOrder, ProductName FROM Products WHERE QuantityPerUnit = '10 - 500 g pkgs.' | 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 | How many care plans has Mrs. Norman Berge taken? | null | SELECT COUNT(T2.PATIENT) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Norman' AND T1.last = 'Berge' | 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 | Find and list the id and geographic ID of the elderly customers with an education level below 3. | elderly customers with an education level below 3 refer to age > 65 where EDUCATIONNUM < 3; geographic ID refers to GEOID; | SELECT ID, GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND age > 65 | 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 all the customer company names and cities located in Canada. | located in Canada refers to Country = 'Canada' | SELECT CompanyName, City FROM Customers WHERE Country = 'Canada' | 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 | According to all the observations of Elly Koss, what was her average weight? | DIVIDE(SUM(VALUE), COUNT(VALUE)) WHERE DESCRIPTION = 'Body Weight'; | SELECT AVG(T2.VALUE), T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Body Weight' | 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 customers with marital status of never married, what is the percentage of customers with income of 2500 and above? | DIVIDE(COUNT(INCOME_K ≥ 2500 where MARITAL_STATUS = 'Never-married'), COUNT(INCOME_K where MARITAL_STATUS = 'Never-married')) as percentage; | SELECT CAST(SUM(CASE WHEN T2.INCOME_K > 2500 THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.MARITAL_STATUS = 'Never-married' | 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 the full name of employees and titles who have to report to Sales Manager. | Sales Manager refers to Title = 'Sales Manager'; full name refers to FirstName, LastName | SELECT FirstName, LastName, Title FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE Title = 'Sales Manager' ) | 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 1950 to 1970, what is the maximum point of players whose teams were ranked 1? | from 1950 to 1970 refers to year between 1950 and 1970; team with rank 1 refers to rank = 1; maximum point refers to Max(points) | SELECT MAX(T2.points) FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 1950 AND 1970 AND T1.rank = 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 income and number of inhabitants of customers with an age greater than the 80% of average age of all customers? | age greater than the 80% of average age refers to age > (AVG(age) * 0.8); income refers to INCOME_K; number of inhabitants refers to INHABITANTS_K; | SELECT T2.INCOME_K, T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID GROUP BY T2.INCOME_K, T2.INHABITANTS_K HAVING T1.age > 0.8 * AVG(T1.age) | 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 customer company names, addresses, phones and faxes which are located in London. | in London refers to City = 'London' | SELECT CompanyName, Address, Phone, Fax FROM Customers WHERE City = 'London' | 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 teams that were ranked 3 from 1937 to 1940, what is the team name whose players had the highest point? | from 1937 to 1940 refers to year between 1937 and 1940; player with highest point refers to Max(points) | SELECT DISTINCT T1.name FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.rank = 3 AND T1.year BETWEEN 1937 AND 1940 ORDER BY T2.points 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
); |
synthea | What kind of condition did Keven Kuhn have from 2016/9/24 to 2016/10/10? Describe the condition. | kind of condition refers to DESCRIPTION from conditions; from 2016/9/24 to 2016/10/10 refers to START = '2016-09-24' and STOP = '2016-10-10'; | SELECT T2.description FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.start = '2016-09-24' AND T2.stop = '2016-10-10' | 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 female customers ages from 50 to 60, how many of them has an number of inhabitants ranges from 19 to 24? | female customers ages from 50 to 60 refer to SEX = 'Female' where age BETWEEN 50 AND 60; number of inhabitants ranges from 19 to 24 refers to INHABITANTS_K BETWEEN 19 AND 24; | SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.age >= 50 AND T1.age <= 60 AND T2.INHABITANTS_K >= 19 AND T2.INHABITANTS_K <= 24 | 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 the employees' full names and ages in 2022 who lived in London. | in London refers to City = 'London'; ages in 2022 refers to SUBTRACT(2022, year(BirthDate)); full names refers to FirstName, LastName | SELECT TitleOfCourtesy, FirstName, LastName , TIMESTAMPDIFF(YEAR, BirthDate, NOW()) AS ages FROM Employees WHERE City = 'London' | 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 three shortest black players. | shortest player refers to Min(height); black players refers to race = 'B' | SELECT firstName, lastName FROM players WHERE race = 'B' AND height > 0 ORDER BY height ASC LIMIT 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
); |
synthea | Name the patients who had an allergy to soy. | allergy to soy refers to allergies where DESCRIPTION = 'Allergy to soya'; | SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Allergy to soya' | 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 customers with a marital status of married-civ-spouse, list the number of inhabitants and age of those who are machine-op-inspct. | OCCUPATION = 'Machine-op-inspct'; number of inhabitants refers to INHABITANTS_K; | SELECT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Farming-fishing' AND T1.SEX = 'Male' AND T1.age >= 20 AND T1.age <= 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 | List the supplier company names located in Germany. | located in Germany refers to Country = 'Germany'; | SELECT CompanyName FROM Suppliers WHERE Country = 'Germany' | 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 average weight of the players who have won the award of Rookie of the year? | "Rookie of the Year" is the award; average weight = Divide (Sum(weight), Count(playerID)) | SELECT AVG(T1.weight) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' | 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 | Who had to take Clopidogrel 75 MG Oral Tablet for over 10 years? | Who implies the full name of the patient which refers to first, last; Clopidogrel 75 MG Oral Tablet refers to medications where DESCRIPTION = 'Clopidogrel 75 MG Oral Tablet'; for over 10 years refers to SUBTRACT(strftime('%Y', STOP), strftime('%Y', START)) > 10; | SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Clopidogrel 75 MG Oral Tablet' AND strftime('%Y', T2.STOP) - strftime('%Y', T2.START) > 10 | 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 number of inhabitants of male customers ages from 20 to 30 years old who are farming or fishing? | male customers ages from 20 to 30 years old refer to SEX = 'Male' where age BETWEEN 20 AND 30; farming or fishing refers to OCCUPATION; number of inhabitants refers to INHABITANTS_K; | SELECT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Farming-fishing' AND T1.SEX = 'Male' AND T1.age >= 20 AND T1.age <= 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 | Write down the full name of Vie President of Sales and his age when he was hired. | Vice President of Sales refers to Title = 'Vice President, Sales'; | SELECT FirstName, LastName , TIMESTAMPDIFF(YEAR, BirthDate, HireDate) AS AGE FROM Employees WHERE Title = 'Vice President, Sales' | 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 field goals did George Mikan make overall between 1951 and 1953? | between 1951 and 1953 refers to season_id; field goal refers to fg_made | SELECT COUNT(fg_made) FROM player_allstar WHERE first_name = 'George' AND last_name = 'Mikan' AND season_id BETWEEN 1951 AND 1953 | 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 | For how long did Elly Koss's cystitis last? | SUM(MULTIPLY(365, SUBTRACT(strftime('%Y', STOP), strftime('%Y', START))), MULTIPLY(30, SUBTRACT(strftime('%m', STOP), strftime('%m', START))), SUBTRACT(strftime('%d', STOP), strftime('%d', START))) where DESCRIPTION = 'Cystitis'; | SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Cystitis' | 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 of customers within the age of 40 to 60 that has the highest income among the group. | age of 40 to 60 refers to age BETWEEN 40 AND 60; the highest income refers to MAX(INCOME_K); | SELECT T1.MARITAL_STATUS FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.age >= 40 AND T1.age <= 60 ORDER BY T2.INCOME_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 supplier company name in Sydney and its homepage address if available. | in Sydney refers to City = 'Sydney'; | SELECT CompanyName, HomePage FROM Suppliers WHERE City = 'Sydney' | 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 | Among the widowed female customers, give the income of those who has an level of education of 5 and below. | widowed female customers refer to SEX = 'Female' where MARITAL_STATUS = 'Widowed'; level of education of 5 and below refers to EDUCATIONNUM ≤ 5; | SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 5 AND SEX = 'Female' AND 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 territory IDs under employee ID of 7. | null | SELECT TerritoryID FROM EmployeeTerritories WHERE EmployeeID = 7 | 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 1990, how many players whose teams had the winning rate of more than 75%? | in 1990 refers to year = 1990; winning rate of more than 75% refers to Divide(won, games) > 0.75 | SELECT COUNT(DISTINCT T1.playerID) FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE CAST(T2.won AS REAL) * 100 / CAST(T2.games AS REAL) > 75 AND T1.year = 1990 | 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 all the orders made by Aimee Bixby, how many of them chose the slowest delivery speed? | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; the slowest delivery speed refers to "Ship Mode" = 'Standard Class'; | 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' AND T2.`Ship Mode` = 'Standard Class' | 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 | Provide medications received by patients with an allergy to mould on 6th June 2016. | medications refers to DESCRIPTION from medications; allergy to mould refers to allergies where DESCRIPTION = 'Allergy to mould'; on 6th June 2016 refers to START = '6/6/16'; | SELECT T2.DESCRIPTION FROM allergies AS T1 INNER JOIN medications AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.START = '6/6/16' AND T1.DESCRIPTION = 'Allergy to mould' | 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 of customers within number of inhabitants ranges of 30 to 40? | number of inhabitants ranges of 30 to 40 refers to INHABITANTS_K BETWEEN 30 AND 40; | SELECT DISTINCT T1.OCCUPATION FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INHABITANTS_K >= 30 AND T2.INHABITANTS_K <= 40 | 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 the order IDs, product IDs and unit price of orders which total payment is greater than 15000. | total payment is greater than 15000 refers to MULTIPLY((Quantity * UnitPrice * (1 - Discount))) > 15000
| SELECT ProductID, OrderID, UnitPrice FROM `Order Details` WHERE UnitPrice * Quantity * (1 - Discount) > 15000 | 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 | In widowed male customers ages from 40 to 60, how many of them has an income ranges from 3000 and above? | widowed male customers ages from 40 to 60 refer to SEX = 'Male' where age BETWEEN 40 AND 60 and MARITAL_STATUS = 'Widowed'; income ranges from 3000 and above 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.age >= 40 AND T1.age <= 60 AND T1.MARITAL_STATUS = 'Widowed' AND T1.SEX = 'Male' AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 3000 | 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 are the ID and description of the condiments category? | condiments category refers to CategoryName = 'Condiments'; the ID refers to CategoryID | SELECT CategoryID, Description FROM Categories WHERE CategoryName = 'Condiments' | 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 old was Alexis Ajinca when he was first drafted? | age when drafted refers to Subtract(draftYear, year(birthDate)); first drafted refers to draftYear | SELECT draftYear - strftime('%Y', birthDate) FROM draft AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.firstName = 'Alexis' AND T1.lastName = 'Ajinca' AND draftRound = 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
); |
synthea | How many times did Keven Kuhn receive DTaP immunization? | DTaP immunization refers to immunizations where DESCRIPTION = 'DTaP'; | SELECT COUNT(T2.CODE) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.DESCRIPTION = 'DTaP' | 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 occupation and income of male customers with an level of education of 4 to 6. | male customers with an level of education of 4 to 6 refer to SEX = 'Male' where EDUCATIONNUM BETWEEN 4 AND 6; income refers to INCOME_K; | SELECT T1.OCCUPATION, T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.EDUCATIONNUM >= 4 AND T1.EDUCATIONNUM <= 6 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 | How many orders were shipped to Venezuela in 1996? | shipped to Venezuela refers to ShipCountry = 'Venezuela'; in 1996 refers to year(ShippedDate) = '1996'; | SELECT COUNT(OrderID) FROM Orders WHERE ShipCountry = 'Venezuela' AND STRFTIME('%Y', ShippedDate) = '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 | How many players with the first name Joe were drafted in 1970? | drafted in 1970 refers to draftYear = 1970 | SELECT COUNT(DISTINCT playerID) FROM draft WHERE firstName = 'Joe' AND draftYear = 1970 | 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 prevalence rate of the patients' diseases started on 9th May 2014? | diseases started on 9th May 2014 refer to DESCRIPTION from conditions where START = '5/9/2014'; | SELECT T2."PREVALENCE RATE" FROM conditions AS T1 INNER JOIN all_prevalences AS T2 ON lower(T1.DESCRIPTION) = lower(T2.ITEM) WHERE T1.START = '2014-05-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 | Among the male customers with an level of education of 4 and below, list their income K. | male customers with an level of education of 4 and below refer to SEX = 'Male' where EDUCATIONNUM < 4; | SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 4 AND 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 | What is the average annual amount of shipped sales from 1997 to 1998? | from 1997 to 1998 refers to ShippedDate > '1996-1-1' and ShippedDate < '1998-12-31'; average annual amount refers to SUM(MULTIPLY(UnitPrice, Quantity, SUBTRACT(1, Discount))) | SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) / 3 FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID WHERE T1.ShippedDate BETWEEN '1996-01-01 00:00:00' AND '1998-12-31 23:59:59' | 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 name of the team with the highest home lost rate? | highest home lost rate = Max(Divide(homelost, Sum(homeWon, homeLost))) | SELECT name FROM teams ORDER BY CAST(homeWon AS REAL) / (homeWon + 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
); |
synthea | Which procedures and medications were received by the patient with the third-degree burn? | procedures refer to DESCRIPTION from procedures; medications refers to DESCRIPTION from medications; third-degree burn refers to conditions where DESCRIPTION = 'Third degree burn'; | SELECT DISTINCT T1.DESCRIPTION, T3.DESCRIPTION FROM procedures AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT INNER JOIN medications AS T3 ON T2.patient = T3.PATIENT WHERE T2.DESCRIPTION = 'Third degree burn' | 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 identifier and income of the oldest customer? | the oldest customer refers to MAX(age); geographic identifier refers to GEOID; income refers to INCOME_K; | SELECT T1.GEOID, T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID 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 | What is the total amount of sales made in the year 1997? | year 1997 refers to year(OrderDate) = 1997; total amount of sales refers to (UnitPrice * Quantity) | SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID WHERE T1.OrderDate LIKE '1997%' | 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 | Among the immunizations in 2017, calculate the percentage of patients who received the Influenza seasonal injectable preservative free. Among them, how many patients are English? | DIVIDE(COUNT(PATIENT when DESCRIPTION = 'Influenza seasonal injectable preservative free'), COUNT(PATIENT)) as percentage where strftime('%Y', 2017); English refers ethnicity = 'english'; | SELECT CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient), SUM(CASE WHEN T1.ethnicity = 'english' THEN 1 ELSE 0 END) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE strftime('%Y', T2.DATE) = '2017' | 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 divorced marital status and older than 50 years old. | number of inhabitants refers to INHABITANTS_K; older than 50 years old refers to age < 50; MARITAL_STATUS = 'Divorced; | SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.MARITAL_STATUS = 'Divorced' AND T1.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 | What was the total amount of sales handled by Nancy Davolio in December 1996, excluding discounts? | in December 1996 refers to year(OrderDate) = 1996 AND month(OrderDate) = 12; excluding discounts refers to Discount = 0; total amount of sales refers to MULTIPLY((UnitPrice, Quantity)) | SELECT SUM(T3.UnitPrice * 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 WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio' AND T2.OrderDate LIKE '1996-12%' AND T3.Discount = 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,
); |
software_company | Give the level of education and occupation of customers ages from 20 to 35 with an income K of 2000 and below. | customers ages from 20 to 35 refer to ID where age BETWEEN 20 AND 35; income K of 2000 and below refers to INCOME_K < 2000; level of education refers to EDUCATIONNUM; | SELECT T1.EDUCATIONNUM, T1.OCCUPATION FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K < 2000 AND T1.age >= 20 AND T1.age <= 35 | 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 company name of the customer who made the biggest amount of purchase in a single order before discount? | biggest amount of purchase in a single order refers to MAX(MULTIPLY(UnitPrice, Quantity)); before discount refers to Discount = 0 | 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 WHERE T3.Discount = 0 GROUP BY T1.CompanyName ORDER BY SUM(T3.UnitPrice * T3.Quantity) 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 | Which winning team in the final round of the postseason series games against the LAL won more than 60 games in the NBA league during the year 1996? | final round of post season refers to round = 'CSF'; won against LAL refers to tmIDLoser = 'LAL'; in the NBA league refers to lgID = 'NBA'; won more than 60 games refers to won > 60 | SELECT DISTINCT T2.tmID FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T2.won > 60 AND T1.year = 1996 AND T1.round = 'CSF' AND T1.tmIDLoser = 'LAL' | 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 | Describe the care plans received by the patient with secondary malignant neoplasm of the colon. | care plans refer to DESCRIPTION from careplans; secondary malignant neoplasm of the colon refers to conditions where DESCRIPTION = 'Secondary malignant neoplasm of colon'; | SELECT DISTINCT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Secondary malignant neoplasm of colon' | 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 number of inhabitants and income of geographic identifier 239? | geographic identifier 239 refers to GEOID = 239; number of inhabitants refers to INHABITANTS_K; income refers to INCOME_K; | SELECT INHABITANTS_K FROM Demog WHERE GEOID = 239 | 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 | Who are the top 8 suppliers supplying the products with the highest user satisfaction? | highest user satisfaction refers to max(ReorderLevel); | SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID ORDER BY T1.ReorderLevel DESC LIMIT 8 | 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 passed away, who had the most award? | pass away refers to deathDate ! = 'null'; most award refers to playerID where Max(Count(award)) | SELECT T1.playerID FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE deathDate IS NOT NULL GROUP BY T1.playerID 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
); |
synthea | What are the birth date of patients who took outpatient encounter care plan? | outpatient encounter care plan refers to careplans where DESCRIPTION = 'Outpatient Encounter'; | SELECT DISTINCT T1.birthdate FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Outpatient Encounter' | 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 geographic identifier from 20 to 50, how many of them has a number of inhabitants below 20? | geographic identifier from 20 to 50 refers to GEOID BETWEEN 20 AND 50; number of inhabitants below 20 refers to INHABITANTS_K < 20; | SELECT COUNT(GEOID) FROM Demog WHERE INHABITANTS_K < 20 AND GEOID >= 20 AND GEOID <= 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 | How many female employees are in charge of 3 or more territories? | female employees refers to TitleOfCourtesy = 'Mrs.' or TitleOfCourtesy = 'Ms.'; in charge of 3 or more territories refers to TerritoryID > = 3; | SELECT COUNT(EID) FROM ( SELECT T1.EmployeeID AS EID FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.TitleOfCourtesy IN ('Ms.' OR 'Mrs.') GROUP BY T1.EmployeeID HAVING COUNT(T2.TerritoryID) >= 3 ) T1 | 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 | List down the geographic identifier with an income that ranges from 2100 to 2500. | geographic identifier with an income that ranges from 2100 to 2500 refers to GEOID where INCOME_K BETWEEN 2100 AND 2500; | SELECT GEOID FROM Demog WHERE INCOME_K >= 2100 AND INCOME_K <= 2500 | 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 company name of the supplier who supplies the product with the highest unit price? | the highest unit price refers to MAX(UnitPrice); | SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( 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 | What are the basketball players' BMI ranges? | BMI = Multiply(Divide(weight, Multiply(height, height)), 703) | SELECT MIN(CAST(weight AS REAL) / (height * height)) , MAX(CAST(weight AS REAL) / (height * height)) FROM players | 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 | Among observations in 2011, provide the names and ages of patients whose Systolic Blood Pressures are 200mmHg. | name implies the patient's full name which refers to first, last; age refers to deathdate is null then SUBTRACT(strftime('%Y', DATE), strftime('%Y', birthdate)); Systolic Blood Pressures are 200mmHg refers to DESCRIPTION = 'Systolic Blood Pressure' and VALUE = 200 and UNITS = 'mmHg' from observations; in 2011 refers to DATE like '2011%'; | SELECT T2.first, T2.last , CASE WHEN T2.deathdate IS NULL THEN strftime('%Y', T1.DATE) - strftime('%Y', T2.birthdate) ELSE strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) END AS age FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Systolic Blood Pressure' AND T1.VALUE = 200 AND T1.UNITS = 'mmHg' AND strftime('%Y', T1.DATE) = '2011' | 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 total number of customers with an age below 30? | age below 30 refers to age < 30; | SELECT COUNT(ID) FROM Customers WHERE age < 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 | How many territories are there in the region with the highest number of territories? | highest number of territories refers to max(TerritoryID) | SELECT COUNT(T2.RegionDescription), T1.TerritoryDescription, COUNT(*) AS num FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID GROUP BY T1.TerritoryDescription ORDER BY num 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 | What is the average BMI of an All-star player? | average BMI refers to AVG (Multiply(Divide(weight, Multiply(height, height)), 703)) | SELECT AVG(CAST(T1.weight AS REAL) / (T1.height * T1.height)) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID | 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 | List down the first name of patients who encountered normal pregnancy. | encountered normal pregnancy refers to encounters where REASONDESCRIPTION = 'Normal pregnancy'; | SELECT DISTINCT T1.first FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Normal pregnancy' | 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 customer's geographic identifier who are handlers or cleaners. | geographic identifier refers to GEOID; OCCUPATION = 'Handlers-cleaners'; | SELECT GEOID FROM Customers WHERE OCCUPATION = 'Handlers-cleaners' | 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 | Which products are being supplied by "G'day, Mate"? List all of their names. | supplied by "G'day, Mate" refers to CompanyName = 'G''day, Mate'; | SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName LIKE 'G%day, Mate' | 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 | Among the patients that died, what is the condition of the oldest patient? | if deathdate is not null, it means this patient died; condition refers to DESCRIPTION from conditions; the oldest patient refers to MAX(SUBTRACT(strftime('%Y', deathdate), strftime('%Y', birthdate))); | SELECT T1.DESCRIPTION FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.deathdate IS NOT NULL ORDER BY strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) 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 | How many of the customers are male? | SEX = 'Male'; | SELECT COUNT(ID) FROM Customers WHERE 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 | What is the monthly average number of products shipped via Federal Shipping for the year 1996? | monthly average number of products refers to DIVIDE(SUM(OrderID), 12); shipped via Federal Shipping refers to CompanyName = 'Federal Shipping'; for the year 1996 refers to year(ShippedDate) = 1996 | SELECT CAST(SUM(T1.ShipVia) AS REAL) / 12 FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Federal Shipping' AND T1.ShippedDate LIKE '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 | Who is the tallest player in Denver Nuggets since 1980? | "Denver Nuggets" is the name of team; since 1980 refers to year > 1980; tallest player = Max(height) | SELECT T1.firstName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T3.name = 'Denver Nuggets' AND T2.year > 1980 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
); |
synthea | Who is the patient involved in the care plan with code 311791003? | null | SELECT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.CODE = 315043002 | 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 average age of first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department? | RESPONSE = 'true'; AVG(age); | SELECT AVG(T1.age) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE 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 | Who is the customer who purchased the highest number of products in a single order? | highest number of products refers to MAX(COUNT(ProductID)) | 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 T1.CompanyName ORDER BY COUNT(T3.ProductID) 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,
); |
superstore | What is the name of the product that was ordered recently by Darren Powers? | Darren Powers is the "Customer Name"; name of the product refers to "Product Name"; recently refers to MAX("Order Date") | SELECT 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` = 'Darren Powers' ORDER BY T2.`Order Date` 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 id of the patient who has the longest allergy period? | id of the patient refers to PATIENT from allergies where STOP is not null; the longest allergy period refers to MAX(SUBTRACT((SUBSTR(STOP, - 2, 1)! = '9' then substr(STOP, length(STOP) - 1) + 2000 end), (SUBSTR(START, - 2, 1) = '9' then substr(START, length(START) - 1) + 1900 else substr(START, length(START) - 1) + 2000 end)));
| SELECT PATIENT FROM allergies WHERE STOP IS NOT NULL GROUP BY PATIENT ORDER BY CASE WHEN SUBSTR(STOP, -2, 1) != '9' THEN SUBSTR(STOP, LENGTH(STOP) - 1) + 2000 END - CASE WHEN SUBSTR(START, -2, 1) = '9' THEN SUBSTR(START, LENGTH(START) - 1) + 1900 ELSE SUBSTR(START, LENGTH(START) - 1) + 2000 END 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 | What is the average education level of customers from the place with the highest average income per month? | place with the highest average income per month refers to GEOID where MAX(INCOME_K); average education level refers to AVG(EDUCATIONNUM); | SELECT AVG(T1.EDUCATIONNUM) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INCOME_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,
); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.