db_id stringclasses 66 values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66 values |
|---|---|---|---|---|
retail_world | What is the position of Robert King? | 'Robert King' is the full name of an employee; full name refers to FirstName, LastName; position refers to Title | SELECT Title FROM Employees WHERE FirstName = 'Robert' AND LastName = 'King' | 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,
); |
student_loan | How many unemployed students still have payment due? | still have payment due refers to bool = 'pos' | SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'pos' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | Please indicate total order quantity of product Geitost and calculate the percentage of such product among all the order quantity. | 'Geitost' is a ProductName; calculation = DIVIDE(ProductName = 'Geitost', COUNT(ProductID)) * 100 | SELECT SUM(IF(T1.ProductName = 'Geitost', 1, 0)) AS sum , CAST(SUM(IF(T1.ProductName = 'Geitost', 1, 0)) AS REAL) / COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID | 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,
); |
student_loan | List all the organisations of students who filed for bankcrupcy. | organization refers to organ; students who filed for bankrupcy refers to file_for_bankrupcy.name | SELECT T2.organ FROM filed_for_bankrupcy AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | How many product names have order quantity less than 50? Calculate the percentage of orders less than 50 out of total order quantity. | order quantity less than 50 refers to Quantity < 50; Calculation = DIVIDE(SUM(Quantity < 50), SUM(ProductID)) * 100 | SELECT SUM(CASE WHEN T2.Quantity < 50 THEN 1 ELSE 0 END) , CAST(SUM(IF(T2.Quantity < 50, 1, 0)) AS REAL) / COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID | 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,
); |
student_loan | Please list all the female students that have filed for bankruptcy. | females students have filed for bankruptcy refers to name that appeared in both filed_for_bankrupcy and male tables | SELECT name FROM filed_for_bankrupcy WHERE name NOT IN ( SELECT name FROM male ) | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | List all category name of Exotic Liquids 's product with units in stock over 100. | 'Exotic Liquids' is a CompanyName; units in stock over 100 refers to UnitsInStock > 100 | SELECT T3.CategoryName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T2.UnitsInStock > 100 AND T1.CompanyName = 'Exotic Liquids' | 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,
); |
retail_world | Please indicate the product name of Tokyo Traders company with order quantity greater than 40. | 'Tokyo Traders' is a CompanyName; order quantity greater than 40 refers to Quantity > 40 | SELECT DISTINCT T2.ProductName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN `Order Details` AS T3 ON T2.ProductID = T3.ProductID WHERE T1.CompanyName = 'Tokyo Traders' AND T3.Quantity > 40 | 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,
); |
retail_world | Which of Cooperativa de Quesos 'Las Cabras' products have a unit price greater than 20? | Cooperativa de Quesos 'Las Cabras'' is a CompanyName; unit price greater than 20 refers to UnitPrice > 20 | SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName LIKE 'Cooperativa de Quesos%' AND T1.UnitPrice > 20 | 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,
); |
student_loan | How many SMC's students that absent for 7 months? | SMC's students refers to school = 'smc'; absent for 7 months refers to month = 7 | SELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name WHERE T1.school = 'smc' AND T2.month = 7 | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | What is the difference in number of unit price from Chef Anton's Cajun Seasoning product and Chef Anton's Gumbo Mix product of New Orleans Cajun Delights company. | Chef Anton's Cajun Seasoning' AND 'Chef Anton''s Gumbo Mix' are ProductName; 'New Orleans Cajun Delights' is a CompanyName; calculation = SUBTRACT(UnitPrice where ProductName = 'Chef Anton's Cajun Seasoning', UnitPrice where ProductName = 'Chef Anton''s Gumbo Mix') | SELECT ( SELECT T1.UnitPrice FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'New Orleans Cajun Delights' AND T1.ProductName LIKE 'Chef Anton%s Cajun Seasoning' ) - ( SELECT T1.UnitPrice FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'New Orleans Cajun Delights' AND T1.ProductName LIKE 'Chef Anton%s Gumbo Mix' ) AS calu | 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,
); |
student_loan | What is the percentage of male students in the navy department? | in the navy department refers to organ = 'navy'; percentage refers to DIVIDE(COUNT(name where organ = 'navy'), COUNT(name)) | SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | Indicate the category name of the product name with the highest units on order. | null | SELECT T2.CategoryName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.UnitsOnOrder = ( SELECT MAX(T1.UnitsOnOrder) 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,
); |
retail_world | Indicate the name of the country where Leka Trading supplies Ipoh Coffee product. | 'Leka Trading' is a CompanyName; 'Ipoh Coffee' is a ProductName | SELECT T2.Country FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Ipoh Coffee' AND T2.CompanyName = 'Leka Trading' | 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,
); |
student_loan | Calculate the ratio between unemployed students and disabled students. | ratio refers to DIVIDE(COUNT(name from unemployed), COUNT(name from disabled)) | SELECT CAST(( SELECT COUNT(name) FROM unemployed ) AS REAL ) / ( SELECT COUNT(name) FROM disabled ) | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | Provide the category name of the Chef Anton's Gumbo Mix product that New Orleans Cajun Delights company has. | 'Chef Anton's Gumbo Mix' is a ProductName; 'New Orleans Cajun Delights' is a CompanyName; | SELECT T3.CategoryName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T1.CompanyName = 'New Orleans Cajun Delights' AND T2.ProductName LIKE 'Chef Anton%s Gumbo Mix' | 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,
); |
student_loan | List all the navy students who are disabled. | navy students refers to organ = 'navy'; disabled student refers to disabled.name | SELECT T1.name FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'navy' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | Which product of Exotic Liquids company that have the highest reorder levels? | 'Exotic Liquids' is a CompanyName; the highest reorder levels refers to MAX(ReorderLevel) | SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids' ORDER BY T1.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,
); |
retail_world | Which company name in London city has the most stocked products? | the most stocked products refers to MAX(UnitsInStock) | SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.City = 'London' ORDER BY T1.UnitsInStock 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,
); |
student_loan | How many students has the longest absense from school for 5 months? | absense from school for 5 month refers to month = 5 | SELECT COUNT(name) FROM longest_absense_from_school WHERE month = 5 | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | What is the name of the company that has the product with the highest unit price? | name of the company refers to CompanyName; 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,
); |
retail_world | How many product names does the supplier Exotic Liquids have? | 'Exotic Liquids' is a CompanyName | SELECT COUNT(T1.ProductName) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids' | 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,
); |
retail_world | Indicate which company is located in France? | company refers to CompanyName; France is a country | SELECT CompanyName FROM Customers WHERE Country = 'France' | 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,
); |
student_loan | List all the disabled female students. | null | SELECT T1.name FROM disabled AS T1 INNER JOIN male AS T2 ON T1.name <> T2.name | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | Indicate the address of the company Eastern Connection whose contact name is Ann Devon. | 'Eastern Connection' is a CompanyName; 'Ann Devon' is the full name of an employee; full name refers to FirstName, LastName | SELECT Address FROM Customers WHERE CompanyName = 'Eastern Connection' AND ContactName = 'Ann Devon' | 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,
); |
student_loan | How many students are enrolled in UCLA school? | enrolled in UCLA refers to school = 'ucla'; | SELECT COUNT(name) FROM enrolled WHERE school = 'ucla' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | How many companies are there in the city of London? | companies refers to CompanyName; | SELECT COUNT(CompanyName) 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,
); |
student_loan | Find the percentage of male students enlisted in the fire department. | percentage refers to DIVIDE(COUNT(organ = 'fire_department'), COUNT(name)) | SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T1.name = T2.name WHERE T1.organ = 'fire_department' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | Indicate the fax of the company Blondesddsl pre et fils in Strasbourg city. | 'Blondesddsl pre et fils' is a CompanyName | SELECT Fax FROM Customers WHERE CompanyName = 'Blondesddsl pre et fils' AND City = 'Strasbourg' | 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,
); |
student_loan | How many students are enlisted in the Army organization? | enlisted in the army refers to organ = 'army'; | SELECT COUNT(name) FROM enlist WHERE organ = 'army' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | List the phone number of company named Around the Horn. | phone number refers to Phone; 'Around the Horn' is a CompanyName | SELECT Phone FROM Customers WHERE CompanyName = 'Around the Horn' | 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,
); |
student_loan | Please list the departments the students are absent from school for 9 months are in. | absent from school for 9 months refers to month = 9 | SELECT T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 9 | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
retail_world | Indicate category name of soft drinks, coffees, teas, beers, and ales in description list. | Soft drinks, coffees, teas, beers, and ales' is Description of CategoryName | SELECT CategoryName FROM Categories WHERE Description = 'Soft drinks, coffees, teas, beers, and ales' | 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,
); |
student_loan | List at least 5 students who has the longest absense from schoool? | longest absense refers to MAX(month) | SELECT name FROM longest_absense_from_school ORDER BY month DESC LIMIT 5 | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0
);
CREATE TABLE bool
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE enlist
(
"name" TEXT not null, --
foreign key ("name") references person ("name") on update cascade on delete cascade,
organ TEXT not null, -- Example Values: `fire_department`, `air_force`, `navy`, `marines`, `foreign_legion` | Value Statics: Total count 306 - Distinct count 7 - Null count 0
);
CREATE TABLE unemployed
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE male
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE disabled
(
foreign key ("name") references person ("name") on update cascade on delete cascade,
"name" TEXT default '' not null primary key,
);
CREATE TABLE filed_for_bankrupcy
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE person
(
"name" TEXT default '' not null primary key,
);
CREATE TABLE no_payment_due
(
bool TEXT null, -- Example Values: `neg`, `pos` | Value Statics: Total count 1000 - Distinct count 2 - Null count 0
"name" TEXT default '' not null primary key,
foreign key (bool) references bool ("name") on update cascade on delete cascade,
foreign key ("name") references person ("name") on update cascade on delete cascade,
);
CREATE TABLE enrolled
(
`name` TEXT NOT NULL, --
PRIMARY KEY (`name`,`school`),
`month` INTEGER NOT NULL DEFAULT 0, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 1194 - Distinct count 15 - Null count 0
`school` TEXT NOT NULL, -- Example Values: `occ`, `smc`, `ucb`, `ucla`, `ucsd` | Value Statics: Total count 1194 - Distinct count 6 - Null count 0
FOREIGN KEY (`name`) REFERENCES `person` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
); |
food_inspection | Among the violations in 2016, how many of them have unscheduled inspections? | unscheduled inspections refer to type = 'Routine - Unschedule'; year(date) = 2016; | SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.type = 'Routine - Unscheduled' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
university | Give the name of the country that has the most universities. | has the most universities refers to MAX(COUNT(id)); name of the country refers to country_name | SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id GROUP BY T2.country_name ORDER BY COUNT(T1.university_name) DESC LIMIT 1 | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
country_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE university
(
university_name TEXT default NULL, --
id INTEGER not null primary key,
country_id INTEGER default NULL, --
foreign key (country_id) references country(id),
);
CREATE TABLE university_year
(
pct_international_students INTEGER default NULL, --
pct_female_students INTEGER default NULL, --
student_staff_ratio REAL default NULL, --
foreign key (university_id) references university(id),
num_students INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 1085 - Distinct count 6 - Null count 0
university_id INTEGER default NULL, --
);
CREATE TABLE ranking_criteria
(
id INTEGER not null primary key,
ranking_system_id INTEGER default NULL, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 21 - Distinct count 3 - Null count 0
criteria_name TEXT default NULL, --
foreign key (ranking_system_id) references ranking_system(id),
);
CREATE TABLE university_ranking_year
(
ranking_criteria_id INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 29612 - Distinct count 12 - Null count 0
foreign key (ranking_criteria_id) references ranking_criteria(id),
foreign key (university_id) references university(id),
score INTEGER default NULL, --
university_id INTEGER default NULL, --
); |
beer_factory | Which of the root beer brand have the lowest purchase? | root beer brand refers to BrandName; lowest purchase refers to MIN(COUNT(BrandID)); | SELECT T2.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) LIMIT 1 | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
olympics | Among the Olympic games held in Los Angeles, what is the name of the Olympic game that has the most number of competitors? | Los Angeles refers to city_name = 'Lost Angeles'; the Olympic game refers to games_name; the most number of competitors refers to MAX(COUNT(games_name)); | SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Los Angeles' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
disney | How many of Gary Trousdale's movies are adventure movies? | Gary Trousdale refers director = 'Gary Trousdale'; the adventure movie refers to genre = 'Adventure'; | SELECT COUNT(T.name) FROM ( SELECT T1.name FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Gary Trousdale' AND T2.genre = 'Adventure' GROUP BY T1.name ) T | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
movie_platform | What is the percentage of list created by user who was a subscriber when he created the list? | was a subscriber refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(list_id)) | SELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(list_id) FROM lists_users | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | In businesses with an owner address 500 California St, 2nd Floor of Silicon Valley, list the type of inspection of the business with the highest score. | the highest score MAX(score); Silicon Valley is located in 'SAN FRANCISCO'; | SELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_address = '500 California St, 2nd Floor' AND T2.owner_city = 'SAN FRANCISCO' ORDER BY T1.score DESC LIMIT 1 | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
university | What is the ID of the university that has only 1% of international students between 2011 to 2015? | has only 1% of international students refers to pct_international_students = 1; between 2011 to 2015 refers to year BETWEEN 2011 AND 2015; ID of university refers to university_id | SELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015 | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
country_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE university
(
university_name TEXT default NULL, --
id INTEGER not null primary key,
country_id INTEGER default NULL, --
foreign key (country_id) references country(id),
);
CREATE TABLE university_year
(
pct_international_students INTEGER default NULL, --
pct_female_students INTEGER default NULL, --
student_staff_ratio REAL default NULL, --
foreign key (university_id) references university(id),
num_students INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 1085 - Distinct count 6 - Null count 0
university_id INTEGER default NULL, --
);
CREATE TABLE ranking_criteria
(
id INTEGER not null primary key,
ranking_system_id INTEGER default NULL, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 21 - Distinct count 3 - Null count 0
criteria_name TEXT default NULL, --
foreign key (ranking_system_id) references ranking_system(id),
);
CREATE TABLE university_ranking_year
(
ranking_criteria_id INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 29612 - Distinct count 12 - Null count 0
foreign key (ranking_criteria_id) references ranking_criteria(id),
foreign key (university_id) references university(id),
score INTEGER default NULL, --
university_id INTEGER default NULL, --
); |
beer_factory | What is the percentage of female customers who subscribed to the email list? | percentage = MULTIPLY(DIVIDE(COUNT(CustomerID WHERE Gender = 'F'), COUNT(CustomerID) WHERE SubscribedToEmailList = 'TRUE'), 1.0); female refers to Gender = 'F'; subscribed to the email list refers to SubscribedToEmailList = 'TRUE'; | SELECT CAST(COUNT(CASE WHEN Gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(SubscribedToEmailList) FROM customers WHERE SubscribedToEmailList = 'TRUE' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
olympics | Calculate the average age of the persons who participated in the 1992 Summer Games. | DIVIDE(SUM(age), COUNT(person_id)) where games_name = '1992 Summer'; | SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1992 Summer' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
disney | Which director did Bill Thompson work the most with? | Bill Thompson refers to voice-actor = 'Bill Thompson'; worked the most refers to MAX(COUNT(name)); | SELECT director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T2.`voice-actor` = 'Bill Thompson' GROUP BY director ORDER BY COUNT(director) DESC LIMIT 1 | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
public_review_platform | What is the category of the business with medium review length and highest review stars within business ID from 6 t0 9? | category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9 | SELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Medium' AND T2.business_id BETWEEN 6 AND 9 ORDER BY T1.review_stars DESC LIMIT 1 | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 - Null count 0
constraint Elite_pk primary key (user_id, year_id),
user_id INTEGER constraint Elite_Users_user_id_fk references Users, --
);
CREATE TABLE Business_Hours
(
closing_time TEXT, --
business_id INTEGER constraint Business_Hours_Business_business_id_fk references Business, --
day_id INTEGER constraint Business_Hours_Days_day_id_fk references Days, -- Example Values: `2`, `3`, `4`, `5`, `6` | Value Statics: Total count 47831 - Distinct count 7 - Null count 0
opening_time TEXT, --
constraint Business_Hours_pk primary key (business_id, day_id),
);
CREATE TABLE Categories
(
category_id INTEGER constraint Categories_pk primary key,
category_name TEXT, --
);
CREATE TABLE Business_Categories
(
business_id INTEGER constraint Business_Categories_Business_business_id_fk references Business, --
category_id INTEGER constraint Business_Categories_Categories_category_id_fk references Categories, --
constraint Business_Categories_pk primary key (business_id, category_id),
);
CREATE TABLE Tips
(
likes INTEGER, -- Example Values: `0`, `1`, `2`, `3` | Value Statics: Total count 87157 - Distinct count 4 - Null count 0
user_id INTEGER constraint Tips_Users_user_id_fk references Users, --
tip_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 87157 - Distinct count 3 - Null count 0
business_id INTEGER constraint Tips_Business_business_id_fk references Business, --
constraint Tips_pk primary key (business_id, user_id),
);
CREATE TABLE Reviews
(
business_id INTEGER constraint Reviews_Business_business_id_fk references Business, --
review_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 100000 - Distinct count 3 - Null count 0
constraint Reviews_pk primary key (business_id, user_id),
review_votes_funny TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_stars INTEGER, -- Example Values: `2`, `1`, `5`, `4`, `3` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_votes_cool TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
user_id INTEGER constraint Reviews_Users_user_id_fk references Users, --
review_votes_useful TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
);
CREATE TABLE Checkins
(
label_time_7 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_19 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_17 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_1 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_13 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_20 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_14 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_5 TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_2 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_22 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
day_id INTEGER constraint Checkins_Days_day_id_fk references Days, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 80038 - Distinct count 7 - Null count 0
label_time_8 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_0 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_4 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_21 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_23 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_9 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_11 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_16 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_10 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_15 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
business_id INTEGER constraint Checkins_Business_business_id_fk references Business, --
constraint Checkins_pk primary key (business_id, day_id),
label_time_12 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_18 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_3 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_6 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
);
CREATE TABLE Days
(
day_id INTEGER constraint Days_pk primary key,
day_of_week TEXT, -- Example Values: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
);
CREATE TABLE Years
(
actual_year INTEGER, -- Example Values: `2005`, `2006`, `2007`, `2008`, `2009` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
year_id INTEGER constraint Years_pk primary key,
);
CREATE TABLE Business
(
business_id INTEGER constraint Business_pk primary key,
state TEXT, -- Example Values: `AZ`, `SC`, `CA` | Value Statics: Total count 15585 - Distinct count 3 - Null count 0
city TEXT, --
active TEXT, -- Example Values: `true`, `false` | Value Statics: Total count 15585 - Distinct count 2 - Null count 0
stars REAL, -- Example Values: `3.0`, `4.5`, `4.0`, `5.0`, `3.5` | Value Statics: Total count 15585 - Distinct count 9 - Null count 0
review_count TEXT, -- Example Values: `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 15585 - Distinct count 4 - Null count 0
);
CREATE TABLE Business_Attributes
(
business_id INTEGER constraint Business_Attributes_Business_business_id_fk references Business, --
attribute_value TEXT, --
constraint Business_Attributes_pk primary key (attribute_id, business_id),
attribute_id INTEGER constraint Business_Attributes_Attributes_attribute_id_fk references Attributes, --
);
CREATE TABLE Users_Compliments
(
user_id INTEGER constraint Users_Compliments_Users_user_id_fk references Users, --
constraint Users_Compliments_pk primary key (compliment_id, user_id),
number_of_compliments TEXT, -- Example Values: `Medium`, `Low`, `High`, `Uber` | Value Statics: Total count 98810 - Distinct count 4 - Null count 0
compliment_id INTEGER constraint Users_Compliments_Compliments_compliment_id_fk references Compliments, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 98810 - Distinct count 11 - Null count 0
);
CREATE TABLE Compliments
(
compliment_type TEXT, -- Example Values: `photos`, `cool`, `hot`, `note`, `more` | Value Statics: Total count 11 - Distinct count 11 - Null count 0
compliment_id INTEGER constraint Compliments_pk primary key,
);
CREATE TABLE Users
(
user_votes_cool TEXT, -- Example Values: `Low`, `Uber`, `None`, `High`, `Medium` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_yelping_since_year INTEGER, -- Example Values: `2012`, `2010`, `2009`, `2008`, `2013` | Value Statics: Total count 70817 - Distinct count 11 - Null count 0
user_average_stars TEXT, -- Example Values: `4.0`, `2.5`, `4.5`, `5.0`, `2.0` | Value Statics: Total count 70817 - Distinct count 10 - Null count 0
user_review_count TEXT, -- Example Values: `Medium`, `High`, `Low`, `Uber` | Value Statics: Total count 70817 - Distinct count 4 - Null count 0
user_votes_useful TEXT, -- Example Values: `Low`, `Medium`, `Uber`, `None`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_id INTEGER constraint Users_pk primary key,
user_votes_funny TEXT, -- Example Values: `Low`, `None`, `Uber`, `Medium`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_fans TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
); |
movie_platform | Provide list titles created by user who are eligible for trial when he created the list. | eligible for trial refers to user_eligible_for_trial = 1 | SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_eligible_for_trial = 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | What is the owner's name of the of the business that violates 103156 on June 12, 2014? | business that violates 103156 on June 12, 2014 refers to business_id where violation_type_id = 103156 and date = '2014-06-12'; | SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = 103156 AND T1.`date` = '2014-06-12' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
university | How many criteria belong to ranking system ID 3? | null | SELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3 | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
country_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE university
(
university_name TEXT default NULL, --
id INTEGER not null primary key,
country_id INTEGER default NULL, --
foreign key (country_id) references country(id),
);
CREATE TABLE university_year
(
pct_international_students INTEGER default NULL, --
pct_female_students INTEGER default NULL, --
student_staff_ratio REAL default NULL, --
foreign key (university_id) references university(id),
num_students INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 1085 - Distinct count 6 - Null count 0
university_id INTEGER default NULL, --
);
CREATE TABLE ranking_criteria
(
id INTEGER not null primary key,
ranking_system_id INTEGER default NULL, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 21 - Distinct count 3 - Null count 0
criteria_name TEXT default NULL, --
foreign key (ranking_system_id) references ranking_system(id),
);
CREATE TABLE university_ranking_year
(
ranking_criteria_id INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 29612 - Distinct count 12 - Null count 0
foreign key (ranking_criteria_id) references ranking_criteria(id),
foreign key (university_id) references university(id),
score INTEGER default NULL, --
university_id INTEGER default NULL, --
); |
beer_factory | What is the percentage difference of River City sale compare to Frostie? | percentage difference = (DIVIDE(MULTIPLY(SUBTRACT(SUM(PurchasePrice WHERE BrandName = 'River City'), SUM(PurchasePrice WHERE BrandName = 'Frostie')), 100), SUM(PurchasePrice WHERE BrandName = 'Frostie'))); River City refers to BrandName = 'River City'; Frostie refers to BrandName = 'Frostie'; | SELECT CAST((SUM(CASE WHEN T3.BrandName = 'River City' THEN T2.PurchasePrice ELSE 0 END) - SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
olympics | How many times was Larysa Semenivna Latynina (Diriy-) declared as champion in Gymnastics Women's Individual All-Around? | Gymnastics Women's Individual All-Around refers to event_name = 'Gymnastics Women''s Individual All-Around'; declared as champion refers to medal_name = 'Gold' or medal_id = 1; | SELECT COUNT(T1.id) FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person AS T4 ON T3.person_id = T4.id WHERE T4.full_name = 'Larysa Semenivna Latynina (Diriy-)' AND T1.event_name LIKE 'Gymnastics Women%s Individual All-Around' AND T2.medal_id = 1 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
public_review_platform | Among the Yelp_Businesses which are still running, how many of them fall under the category of "Food"? | are still running refers to active = 'true'; the category of "Food" refers to category_name = 'Food' | SELECT COUNT(T3.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Tips AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Food' AND T3.active LIKE 'TRUE' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 - Null count 0
constraint Elite_pk primary key (user_id, year_id),
user_id INTEGER constraint Elite_Users_user_id_fk references Users, --
);
CREATE TABLE Business_Hours
(
closing_time TEXT, --
business_id INTEGER constraint Business_Hours_Business_business_id_fk references Business, --
day_id INTEGER constraint Business_Hours_Days_day_id_fk references Days, -- Example Values: `2`, `3`, `4`, `5`, `6` | Value Statics: Total count 47831 - Distinct count 7 - Null count 0
opening_time TEXT, --
constraint Business_Hours_pk primary key (business_id, day_id),
);
CREATE TABLE Categories
(
category_id INTEGER constraint Categories_pk primary key,
category_name TEXT, --
);
CREATE TABLE Business_Categories
(
business_id INTEGER constraint Business_Categories_Business_business_id_fk references Business, --
category_id INTEGER constraint Business_Categories_Categories_category_id_fk references Categories, --
constraint Business_Categories_pk primary key (business_id, category_id),
);
CREATE TABLE Tips
(
likes INTEGER, -- Example Values: `0`, `1`, `2`, `3` | Value Statics: Total count 87157 - Distinct count 4 - Null count 0
user_id INTEGER constraint Tips_Users_user_id_fk references Users, --
tip_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 87157 - Distinct count 3 - Null count 0
business_id INTEGER constraint Tips_Business_business_id_fk references Business, --
constraint Tips_pk primary key (business_id, user_id),
);
CREATE TABLE Reviews
(
business_id INTEGER constraint Reviews_Business_business_id_fk references Business, --
review_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 100000 - Distinct count 3 - Null count 0
constraint Reviews_pk primary key (business_id, user_id),
review_votes_funny TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_stars INTEGER, -- Example Values: `2`, `1`, `5`, `4`, `3` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_votes_cool TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
user_id INTEGER constraint Reviews_Users_user_id_fk references Users, --
review_votes_useful TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
);
CREATE TABLE Checkins
(
label_time_7 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_19 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_17 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_1 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_13 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_20 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_14 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_5 TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_2 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_22 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
day_id INTEGER constraint Checkins_Days_day_id_fk references Days, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 80038 - Distinct count 7 - Null count 0
label_time_8 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_0 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_4 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_21 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_23 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_9 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_11 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_16 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_10 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_15 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
business_id INTEGER constraint Checkins_Business_business_id_fk references Business, --
constraint Checkins_pk primary key (business_id, day_id),
label_time_12 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_18 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_3 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_6 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
);
CREATE TABLE Days
(
day_id INTEGER constraint Days_pk primary key,
day_of_week TEXT, -- Example Values: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
);
CREATE TABLE Years
(
actual_year INTEGER, -- Example Values: `2005`, `2006`, `2007`, `2008`, `2009` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
year_id INTEGER constraint Years_pk primary key,
);
CREATE TABLE Business
(
business_id INTEGER constraint Business_pk primary key,
state TEXT, -- Example Values: `AZ`, `SC`, `CA` | Value Statics: Total count 15585 - Distinct count 3 - Null count 0
city TEXT, --
active TEXT, -- Example Values: `true`, `false` | Value Statics: Total count 15585 - Distinct count 2 - Null count 0
stars REAL, -- Example Values: `3.0`, `4.5`, `4.0`, `5.0`, `3.5` | Value Statics: Total count 15585 - Distinct count 9 - Null count 0
review_count TEXT, -- Example Values: `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 15585 - Distinct count 4 - Null count 0
);
CREATE TABLE Business_Attributes
(
business_id INTEGER constraint Business_Attributes_Business_business_id_fk references Business, --
attribute_value TEXT, --
constraint Business_Attributes_pk primary key (attribute_id, business_id),
attribute_id INTEGER constraint Business_Attributes_Attributes_attribute_id_fk references Attributes, --
);
CREATE TABLE Users_Compliments
(
user_id INTEGER constraint Users_Compliments_Users_user_id_fk references Users, --
constraint Users_Compliments_pk primary key (compliment_id, user_id),
number_of_compliments TEXT, -- Example Values: `Medium`, `Low`, `High`, `Uber` | Value Statics: Total count 98810 - Distinct count 4 - Null count 0
compliment_id INTEGER constraint Users_Compliments_Compliments_compliment_id_fk references Compliments, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 98810 - Distinct count 11 - Null count 0
);
CREATE TABLE Compliments
(
compliment_type TEXT, -- Example Values: `photos`, `cool`, `hot`, `note`, `more` | Value Statics: Total count 11 - Distinct count 11 - Null count 0
compliment_id INTEGER constraint Compliments_pk primary key,
);
CREATE TABLE Users
(
user_votes_cool TEXT, -- Example Values: `Low`, `Uber`, `None`, `High`, `Medium` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_yelping_since_year INTEGER, -- Example Values: `2012`, `2010`, `2009`, `2008`, `2013` | Value Statics: Total count 70817 - Distinct count 11 - Null count 0
user_average_stars TEXT, -- Example Values: `4.0`, `2.5`, `4.5`, `5.0`, `2.0` | Value Statics: Total count 70817 - Distinct count 10 - Null count 0
user_review_count TEXT, -- Example Values: `Medium`, `High`, `Low`, `Uber` | Value Statics: Total count 70817 - Distinct count 4 - Null count 0
user_votes_useful TEXT, -- Example Values: `Low`, `Medium`, `Uber`, `None`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_id INTEGER constraint Users_pk primary key,
user_votes_funny TEXT, -- Example Values: `Low`, `None`, `Uber`, `Medium`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_fans TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
); |
movie_platform | Name all the list titles created by user 4208563. | user 4208563 refers to user_id = 4208563 | SELECT list_title FROM lists WHERE user_id LIKE 4208563 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | List the violation type ID of business with business ID from 30 to 50 and located at 747 IRVING St, San Francisco. | business ID from 30 to 50 refers to business_id between 30 and 50; address = '747 IRVING St'; city = 'San Francisco'; | SELECT DISTINCT T1.violation_type_id FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.business_id BETWEEN 30 AND 50 AND T2.address = '747 IRVING St' AND T2.city = 'San Francisco' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
university | What is the student staff ratio of the university with the highest student staff ratio of all time? | highest student staff ratio refers to max(student_staff_ratio) | SELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year ) | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
country_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE university
(
university_name TEXT default NULL, --
id INTEGER not null primary key,
country_id INTEGER default NULL, --
foreign key (country_id) references country(id),
);
CREATE TABLE university_year
(
pct_international_students INTEGER default NULL, --
pct_female_students INTEGER default NULL, --
student_staff_ratio REAL default NULL, --
foreign key (university_id) references university(id),
num_students INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 1085 - Distinct count 6 - Null count 0
university_id INTEGER default NULL, --
);
CREATE TABLE ranking_criteria
(
id INTEGER not null primary key,
ranking_system_id INTEGER default NULL, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 21 - Distinct count 3 - Null count 0
criteria_name TEXT default NULL, --
foreign key (ranking_system_id) references ranking_system(id),
);
CREATE TABLE university_ranking_year
(
ranking_criteria_id INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 29612 - Distinct count 12 - Null count 0
foreign key (ranking_criteria_id) references ranking_criteria(id),
foreign key (university_id) references university(id),
score INTEGER default NULL, --
university_id INTEGER default NULL, --
); |
beer_factory | How many transactions were made at Sac State Union? | Sac State Union refers to LocationName = 'Sac State Union'; | SELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State Union' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
disney | List all the voice actors in the movie directed by Ben Sharpsteen which was released on February 9, 1940. | Ben Sharpsteen refers to director = 'Ben Sharpsteen'; released on February 9, 1940 refers to release_date = 'Feb 9, 1940'; | SELECT T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 INNER JOIN movies_total_gross AS T3 ON T1.name = T2.movie AND T2.movie = T3.movie_title WHERE T1.director = 'Ben Sharpsteen' AND T3.release_date = 'Feb 9, 1940' AND T2.`voice-actor` != 'None' GROUP BY T2.`voice-actor` | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
public_review_platform | What is the closing and opening time of businesses located at Tempe with highest star rating? | located at Tempe refers to city = 'Tempe'; highest star rating refers to max(stars) | SELECT T2.closing_time, T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Tempe' ORDER BY T1.stars DESC LIMIT 1 | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 - Null count 0
constraint Elite_pk primary key (user_id, year_id),
user_id INTEGER constraint Elite_Users_user_id_fk references Users, --
);
CREATE TABLE Business_Hours
(
closing_time TEXT, --
business_id INTEGER constraint Business_Hours_Business_business_id_fk references Business, --
day_id INTEGER constraint Business_Hours_Days_day_id_fk references Days, -- Example Values: `2`, `3`, `4`, `5`, `6` | Value Statics: Total count 47831 - Distinct count 7 - Null count 0
opening_time TEXT, --
constraint Business_Hours_pk primary key (business_id, day_id),
);
CREATE TABLE Categories
(
category_id INTEGER constraint Categories_pk primary key,
category_name TEXT, --
);
CREATE TABLE Business_Categories
(
business_id INTEGER constraint Business_Categories_Business_business_id_fk references Business, --
category_id INTEGER constraint Business_Categories_Categories_category_id_fk references Categories, --
constraint Business_Categories_pk primary key (business_id, category_id),
);
CREATE TABLE Tips
(
likes INTEGER, -- Example Values: `0`, `1`, `2`, `3` | Value Statics: Total count 87157 - Distinct count 4 - Null count 0
user_id INTEGER constraint Tips_Users_user_id_fk references Users, --
tip_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 87157 - Distinct count 3 - Null count 0
business_id INTEGER constraint Tips_Business_business_id_fk references Business, --
constraint Tips_pk primary key (business_id, user_id),
);
CREATE TABLE Reviews
(
business_id INTEGER constraint Reviews_Business_business_id_fk references Business, --
review_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 100000 - Distinct count 3 - Null count 0
constraint Reviews_pk primary key (business_id, user_id),
review_votes_funny TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_stars INTEGER, -- Example Values: `2`, `1`, `5`, `4`, `3` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_votes_cool TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
user_id INTEGER constraint Reviews_Users_user_id_fk references Users, --
review_votes_useful TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
);
CREATE TABLE Checkins
(
label_time_7 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_19 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_17 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_1 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_13 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_20 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_14 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_5 TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_2 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_22 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
day_id INTEGER constraint Checkins_Days_day_id_fk references Days, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 80038 - Distinct count 7 - Null count 0
label_time_8 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_0 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_4 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_21 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_23 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_9 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_11 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_16 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_10 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_15 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
business_id INTEGER constraint Checkins_Business_business_id_fk references Business, --
constraint Checkins_pk primary key (business_id, day_id),
label_time_12 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_18 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_3 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_6 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
);
CREATE TABLE Days
(
day_id INTEGER constraint Days_pk primary key,
day_of_week TEXT, -- Example Values: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
);
CREATE TABLE Years
(
actual_year INTEGER, -- Example Values: `2005`, `2006`, `2007`, `2008`, `2009` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
year_id INTEGER constraint Years_pk primary key,
);
CREATE TABLE Business
(
business_id INTEGER constraint Business_pk primary key,
state TEXT, -- Example Values: `AZ`, `SC`, `CA` | Value Statics: Total count 15585 - Distinct count 3 - Null count 0
city TEXT, --
active TEXT, -- Example Values: `true`, `false` | Value Statics: Total count 15585 - Distinct count 2 - Null count 0
stars REAL, -- Example Values: `3.0`, `4.5`, `4.0`, `5.0`, `3.5` | Value Statics: Total count 15585 - Distinct count 9 - Null count 0
review_count TEXT, -- Example Values: `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 15585 - Distinct count 4 - Null count 0
);
CREATE TABLE Business_Attributes
(
business_id INTEGER constraint Business_Attributes_Business_business_id_fk references Business, --
attribute_value TEXT, --
constraint Business_Attributes_pk primary key (attribute_id, business_id),
attribute_id INTEGER constraint Business_Attributes_Attributes_attribute_id_fk references Attributes, --
);
CREATE TABLE Users_Compliments
(
user_id INTEGER constraint Users_Compliments_Users_user_id_fk references Users, --
constraint Users_Compliments_pk primary key (compliment_id, user_id),
number_of_compliments TEXT, -- Example Values: `Medium`, `Low`, `High`, `Uber` | Value Statics: Total count 98810 - Distinct count 4 - Null count 0
compliment_id INTEGER constraint Users_Compliments_Compliments_compliment_id_fk references Compliments, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 98810 - Distinct count 11 - Null count 0
);
CREATE TABLE Compliments
(
compliment_type TEXT, -- Example Values: `photos`, `cool`, `hot`, `note`, `more` | Value Statics: Total count 11 - Distinct count 11 - Null count 0
compliment_id INTEGER constraint Compliments_pk primary key,
);
CREATE TABLE Users
(
user_votes_cool TEXT, -- Example Values: `Low`, `Uber`, `None`, `High`, `Medium` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_yelping_since_year INTEGER, -- Example Values: `2012`, `2010`, `2009`, `2008`, `2013` | Value Statics: Total count 70817 - Distinct count 11 - Null count 0
user_average_stars TEXT, -- Example Values: `4.0`, `2.5`, `4.5`, `5.0`, `2.0` | Value Statics: Total count 70817 - Distinct count 10 - Null count 0
user_review_count TEXT, -- Example Values: `Medium`, `High`, `Low`, `Uber` | Value Statics: Total count 70817 - Distinct count 4 - Null count 0
user_votes_useful TEXT, -- Example Values: `Low`, `Medium`, `Uber`, `None`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_id INTEGER constraint Users_pk primary key,
user_votes_funny TEXT, -- Example Values: `Low`, `None`, `Uber`, `Medium`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_fans TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
); |
movie_platform | For all list titles with at least 200 movies in the list, what is their average number of followers? | at least 200 movies in the list refers to list_movie_number > 200; average number of followers refers to avg(list_followers) | SELECT AVG(list_followers) FROM lists WHERE list_movie_number > 200 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | Among the owners from Cameron Park, what is the business name of the business with a score of 100? | Cameron Park is a name of city; | SELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_city = 'Cameron Park' AND T1.score = 100 | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
university | How many state universities are there? | state universities refers to university_name LIKE '%State%'; | SELECT COUNT(*) FROM university WHERE university_name LIKE '%State%' | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
country_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE university
(
university_name TEXT default NULL, --
id INTEGER not null primary key,
country_id INTEGER default NULL, --
foreign key (country_id) references country(id),
);
CREATE TABLE university_year
(
pct_international_students INTEGER default NULL, --
pct_female_students INTEGER default NULL, --
student_staff_ratio REAL default NULL, --
foreign key (university_id) references university(id),
num_students INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 1085 - Distinct count 6 - Null count 0
university_id INTEGER default NULL, --
);
CREATE TABLE ranking_criteria
(
id INTEGER not null primary key,
ranking_system_id INTEGER default NULL, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 21 - Distinct count 3 - Null count 0
criteria_name TEXT default NULL, --
foreign key (ranking_system_id) references ranking_system(id),
);
CREATE TABLE university_ranking_year
(
ranking_criteria_id INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 29612 - Distinct count 12 - Null count 0
foreign key (ranking_criteria_id) references ranking_criteria(id),
foreign key (university_id) references university(id),
score INTEGER default NULL, --
university_id INTEGER default NULL, --
); |
beer_factory | Please name all of the cities in California. | California refers to State = 'CA'; | SELECT DISTINCT City FROM customers WHERE State = 'CA' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
olympics | How many athletes participated in the 2014 Winter Olympics? | athletes refer to person_id; 2014 Winter Olympics refer to games_name = '2014 Winter'; | SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2014 Winter' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
disney | Please list the release dates of all the movies in which Alan Tudyk is a voice actor. | FALSE; | SELECT T2.release_date FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T1.`voice-actor` = 'Alan Tudyk' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
movie_platform | Name all lists created by a user who was a subcriber when created the list. | was a subscriber refers to user_subscriber = 1 | SELECT DISTINCT T2.list_id FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_subscriber = 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | Who is the owner of the business that has a high risk violation of 103109 and described as unclean or unsanitary food contact surfaces? | owner refers to owner_name; high risk violation of 103109 and described as unclean or unsanitary food contact surfaces refers to risk_category = 'High Risk' where violation_type_id = 103109 and description = 'Unclean or unsanitary food contact surfaces'; | SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.violation_type_id = 103109 AND T1.description = 'Unclean or unsanitary food contact surfaces' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
university | What is the ranking system ID of the award criteria? | award criteria refers to criteria_name = 'Award'; | SELECT ranking_system_id FROM ranking_criteria WHERE criteria_name = 'Award' | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
country_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE university
(
university_name TEXT default NULL, --
id INTEGER not null primary key,
country_id INTEGER default NULL, --
foreign key (country_id) references country(id),
);
CREATE TABLE university_year
(
pct_international_students INTEGER default NULL, --
pct_female_students INTEGER default NULL, --
student_staff_ratio REAL default NULL, --
foreign key (university_id) references university(id),
num_students INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 1085 - Distinct count 6 - Null count 0
university_id INTEGER default NULL, --
);
CREATE TABLE ranking_criteria
(
id INTEGER not null primary key,
ranking_system_id INTEGER default NULL, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 21 - Distinct count 3 - Null count 0
criteria_name TEXT default NULL, --
foreign key (ranking_system_id) references ranking_system(id),
);
CREATE TABLE university_ranking_year
(
ranking_criteria_id INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 29612 - Distinct count 12 - Null count 0
foreign key (ranking_criteria_id) references ranking_criteria(id),
foreign key (university_id) references university(id),
score INTEGER default NULL, --
university_id INTEGER default NULL, --
); |
beer_factory | How many purchases were made at Sac State American River Courtyard using Master Card? | Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard'; Master Card refers to CreditCardType = 'MasterCard'; | SELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State American River Courtyard' AND T1.CreditCardType = 'MasterCard' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
public_review_platform | Count the active businesses that has an attribute of caters with low review count. | active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters' | SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Caters' AND T1.review_count LIKE 'Low' AND T1.active LIKE 'TRUE' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 - Null count 0
constraint Elite_pk primary key (user_id, year_id),
user_id INTEGER constraint Elite_Users_user_id_fk references Users, --
);
CREATE TABLE Business_Hours
(
closing_time TEXT, --
business_id INTEGER constraint Business_Hours_Business_business_id_fk references Business, --
day_id INTEGER constraint Business_Hours_Days_day_id_fk references Days, -- Example Values: `2`, `3`, `4`, `5`, `6` | Value Statics: Total count 47831 - Distinct count 7 - Null count 0
opening_time TEXT, --
constraint Business_Hours_pk primary key (business_id, day_id),
);
CREATE TABLE Categories
(
category_id INTEGER constraint Categories_pk primary key,
category_name TEXT, --
);
CREATE TABLE Business_Categories
(
business_id INTEGER constraint Business_Categories_Business_business_id_fk references Business, --
category_id INTEGER constraint Business_Categories_Categories_category_id_fk references Categories, --
constraint Business_Categories_pk primary key (business_id, category_id),
);
CREATE TABLE Tips
(
likes INTEGER, -- Example Values: `0`, `1`, `2`, `3` | Value Statics: Total count 87157 - Distinct count 4 - Null count 0
user_id INTEGER constraint Tips_Users_user_id_fk references Users, --
tip_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 87157 - Distinct count 3 - Null count 0
business_id INTEGER constraint Tips_Business_business_id_fk references Business, --
constraint Tips_pk primary key (business_id, user_id),
);
CREATE TABLE Reviews
(
business_id INTEGER constraint Reviews_Business_business_id_fk references Business, --
review_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 100000 - Distinct count 3 - Null count 0
constraint Reviews_pk primary key (business_id, user_id),
review_votes_funny TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_stars INTEGER, -- Example Values: `2`, `1`, `5`, `4`, `3` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_votes_cool TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
user_id INTEGER constraint Reviews_Users_user_id_fk references Users, --
review_votes_useful TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
);
CREATE TABLE Checkins
(
label_time_7 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_19 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_17 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_1 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_13 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_20 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_14 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_5 TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_2 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_22 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
day_id INTEGER constraint Checkins_Days_day_id_fk references Days, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 80038 - Distinct count 7 - Null count 0
label_time_8 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_0 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_4 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_21 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_23 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_9 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_11 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_16 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_10 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_15 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
business_id INTEGER constraint Checkins_Business_business_id_fk references Business, --
constraint Checkins_pk primary key (business_id, day_id),
label_time_12 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_18 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_3 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_6 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
);
CREATE TABLE Days
(
day_id INTEGER constraint Days_pk primary key,
day_of_week TEXT, -- Example Values: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
);
CREATE TABLE Years
(
actual_year INTEGER, -- Example Values: `2005`, `2006`, `2007`, `2008`, `2009` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
year_id INTEGER constraint Years_pk primary key,
);
CREATE TABLE Business
(
business_id INTEGER constraint Business_pk primary key,
state TEXT, -- Example Values: `AZ`, `SC`, `CA` | Value Statics: Total count 15585 - Distinct count 3 - Null count 0
city TEXT, --
active TEXT, -- Example Values: `true`, `false` | Value Statics: Total count 15585 - Distinct count 2 - Null count 0
stars REAL, -- Example Values: `3.0`, `4.5`, `4.0`, `5.0`, `3.5` | Value Statics: Total count 15585 - Distinct count 9 - Null count 0
review_count TEXT, -- Example Values: `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 15585 - Distinct count 4 - Null count 0
);
CREATE TABLE Business_Attributes
(
business_id INTEGER constraint Business_Attributes_Business_business_id_fk references Business, --
attribute_value TEXT, --
constraint Business_Attributes_pk primary key (attribute_id, business_id),
attribute_id INTEGER constraint Business_Attributes_Attributes_attribute_id_fk references Attributes, --
);
CREATE TABLE Users_Compliments
(
user_id INTEGER constraint Users_Compliments_Users_user_id_fk references Users, --
constraint Users_Compliments_pk primary key (compliment_id, user_id),
number_of_compliments TEXT, -- Example Values: `Medium`, `Low`, `High`, `Uber` | Value Statics: Total count 98810 - Distinct count 4 - Null count 0
compliment_id INTEGER constraint Users_Compliments_Compliments_compliment_id_fk references Compliments, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 98810 - Distinct count 11 - Null count 0
);
CREATE TABLE Compliments
(
compliment_type TEXT, -- Example Values: `photos`, `cool`, `hot`, `note`, `more` | Value Statics: Total count 11 - Distinct count 11 - Null count 0
compliment_id INTEGER constraint Compliments_pk primary key,
);
CREATE TABLE Users
(
user_votes_cool TEXT, -- Example Values: `Low`, `Uber`, `None`, `High`, `Medium` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_yelping_since_year INTEGER, -- Example Values: `2012`, `2010`, `2009`, `2008`, `2013` | Value Statics: Total count 70817 - Distinct count 11 - Null count 0
user_average_stars TEXT, -- Example Values: `4.0`, `2.5`, `4.5`, `5.0`, `2.0` | Value Statics: Total count 70817 - Distinct count 10 - Null count 0
user_review_count TEXT, -- Example Values: `Medium`, `High`, `Low`, `Uber` | Value Statics: Total count 70817 - Distinct count 4 - Null count 0
user_votes_useful TEXT, -- Example Values: `Low`, `Medium`, `Uber`, `None`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_id INTEGER constraint Users_pk primary key,
user_votes_funny TEXT, -- Example Values: `Low`, `None`, `Uber`, `Medium`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_fans TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
); |
movie_platform | Among the lists with at least one follower, how many were created by user who was subscriber when created the list? | lists with at least one follower refers to list_followers > = 1; was a subscriber refers to user_subscriber = 1 | SELECT COUNT(T1.list_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers >= 1 AND T1.user_subscriber = 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | In businesses that violates 103157 on May 27, 2016 , what is the name of the business that has an unscheduled inspection? | businesses that violates 103157 refer to business_id where violation_type_id = 103157; date = '2016-05-27'; unscheduled inspection refers to type = 'Routine - Unscheduled'; | SELECT DISTINCT T3.name FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T1.`date` = '2016-05-27' AND T1.violation_type_id = 103157 AND T2.type = 'Routine - Unscheduled' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
university | How many universities have at least 80,000 students in the year 2011? | have at least 80,000 students refers to num_students > 8000; year = 2011 | SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011 | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
country_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE university
(
university_name TEXT default NULL, --
id INTEGER not null primary key,
country_id INTEGER default NULL, --
foreign key (country_id) references country(id),
);
CREATE TABLE university_year
(
pct_international_students INTEGER default NULL, --
pct_female_students INTEGER default NULL, --
student_staff_ratio REAL default NULL, --
foreign key (university_id) references university(id),
num_students INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 1085 - Distinct count 6 - Null count 0
university_id INTEGER default NULL, --
);
CREATE TABLE ranking_criteria
(
id INTEGER not null primary key,
ranking_system_id INTEGER default NULL, -- Example Values: `1`, `2`, `3` | Value Statics: Total count 21 - Distinct count 3 - Null count 0
criteria_name TEXT default NULL, --
foreign key (ranking_system_id) references ranking_system(id),
);
CREATE TABLE university_ranking_year
(
ranking_criteria_id INTEGER default NULL, --
year INTEGER default NULL, -- Example Values: `2011`, `2012`, `2013`, `2014`, `2015` | Value Statics: Total count 29612 - Distinct count 12 - Null count 0
foreign key (ranking_criteria_id) references ranking_criteria(id),
foreign key (university_id) references university(id),
score INTEGER default NULL, --
university_id INTEGER default NULL, --
); |
public_review_platform | List the categories of active businesses in Surprise, AZ. | categories refers to category_name; active businesses refers to active = 'true'; in Surprise, AZ refers to city = 'Surprise' and state = 'AZ' | SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T1.state LIKE 'AZ' AND T1.city LIKE 'Surprise' GROUP BY T3.category_name | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 - Null count 0
constraint Elite_pk primary key (user_id, year_id),
user_id INTEGER constraint Elite_Users_user_id_fk references Users, --
);
CREATE TABLE Business_Hours
(
closing_time TEXT, --
business_id INTEGER constraint Business_Hours_Business_business_id_fk references Business, --
day_id INTEGER constraint Business_Hours_Days_day_id_fk references Days, -- Example Values: `2`, `3`, `4`, `5`, `6` | Value Statics: Total count 47831 - Distinct count 7 - Null count 0
opening_time TEXT, --
constraint Business_Hours_pk primary key (business_id, day_id),
);
CREATE TABLE Categories
(
category_id INTEGER constraint Categories_pk primary key,
category_name TEXT, --
);
CREATE TABLE Business_Categories
(
business_id INTEGER constraint Business_Categories_Business_business_id_fk references Business, --
category_id INTEGER constraint Business_Categories_Categories_category_id_fk references Categories, --
constraint Business_Categories_pk primary key (business_id, category_id),
);
CREATE TABLE Tips
(
likes INTEGER, -- Example Values: `0`, `1`, `2`, `3` | Value Statics: Total count 87157 - Distinct count 4 - Null count 0
user_id INTEGER constraint Tips_Users_user_id_fk references Users, --
tip_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 87157 - Distinct count 3 - Null count 0
business_id INTEGER constraint Tips_Business_business_id_fk references Business, --
constraint Tips_pk primary key (business_id, user_id),
);
CREATE TABLE Reviews
(
business_id INTEGER constraint Reviews_Business_business_id_fk references Business, --
review_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 100000 - Distinct count 3 - Null count 0
constraint Reviews_pk primary key (business_id, user_id),
review_votes_funny TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_stars INTEGER, -- Example Values: `2`, `1`, `5`, `4`, `3` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_votes_cool TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
user_id INTEGER constraint Reviews_Users_user_id_fk references Users, --
review_votes_useful TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
);
CREATE TABLE Checkins
(
label_time_7 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_19 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_17 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_1 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_13 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_20 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_14 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_5 TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_2 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_22 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
day_id INTEGER constraint Checkins_Days_day_id_fk references Days, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 80038 - Distinct count 7 - Null count 0
label_time_8 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_0 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_4 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_21 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_23 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_9 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_11 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_16 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_10 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_15 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
business_id INTEGER constraint Checkins_Business_business_id_fk references Business, --
constraint Checkins_pk primary key (business_id, day_id),
label_time_12 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_18 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_3 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_6 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
);
CREATE TABLE Days
(
day_id INTEGER constraint Days_pk primary key,
day_of_week TEXT, -- Example Values: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
);
CREATE TABLE Years
(
actual_year INTEGER, -- Example Values: `2005`, `2006`, `2007`, `2008`, `2009` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
year_id INTEGER constraint Years_pk primary key,
);
CREATE TABLE Business
(
business_id INTEGER constraint Business_pk primary key,
state TEXT, -- Example Values: `AZ`, `SC`, `CA` | Value Statics: Total count 15585 - Distinct count 3 - Null count 0
city TEXT, --
active TEXT, -- Example Values: `true`, `false` | Value Statics: Total count 15585 - Distinct count 2 - Null count 0
stars REAL, -- Example Values: `3.0`, `4.5`, `4.0`, `5.0`, `3.5` | Value Statics: Total count 15585 - Distinct count 9 - Null count 0
review_count TEXT, -- Example Values: `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 15585 - Distinct count 4 - Null count 0
);
CREATE TABLE Business_Attributes
(
business_id INTEGER constraint Business_Attributes_Business_business_id_fk references Business, --
attribute_value TEXT, --
constraint Business_Attributes_pk primary key (attribute_id, business_id),
attribute_id INTEGER constraint Business_Attributes_Attributes_attribute_id_fk references Attributes, --
);
CREATE TABLE Users_Compliments
(
user_id INTEGER constraint Users_Compliments_Users_user_id_fk references Users, --
constraint Users_Compliments_pk primary key (compliment_id, user_id),
number_of_compliments TEXT, -- Example Values: `Medium`, `Low`, `High`, `Uber` | Value Statics: Total count 98810 - Distinct count 4 - Null count 0
compliment_id INTEGER constraint Users_Compliments_Compliments_compliment_id_fk references Compliments, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 98810 - Distinct count 11 - Null count 0
);
CREATE TABLE Compliments
(
compliment_type TEXT, -- Example Values: `photos`, `cool`, `hot`, `note`, `more` | Value Statics: Total count 11 - Distinct count 11 - Null count 0
compliment_id INTEGER constraint Compliments_pk primary key,
);
CREATE TABLE Users
(
user_votes_cool TEXT, -- Example Values: `Low`, `Uber`, `None`, `High`, `Medium` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_yelping_since_year INTEGER, -- Example Values: `2012`, `2010`, `2009`, `2008`, `2013` | Value Statics: Total count 70817 - Distinct count 11 - Null count 0
user_average_stars TEXT, -- Example Values: `4.0`, `2.5`, `4.5`, `5.0`, `2.0` | Value Statics: Total count 70817 - Distinct count 10 - Null count 0
user_review_count TEXT, -- Example Values: `Medium`, `High`, `Low`, `Uber` | Value Statics: Total count 70817 - Distinct count 4 - Null count 0
user_votes_useful TEXT, -- Example Values: `Low`, `Medium`, `Uber`, `None`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_id INTEGER constraint Users_pk primary key,
user_votes_funny TEXT, -- Example Values: `Low`, `None`, `Uber`, `Medium`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_fans TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
); |
movie_platform | Which title list has not been updated for the longest period of time? State how long it has not been updated? | not been updated for the longest period of time refers to MIN(list_update_timestamp_utc); how long it has not been updated refers to SUBTRACT(CURRENT_TIMESTAMP, list_update_timestamp_utc) | SELECT list_title , datetime(CURRENT_TIMESTAMP, 'localtime') - datetime(list_update_timestamp_utc) FROM lists ORDER BY list_update_timestamp_utc LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | List the tax code and inspection type of the business named "Rue Lepic". | "Rue Lepic" is the name of the business; | SELECT DISTINCT T3.tax_code, T2.type FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T3.name = 'Rue Lepic' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
music_platform_2 | What is the average rating of the podcast "Please Excuse My Dead Aunt Sally"? | "Please Excuse My Dead Aunty Sally" is the title of podcast; Average rating = Divide (Sum(rating), Count(rating)) | SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' | CREATE TABLE reviews
(
author_id TEXT not null, --
rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
title TEXT not null, --
podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, --
content TEXT not null, --
created_at TEXT not null, --
);
CREATE TABLE categories
(
category TEXT not null, --
podcast_id TEXT not null constraint categories_podcasts_podcast_id_fk references podcasts, --
constraint "PRIMARY" primary key (podcast_id, category),
);
CREATE TABLE runs
(
reviews_added integer not null, -- Example Values: `1215223`, `13139`, `11561`, `11855`, `11714` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
run_at text not null, -- Example Values: `2021-05-10 02:53:00`, `2021-06-06 21:34:36`, `2021-07-02 18:04:55`, `2021-08-01 17:54:42`, `2021-09-02 18:00:30` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
max_rowid integer not null, -- Example Values: `3266481`, `3300773`, `3329699`, `3360315`, `3390165` | Value Statics: Total count 12 - Distinct count 11 - Null count 0
);
CREATE TABLE podcasts
(
itunes_id integer not null, --
title text not null, --
itunes_url text not null, --
podcast_id text primary key,
slug text not null, --
); |
beer_factory | Which type of card did Dick Ruthven use to pay for all of his transactions? | type of card refers to CreditCardType; | SELECT DISTINCT T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Dick' AND T1.Last = 'Ruthven' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
olympics | How many Olympic games were held in London? | London refers to city_name = 'London'; | SELECT COUNT(T1.games_id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
disney | What is the most popular movie directed by Ron Clements? | Ron Clements refers to director = 'Ron Clements'; the most popular movie refers to movie_title where MAX(total_gross); | SELECT T2.name FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Ron Clements' ORDER BY CAST(REPLACE(SUBSTR(total_gross, 2), ',', '') AS int) DESC LIMIT 1 | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
movie_platform | Give the percentage of subscribers who rated who rated the movie "G.I. Jane". | movie "G.I. Jane" refers to movie_title = 'G.I. Jane'; subscribers refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(user_subscriber))*100 | SELECT CAST(SUM(CASE WHEN T3.user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'G.I. Jane' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category. | businesses with score that ranges from 70 to 80 refer to business_id where score between 80 and 90; | SELECT DISTINCT T1.violation_type_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id INNER JOIN inspections AS T3 ON T2.business_id = T3.business_id WHERE T3.score BETWEEN 70 AND 80 | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
music_platform_2 | How many ratings of 5 have been given to the podcast "Please Excuse My Dead Aunt Sally"? | rating of 5 refers to rating = 5; 'Please Excuse My Dead Aunt Sally' is the title of podcast | SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.rating = 5 | CREATE TABLE reviews
(
author_id TEXT not null, --
rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
title TEXT not null, --
podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, --
content TEXT not null, --
created_at TEXT not null, --
);
CREATE TABLE categories
(
category TEXT not null, --
podcast_id TEXT not null constraint categories_podcasts_podcast_id_fk references podcasts, --
constraint "PRIMARY" primary key (podcast_id, category),
);
CREATE TABLE runs
(
reviews_added integer not null, -- Example Values: `1215223`, `13139`, `11561`, `11855`, `11714` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
run_at text not null, -- Example Values: `2021-05-10 02:53:00`, `2021-06-06 21:34:36`, `2021-07-02 18:04:55`, `2021-08-01 17:54:42`, `2021-09-02 18:00:30` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
max_rowid integer not null, -- Example Values: `3266481`, `3300773`, `3329699`, `3360315`, `3390165` | Value Statics: Total count 12 - Distinct count 11 - Null count 0
);
CREATE TABLE podcasts
(
itunes_id integer not null, --
title text not null, --
itunes_url text not null, --
podcast_id text primary key,
slug text not null, --
); |
beer_factory | Which brand has the lowest star rating with a "Too spicy!" review? | lowest star rating refers to MIN(StarRating); "Too spicy!" review refers to Review = 'Too Spicy!'; | SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T2.BrandID = T1.BrandID WHERE T2.StarRating = 1 AND T2.Review = 'Too Spicy!' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
public_review_platform | Among the active businesses located at Chandler, AZ, list the category and atrributes of business with a medium review count. | active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name | SELECT T3.category_name, T5.attribute_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id INNER JOIN Business_Attributes AS T4 ON T1.business_id = T4.business_id INNER JOIN Attributes AS T5 ON T4.attribute_id = T5.attribute_id WHERE T1.active LIKE 'TRUE' AND T1.state LIKE 'AZ' AND T1.city LIKE 'Chandler' AND T1.review_count LIKE 'Medium' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 - Null count 0
constraint Elite_pk primary key (user_id, year_id),
user_id INTEGER constraint Elite_Users_user_id_fk references Users, --
);
CREATE TABLE Business_Hours
(
closing_time TEXT, --
business_id INTEGER constraint Business_Hours_Business_business_id_fk references Business, --
day_id INTEGER constraint Business_Hours_Days_day_id_fk references Days, -- Example Values: `2`, `3`, `4`, `5`, `6` | Value Statics: Total count 47831 - Distinct count 7 - Null count 0
opening_time TEXT, --
constraint Business_Hours_pk primary key (business_id, day_id),
);
CREATE TABLE Categories
(
category_id INTEGER constraint Categories_pk primary key,
category_name TEXT, --
);
CREATE TABLE Business_Categories
(
business_id INTEGER constraint Business_Categories_Business_business_id_fk references Business, --
category_id INTEGER constraint Business_Categories_Categories_category_id_fk references Categories, --
constraint Business_Categories_pk primary key (business_id, category_id),
);
CREATE TABLE Tips
(
likes INTEGER, -- Example Values: `0`, `1`, `2`, `3` | Value Statics: Total count 87157 - Distinct count 4 - Null count 0
user_id INTEGER constraint Tips_Users_user_id_fk references Users, --
tip_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 87157 - Distinct count 3 - Null count 0
business_id INTEGER constraint Tips_Business_business_id_fk references Business, --
constraint Tips_pk primary key (business_id, user_id),
);
CREATE TABLE Reviews
(
business_id INTEGER constraint Reviews_Business_business_id_fk references Business, --
review_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 100000 - Distinct count 3 - Null count 0
constraint Reviews_pk primary key (business_id, user_id),
review_votes_funny TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_stars INTEGER, -- Example Values: `2`, `1`, `5`, `4`, `3` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_votes_cool TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
user_id INTEGER constraint Reviews_Users_user_id_fk references Users, --
review_votes_useful TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
);
CREATE TABLE Checkins
(
label_time_7 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_19 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_17 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_1 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_13 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_20 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_14 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_5 TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_2 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_22 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
day_id INTEGER constraint Checkins_Days_day_id_fk references Days, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 80038 - Distinct count 7 - Null count 0
label_time_8 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_0 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_4 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_21 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_23 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_9 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_11 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_16 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_10 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_15 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
business_id INTEGER constraint Checkins_Business_business_id_fk references Business, --
constraint Checkins_pk primary key (business_id, day_id),
label_time_12 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_18 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_3 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_6 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
);
CREATE TABLE Days
(
day_id INTEGER constraint Days_pk primary key,
day_of_week TEXT, -- Example Values: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
);
CREATE TABLE Years
(
actual_year INTEGER, -- Example Values: `2005`, `2006`, `2007`, `2008`, `2009` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
year_id INTEGER constraint Years_pk primary key,
);
CREATE TABLE Business
(
business_id INTEGER constraint Business_pk primary key,
state TEXT, -- Example Values: `AZ`, `SC`, `CA` | Value Statics: Total count 15585 - Distinct count 3 - Null count 0
city TEXT, --
active TEXT, -- Example Values: `true`, `false` | Value Statics: Total count 15585 - Distinct count 2 - Null count 0
stars REAL, -- Example Values: `3.0`, `4.5`, `4.0`, `5.0`, `3.5` | Value Statics: Total count 15585 - Distinct count 9 - Null count 0
review_count TEXT, -- Example Values: `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 15585 - Distinct count 4 - Null count 0
);
CREATE TABLE Business_Attributes
(
business_id INTEGER constraint Business_Attributes_Business_business_id_fk references Business, --
attribute_value TEXT, --
constraint Business_Attributes_pk primary key (attribute_id, business_id),
attribute_id INTEGER constraint Business_Attributes_Attributes_attribute_id_fk references Attributes, --
);
CREATE TABLE Users_Compliments
(
user_id INTEGER constraint Users_Compliments_Users_user_id_fk references Users, --
constraint Users_Compliments_pk primary key (compliment_id, user_id),
number_of_compliments TEXT, -- Example Values: `Medium`, `Low`, `High`, `Uber` | Value Statics: Total count 98810 - Distinct count 4 - Null count 0
compliment_id INTEGER constraint Users_Compliments_Compliments_compliment_id_fk references Compliments, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 98810 - Distinct count 11 - Null count 0
);
CREATE TABLE Compliments
(
compliment_type TEXT, -- Example Values: `photos`, `cool`, `hot`, `note`, `more` | Value Statics: Total count 11 - Distinct count 11 - Null count 0
compliment_id INTEGER constraint Compliments_pk primary key,
);
CREATE TABLE Users
(
user_votes_cool TEXT, -- Example Values: `Low`, `Uber`, `None`, `High`, `Medium` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_yelping_since_year INTEGER, -- Example Values: `2012`, `2010`, `2009`, `2008`, `2013` | Value Statics: Total count 70817 - Distinct count 11 - Null count 0
user_average_stars TEXT, -- Example Values: `4.0`, `2.5`, `4.5`, `5.0`, `2.0` | Value Statics: Total count 70817 - Distinct count 10 - Null count 0
user_review_count TEXT, -- Example Values: `Medium`, `High`, `Low`, `Uber` | Value Statics: Total count 70817 - Distinct count 4 - Null count 0
user_votes_useful TEXT, -- Example Values: `Low`, `Medium`, `Uber`, `None`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_id INTEGER constraint Users_pk primary key,
user_votes_funny TEXT, -- Example Values: `Low`, `None`, `Uber`, `Medium`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_fans TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
); |
movie_platform | For the list with more than 200 followers, state the title and how long the list has been created? | more than 200 followers refers to list_followers >200; how long the list has been created refers to SUBTRACT(CURRENT_TIMESTAMP,list_creation_timestamp_utc) | SELECT list_title , 365 * (strftime('%Y', 'now') - strftime('%Y', list_creation_timestamp_utc)) + 30 * (strftime('%m', 'now') - strftime('%m', list_creation_timestamp_utc)) + strftime('%d', 'now') - strftime('%d', list_creation_timestamp_utc) FROM lists WHERE list_followers > 200 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | Among the businesses within the postal code 94117, what is total number of businesses with a high risk category? | businesses with a high risk category refer to business_id where risk_category = 'High Risk'; | SELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.postal_code = 94117 AND T1.risk_category = 'High Risk' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
music_platform_2 | Please list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review. | author whose ID is F7E5A318989779D refers to author_id = 'F7E5A318989779D' | SELECT T2.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'F7E5A318989779D' | CREATE TABLE reviews
(
author_id TEXT not null, --
rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
title TEXT not null, --
podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, --
content TEXT not null, --
created_at TEXT not null, --
);
CREATE TABLE categories
(
category TEXT not null, --
podcast_id TEXT not null constraint categories_podcasts_podcast_id_fk references podcasts, --
constraint "PRIMARY" primary key (podcast_id, category),
);
CREATE TABLE runs
(
reviews_added integer not null, -- Example Values: `1215223`, `13139`, `11561`, `11855`, `11714` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
run_at text not null, -- Example Values: `2021-05-10 02:53:00`, `2021-06-06 21:34:36`, `2021-07-02 18:04:55`, `2021-08-01 17:54:42`, `2021-09-02 18:00:30` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
max_rowid integer not null, -- Example Values: `3266481`, `3300773`, `3329699`, `3360315`, `3390165` | Value Statics: Total count 12 - Distinct count 11 - Null count 0
);
CREATE TABLE podcasts
(
itunes_id integer not null, --
title text not null, --
itunes_url text not null, --
podcast_id text primary key,
slug text not null, --
); |
disney | How many horror movies are there? | Horror refers to genre = 'Horror'; | SELECT COUNT(movie_title) FROM `movies_total_gross` WHERE genre = 'Horror' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
movie_platform | List all the titles created by user who was a subsriber when he created the list and have less than 50 movies in the list. | have less than 50 movies in the list refers to list_movie_number <50; was a subscriber refers to user_subscriber = 1 | SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number < 50 AND T1.user_subscriber = 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | List owner's name of businesses with a 100 score. | owner's name of businesses refers to owner_name; | SELECT DISTINCT T2.owner_name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100 | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
music_platform_2 | Among the reviews for the podcast "Please Excuse My Dead Aunt Sally", how many of them are made in the year 2019? | "Please Excuse My Dead Aunt Sally" is the title of podcast; made in the year 2019 refers to created_at like '2019%' | SELECT COUNT(T2.created_at) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.created_at LIKE '2019-%' | CREATE TABLE reviews
(
author_id TEXT not null, --
rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
title TEXT not null, --
podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, --
content TEXT not null, --
created_at TEXT not null, --
);
CREATE TABLE categories
(
category TEXT not null, --
podcast_id TEXT not null constraint categories_podcasts_podcast_id_fk references podcasts, --
constraint "PRIMARY" primary key (podcast_id, category),
);
CREATE TABLE runs
(
reviews_added integer not null, -- Example Values: `1215223`, `13139`, `11561`, `11855`, `11714` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
run_at text not null, -- Example Values: `2021-05-10 02:53:00`, `2021-06-06 21:34:36`, `2021-07-02 18:04:55`, `2021-08-01 17:54:42`, `2021-09-02 18:00:30` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
max_rowid integer not null, -- Example Values: `3266481`, `3300773`, `3329699`, `3360315`, `3390165` | Value Statics: Total count 12 - Distinct count 11 - Null count 0
);
CREATE TABLE podcasts
(
itunes_id integer not null, --
title text not null, --
itunes_url text not null, --
podcast_id text primary key,
slug text not null, --
); |
beer_factory | What is the precise location of the place where Tommy Kono made a purchase in 2014? | precise location = Latitude, Longitude; in 2014 refers to TransactionDate LIKE '2014%'; | SELECT DISTINCT T1.Latitude, T1.Longitude FROM geolocation AS T1 INNER JOIN `transaction` AS T2 ON T2.LocationID = T1.LocationID INNER JOIN customers AS T3 ON T3.CustomerID = T2.CustomerID WHERE T3.First = 'Tommy' AND T3.Last = 'Kono' AND T2.TransactionDate LIKE '2014%' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
olympics | At what age did Michael Fred Phelps, II join the Olympics? | At what age join the Olympics refers to MIN(age); | SELECT T2.age FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Michael Fred Phelps, II' ORDER BY T2.age LIMIT 1 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NULL, --
id INTEGER not null primary key,
);
CREATE TABLE games_city
(
city_id INTEGER default NULL, --
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
foreign key (city_id) references city(id),
);
CREATE TABLE competitor_event
(
foreign key (event_id) references event(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (competitor_id) references games_competitor(id),
foreign key (medal_id) references medal(id),
medal_id INTEGER default NULL, -- Example Values: `4`, `1`, `3`, `2` | Value Statics: Total count 100000 - Distinct count 4 - Null count 0
event_id INTEGER default NULL, --
competitor_id INTEGER default NULL, --
);
CREATE TABLE person
(
weight INTEGER default NULL, --
height INTEGER default NULL, --
id INTEGER not null primary key,
full_name TEXT default NULL, --
gender TEXT default NULL, -- Example Values: `M`, `F` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
);
CREATE TABLE noc_region
(
region_name TEXT default NULL, --
id INTEGER not null primary key,
noc TEXT default NULL, --
);
CREATE TABLE medal
(
id INTEGER not null primary key,
medal_name TEXT default NULL, -- Example Values: `Gold`, `Silver`, `Bronze`, `NA` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
);
CREATE TABLE person_region
(
foreign key (region_id) references noc_region(id),
region_id INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
);
CREATE TABLE games
(
season TEXT default NULL, -- Example Values: `Summer`, `Winter` | Value Statics: Total count 51 - Distinct count 2 - Null count 0
id INTEGER not null primary key,
games_name TEXT default NULL, --
games_year INTEGER default NULL, --
);
CREATE TABLE games_competitor
(
id INTEGER not null primary key,
foreign key (games_id) references games(id),
games_id INTEGER default NULL, --
age INTEGER default NULL, --
foreign key (person_id) references person(id),
person_id INTEGER default NULL, --
); |
disney | How many movies for mature audiences or parental guidance suggested did Bill Thompson work as a voice actor? | movies for mature audiences or parental guidance refer to movie_title where MPAA_rating = 'PG'; | SELECT COUNT(T.movie) FROM ( SELECT T1.movie FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie = T2.movie_title WHERE MPAA_rating = 'PG' AND `voice-actor` = 'Bill Thompson' GROUP BY T1.movie ) AS T | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
movie_platform | Who is the user who created the list titled 'Sound and Vision'? Was he a subcriber when he created the list? | list titled 'Sound and Vision' refers to list_title = 'Sound and Vision'; user_subscriber = 1 means the user was a subscriber when he rated the movie; user_subscriber = 0 means the user was not a subscriber when he rated the movie
| SELECT T1.user_id, T1.user_subscriber FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Sound and Vision' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
food_inspection | Give the business ID and risk category of the business owned by San Francisco Madeleine, Inc. | business owned by San Francisco Madeleine, Inc. refers to business_id where owner_name = 'San Francisco Madeleine, Inc.'; | SELECT DISTINCT T2.business_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_name = 'San Francisco Madeleine, Inc.' | CREATE TABLE violations
(
`risk_category` TEXT NOT NULL, -- Example Values: `Moderate Risk`, `Low Risk`, `High Risk` | Value Statics: Total count 36050 - Distinct count 3 - Null count 0
`date` DATE NOT NULL, --
`violation_type_id` TEXT NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`description` TEXT NOT NULL, --
`business_id` INTEGER NOT NULL, --
);
CREATE TABLE businesses
(
`phone_number` INTEGER DEFAULT NULL, --
`postal_code` TEXT DEFAULT NULL, --
`owner_city` TEXT DEFAULT NULL, --
`owner_name` TEXT NOT NULL, --
`business_certificate` INTEGER NOT NULL, --
PRIMARY KEY (`business_id`),
`owner_zip` TEXT DEFAULT NULL, --
`address` TEXT DEFAULT NULL, --
`longitude` REAL DEFAULT NULL, --
`owner_state` TEXT DEFAULT NULL, --
`tax_code` TEXT DEFAULT NULL, --
`latitude` REAL DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
`name` TEXT NOT NULL, --
`city` TEXT DEFAULT NULL, --
`owner_address` TEXT DEFAULT NULL, --
`application_date` DATE DEFAULT NULL, --
);
CREATE TABLE inspections
(
`type` TEXT NOT NULL, -- Example Values: `Routine - Unscheduled`, `Reinspection/Followup`, `Complaint Reinspection/Followup`, `Non-inspection site visit`, `Complaint` | Value Statics: Total count 23764 - Distinct count 13 - Null count 0
`score` INTEGER DEFAULT NULL, --
`business_id` INTEGER NOT NULL, --
FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`),
`date` DATE NOT NULL, --
); |
music_platform_2 | How many reviews are created for the podcast "Scaling Global" under? | "Scaling Global" is the title of podcast | SELECT COUNT(T2.content) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Scaling Global' | CREATE TABLE reviews
(
author_id TEXT not null, --
rating INTEGER not null, -- Example Values: `5`, `1`, `3`, `4`, `2` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
title TEXT not null, --
podcast_id TEXT not null constraint reviews_podcasts_podcast_id_fk references podcasts, --
content TEXT not null, --
created_at TEXT not null, --
);
CREATE TABLE categories
(
category TEXT not null, --
podcast_id TEXT not null constraint categories_podcasts_podcast_id_fk references podcasts, --
constraint "PRIMARY" primary key (podcast_id, category),
);
CREATE TABLE runs
(
reviews_added integer not null, -- Example Values: `1215223`, `13139`, `11561`, `11855`, `11714` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
run_at text not null, -- Example Values: `2021-05-10 02:53:00`, `2021-06-06 21:34:36`, `2021-07-02 18:04:55`, `2021-08-01 17:54:42`, `2021-09-02 18:00:30` | Value Statics: Total count 12 - Distinct count 12 - Null count 0
max_rowid integer not null, -- Example Values: `3266481`, `3300773`, `3329699`, `3360315`, `3390165` | Value Statics: Total count 12 - Distinct count 11 - Null count 0
);
CREATE TABLE podcasts
(
itunes_id integer not null, --
title text not null, --
itunes_url text not null, --
podcast_id text primary key,
slug text not null, --
); |
beer_factory | How many stars did Urijah Faber rate for Frostie? | stars refers to StarRating; Frostie refers to BrandName = 'Frostie'; | SELECT T2.StarRating FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Urijah' AND T1.Last = 'Faber' AND T3.BrandName = 'Frostie' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Distinct count 2 - Null count 22
Honey TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Alcoholic TEXT, -- Example Values: `FALSE` | Value Statics: Total count 24 - Distinct count 1 - Null count 0
City TEXT, --
Country TEXT, -- Example Values: `United States`, `Australia` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
Caffeinated TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInCans TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BreweryName TEXT, --
FacebookPage TEXT, -- Example Values: `https://www.facebook.com/Dads-Old-Fashioned-Root-Beer-and-Cream-Soda-117159998301204/`, `https://www.facebook.com/Dog-N-Suds-Bottled-Root-Beer-117372294947833/`, `https://www.facebook.com/fitzsrootbeer`, `https://www.facebook.com/Gales-Root-Beer-207365072632626/`, `https://www.facebook.com/MugRootBeer/` | Value Statics: Total count 6 - Distinct count 6 - Null count 18
FirstBrewedYear INTEGER, -- Example Values: `1919`, `1926`, `1986`, `1898`, `1984` | Value Statics: Total count 24 - Distinct count 19 - Null count 0
BrandID INTEGER primary key,
CurrentRetailPrice REAL, -- Example Values: `1.0`, `3.0`, `44.0` | Value Statics: Total count 24 - Distinct count 3 - Null count 0
ArtificialSweetener TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
BrandName TEXT, --
CornSyrup TEXT, -- Example Values: `TRUE`, `FALSE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInBottles TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
AvailableInKegs TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
WholesaleCost REAL, -- Example Values: `0.42`, `0.98`, `1.13`, `0.4`, `1.1` | Value Statics: Total count 24 - Distinct count 17 - Null count 0
Description TEXT, --
CaneSugar TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 24 - Distinct count 2 - Null count 0
);
CREATE TABLE rootbeerreview
(
CustomerID INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
ReviewDate DATE, --
BrandID INTEGER, --
Review TEXT, -- Example Values: `You could have done better Sactown.`, `Too much bite, not enough barq.`, `The drink is fine, but the crest on the label is pretentious.`, `Fantastic!`, `Love stopping by Fitz's in St. Louis.` | Value Statics: Total count 16 - Distinct count 16 - Null count 697
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
StarRating INTEGER, -- Example Values: `5`, `1`, `3`, `2`, `4` | Value Statics: Total count 713 - Distinct count 5 - Null count 0
primary key (CustomerID, BrandID),
);
CREATE TABLE customers
(
StreetAddress TEXT, --
Email TEXT, --
FirstPurchaseDate DATE, --
CustomerID INTEGER primary key,
State TEXT, -- Example Values: `CA` | Value Statics: Total count 554 - Distinct count 1 - Null count 0
SubscribedToEmailList TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
City TEXT, --
Gender TEXT, -- Example Values: `M`, `F` | Value Statics: Total count 554 - Distinct count 2 - Null count 0
Last TEXT, --
PhoneNumber TEXT, --
First TEXT, --
ZipCode INTEGER, --
);
CREATE TABLE location
(
LocationID INTEGER primary key,
LocationName TEXT, -- Example Values: `LOST`, `Sac State American River Courtyard`, `Sac State Union` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
ZipCode INTEGER, -- Example Values: `95819` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
StreetAddress TEXT, -- Example Values: `6000 J St` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
City TEXT, -- Example Values: `Sacramento` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
State TEXT, -- Example Values: `CA` | Value Statics: Total count 2 - Distinct count 1 - Null count 1
);
CREATE TABLE geolocation
(
Longitude REAL, -- Example Values: `0.0`, `-121.426432`, `-121.42243` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
foreign key (LocationID) references location(LocationID),
LocationID INTEGER primary key,
Latitude REAL, -- Example Values: `0.0`, `38.566129`, `38.559615` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE rootbeer
(
foreign key (BrandID) references rootbeerbrand(BrandID),
foreign key (BrandID) references rootbeerbrand(BrandID),
RootBeerID INTEGER primary key,
foreign key (LocationID) references location(LocationID),
PurchaseDate DATE, --
ContainerType TEXT, -- Example Values: `Bottle`, `Can` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
foreign key (LocationID) references geolocation(LocationID),
foreign key (LocationID) references geolocation(LocationID),
LocationID INTEGER, -- Example Values: `1`, `2` | Value Statics: Total count 6430 - Distinct count 2 - Null count 0
BrandID INTEGER, --
);
CREATE TABLE transaction
(
CreditCardType TEXT, -- Example Values: `Discover`, `Visa`, `MasterCard`, `American Express` | Value Statics: Total count 6312 - Distinct count 4 - Null count 0
CreditCardNumber INTEGER, --
foreign key (CustomerID) references customers(CustomerID),
LocationID INTEGER, -- Example Values: `2`, `1` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
foreign key (RootBeerID) references rootbeer(RootBeerID),
TransactionID INTEGER primary key,
CustomerID INTEGER, --
RootBeerID INTEGER, --
TransactionDate DATE, --
foreign key (LocationID) references location(LocationID),
PurchasePrice REAL, -- Example Values: `3.0`, `1.0` | Value Statics: Total count 6312 - Distinct count 2 - Null count 0
); |
disney | List the voice actors from the movie "Meet the Robinsons". | Meet the Robinsons refers to movie_title = 'Meet the Robinsons'; | SELECT 'voice-actor' FROM `voice-actors` WHERE movie = 'Meet the Robinsons' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEXT, -- Example Values: `Musical`, `Adventure`, `Drama`, `Comedy`, `` | Value Statics: Total count 579 - Distinct count 13 - Null count 0
inflation_adjusted_gross TEXT, --
primary key (movie_title, release_date),
);
CREATE TABLE voice-actors
(
movie TEXT, --
foreign key (movie) references characters(movie_title),
character TEXT primary key,
"voice-actor" TEXT, --
);
CREATE TABLE director
(
director TEXT, --
name TEXT primary key,
foreign key (name) references characters(movie_title),
);
CREATE TABLE characters
(
villian TEXT, --
hero TEXT, --
foreign key (hero) references "voice-actors"(character),
release_date TEXT, --
song TEXT, --
movie_title TEXT primary key,
);
CREATE TABLE revenue
(
Year INTEGER primary key,
"Disney Consumer Products[NI 2]" REAL, --
Total INTEGER, --
"Studio Entertainment[NI 1]" REAL, --
"Disney Media Networks" TEXT, --
"Walt Disney Parks and Resorts" REAL, --
"Disney Interactive[NI 3][Rev 1]" INTEGER, -- Example Values: `174`, `260`, `206`, `368`, `719` | Value Statics: Total count 12 - Distinct count 12 - Null count 14
); |
public_review_platform | What is the attribute value of an active business with a high review count and 3 stars which is located at Mesa, AZ? | active business refers to active = 'true'; located at Mesa, AZ refers to city = 'Mesa', state = 'AZ' | SELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.state LIKE 'AZ' AND T1.review_count LIKE 'High' AND T1.active LIKE 'TRUE' AND T1.city LIKE 'Mesa' AND T1.stars = 3 | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 - Null count 0
constraint Elite_pk primary key (user_id, year_id),
user_id INTEGER constraint Elite_Users_user_id_fk references Users, --
);
CREATE TABLE Business_Hours
(
closing_time TEXT, --
business_id INTEGER constraint Business_Hours_Business_business_id_fk references Business, --
day_id INTEGER constraint Business_Hours_Days_day_id_fk references Days, -- Example Values: `2`, `3`, `4`, `5`, `6` | Value Statics: Total count 47831 - Distinct count 7 - Null count 0
opening_time TEXT, --
constraint Business_Hours_pk primary key (business_id, day_id),
);
CREATE TABLE Categories
(
category_id INTEGER constraint Categories_pk primary key,
category_name TEXT, --
);
CREATE TABLE Business_Categories
(
business_id INTEGER constraint Business_Categories_Business_business_id_fk references Business, --
category_id INTEGER constraint Business_Categories_Categories_category_id_fk references Categories, --
constraint Business_Categories_pk primary key (business_id, category_id),
);
CREATE TABLE Tips
(
likes INTEGER, -- Example Values: `0`, `1`, `2`, `3` | Value Statics: Total count 87157 - Distinct count 4 - Null count 0
user_id INTEGER constraint Tips_Users_user_id_fk references Users, --
tip_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 87157 - Distinct count 3 - Null count 0
business_id INTEGER constraint Tips_Business_business_id_fk references Business, --
constraint Tips_pk primary key (business_id, user_id),
);
CREATE TABLE Reviews
(
business_id INTEGER constraint Reviews_Business_business_id_fk references Business, --
review_length TEXT, -- Example Values: `Medium`, `Short`, `Long` | Value Statics: Total count 100000 - Distinct count 3 - Null count 0
constraint Reviews_pk primary key (business_id, user_id),
review_votes_funny TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_stars INTEGER, -- Example Values: `2`, `1`, `5`, `4`, `3` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
review_votes_cool TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
user_id INTEGER constraint Reviews_Users_user_id_fk references Users, --
review_votes_useful TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
);
CREATE TABLE Checkins
(
label_time_7 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_19 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_17 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_1 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_13 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_20 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_14 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_5 TEXT, -- Example Values: `None`, `Low`, `Medium`, `Uber`, `High` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_2 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_22 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
day_id INTEGER constraint Checkins_Days_day_id_fk references Days, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 80038 - Distinct count 7 - Null count 0
label_time_8 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_0 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_4 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_21 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_23 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High` | Value Statics: Total count 80038 - Distinct count 4 - Null count 0
label_time_9 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_11 TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_16 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_10 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_15 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
business_id INTEGER constraint Checkins_Business_business_id_fk references Business, --
constraint Checkins_pk primary key (business_id, day_id),
label_time_12 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_18 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
label_time_3 TEXT, -- Example Values: `None`, `Low`, `Medium` | Value Statics: Total count 80038 - Distinct count 3 - Null count 0
label_time_6 TEXT, -- Example Values: `None`, `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 80038 - Distinct count 5 - Null count 0
);
CREATE TABLE Days
(
day_id INTEGER constraint Days_pk primary key,
day_of_week TEXT, -- Example Values: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
);
CREATE TABLE Years
(
actual_year INTEGER, -- Example Values: `2005`, `2006`, `2007`, `2008`, `2009` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
year_id INTEGER constraint Years_pk primary key,
);
CREATE TABLE Business
(
business_id INTEGER constraint Business_pk primary key,
state TEXT, -- Example Values: `AZ`, `SC`, `CA` | Value Statics: Total count 15585 - Distinct count 3 - Null count 0
city TEXT, --
active TEXT, -- Example Values: `true`, `false` | Value Statics: Total count 15585 - Distinct count 2 - Null count 0
stars REAL, -- Example Values: `3.0`, `4.5`, `4.0`, `5.0`, `3.5` | Value Statics: Total count 15585 - Distinct count 9 - Null count 0
review_count TEXT, -- Example Values: `Low`, `Medium`, `High`, `Uber` | Value Statics: Total count 15585 - Distinct count 4 - Null count 0
);
CREATE TABLE Business_Attributes
(
business_id INTEGER constraint Business_Attributes_Business_business_id_fk references Business, --
attribute_value TEXT, --
constraint Business_Attributes_pk primary key (attribute_id, business_id),
attribute_id INTEGER constraint Business_Attributes_Attributes_attribute_id_fk references Attributes, --
);
CREATE TABLE Users_Compliments
(
user_id INTEGER constraint Users_Compliments_Users_user_id_fk references Users, --
constraint Users_Compliments_pk primary key (compliment_id, user_id),
number_of_compliments TEXT, -- Example Values: `Medium`, `Low`, `High`, `Uber` | Value Statics: Total count 98810 - Distinct count 4 - Null count 0
compliment_id INTEGER constraint Users_Compliments_Compliments_compliment_id_fk references Compliments, -- Example Values: `1`, `2`, `3`, `4`, `5` | Value Statics: Total count 98810 - Distinct count 11 - Null count 0
);
CREATE TABLE Compliments
(
compliment_type TEXT, -- Example Values: `photos`, `cool`, `hot`, `note`, `more` | Value Statics: Total count 11 - Distinct count 11 - Null count 0
compliment_id INTEGER constraint Compliments_pk primary key,
);
CREATE TABLE Users
(
user_votes_cool TEXT, -- Example Values: `Low`, `Uber`, `None`, `High`, `Medium` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_yelping_since_year INTEGER, -- Example Values: `2012`, `2010`, `2009`, `2008`, `2013` | Value Statics: Total count 70817 - Distinct count 11 - Null count 0
user_average_stars TEXT, -- Example Values: `4.0`, `2.5`, `4.5`, `5.0`, `2.0` | Value Statics: Total count 70817 - Distinct count 10 - Null count 0
user_review_count TEXT, -- Example Values: `Medium`, `High`, `Low`, `Uber` | Value Statics: Total count 70817 - Distinct count 4 - Null count 0
user_votes_useful TEXT, -- Example Values: `Low`, `Medium`, `Uber`, `None`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_id INTEGER constraint Users_pk primary key,
user_votes_funny TEXT, -- Example Values: `Low`, `None`, `Uber`, `Medium`, `High` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
user_fans TEXT, -- Example Values: `Low`, `None`, `Medium`, `High`, `Uber` | Value Statics: Total count 70817 - Distinct count 5 - Null count 0
); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.