output
stringlengths 18
577
| instruction
stringlengths 16
224
| input
stringclasses 160
values |
---|---|---|
SELECT count(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001 | How many budgets are above 3000 in year 2001 or before? | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT count(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001 | Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000 | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT T2.school_name , T1.budgeted , T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002 | Show each school name, its budgeted amount, and invested amount in year 2002 or after. | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT DISTINCT donator_name FROM endowment | Show all donor names. | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT count(*) FROM budget WHERE budgeted < invested | How many budget record has a budget amount smaller than the invested amount? | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' | What is the total budget amount for school "Glenn" in all years? | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted) > 100 OR sum(T3.amount) > 10 | Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10. | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING count(*) > 1 | Find the names of schools that have more than one donator with donation amount above 8.5. | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT count(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING count(*) > 1) | Find the number of schools that have more than one donator whose donation amount is less than 8.5. | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT T1.School_name , T1.Mascot , T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested , T2.total_budget_percent_budgeted | List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget. | "Schema (values (type))": School : School_id (text) , School_name (text) , Location (text) , Mascot (text) , Enrollment (number) , IHSAA_Class (text) , IHSAA_Football_Class (text) , County (text) | budget : School_id (number) , Year (number) , Budgeted (number) , total_budget_percent_budgeted (number) , Invested (number) , total_budget_percent_invested (number) , Budget_invested_percent (text) | endowment : endowment_id (number) , School_id (number) , donator_name (text) , amount (number)
"Primary Keys": School : School_id | budget : School_id | endowment : endowment_id
"Foreign Keys": budget : School_id equals School : School_id | endowment : School_id equals School : School_id |
SELECT count(*) FROM building | How many buildings are there? | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT name , street_address , floors FROM building ORDER BY floors | Show the name, street address, and number of floors for all buildings ordered by the number of floors. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT name FROM building ORDER BY height_feet DESC LIMIT 1 | What is the name of the tallest building? | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT avg(floors) , max(floors) , min(floors) FROM building | What are the average, maximum, and minimum number of floors for all buildings? | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building) OR floors > (SELECT avg(floors) FROM building) | Show the number of buildings with a height above the average or a number of floors above the average. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20 | List the names of buildings with at least 200 feet of height and with at least 20 floors. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT institution , LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private' | Show the names and locations of institutions that are founded after 1990 and have the type "Private". | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT TYPE , count(*) , sum(enrollment) FROM institution GROUP BY TYPE | Show institution types, along with the number of institutions and total enrollment for each type. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1 | Show the institution type with the largest number of institutions. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000 | Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution) | Show the name of buildings that do not have any institution. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003 | Show the names of buildings except for those having an institution founded in 2003. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id | For each building, show the name of the building and the number of institutions in it. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT T1.name , T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING count(*) >= 2 | Show the names and heights of buildings with at least two institutions founded after 1880. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT DISTINCT TYPE FROM institution | Show all the distinct institution types. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id | Show institution names along with the number of proteins for each institution. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private' | How many proteins are associated with an institution founded after 1880 or an institution with type "Private"? | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT T2.protein_name , T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id | Show the protein name and the institution name. | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20 | How many proteins are associated with an institution in a building with at least 20 floors? | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT count(*) FROM institution WHERE institution_id NOT IN (SELECT institution_id FROM protein) | How many institutions do not have an associated protein in our record? | "Schema (values (type))": building : building_id (text) , Name (text) , Street_address (text) , Years_as_tallest (text) , Height_feet (number) , Floors (number) | Institution : Institution_id (text) , Institution (text) , Location (text) , Founded (number) , Type (text) , Enrollment (number) , Team (text) , Primary_Conference (text) , building_id (text) | protein : common_name (text) , protein_name (text) , divergence_from_human_lineage (number) , accession_number (text) , sequence_length (number) , sequence_identity_to_human_protein (text) , Institution_id (text)
"Primary Keys": building : building_id | Institution : Institution_id | protein : common_name
"Foreign Keys": Institution : building_id equals building : building_id | protein : Institution_id equals Institution : Institution_id |
SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800 | Show all the locations where no cinema has capacity over 800. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011 | Show all the locations where some cinemas were opened in both year 2010 and year 2011. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT count(*) FROM cinema | How many cinema do we have? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT count(*) FROM cinema | Count the number of cinemas. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT name , openning_year , capacity FROM cinema | Show name, opening year, and capacity for each cinema. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT name , LOCATION FROM cinema WHERE capacity > (SELECT avg(capacity) FROM cinema) | Show the cinema name and location for cinemas with capacity above average. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT DISTINCT LOCATION FROM cinema | What are all the locations with a cinema? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT DISTINCT LOCATION FROM cinema | Find the distinct locations that has a cinema. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT name , openning_year FROM cinema ORDER BY openning_year DESC | Show all the cinema names and opening years in descending order of opening year. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT name , LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1 | What are the name and location of the cinema with the largest capacity? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT avg(capacity) , min(capacity) , max(capacity) FROM cinema WHERE openning_year >= 2011 | Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT LOCATION , count(*) FROM cinema GROUP BY LOCATION | Show each location and the number of cinemas there. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1 | What is the location with the most cinemas opened in year 2010 or later? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 2 | Show all the locations with at least two cinemas with capacity above 300. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 2 | Which locations have 2 or more cinemas with capacity over 300? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT title , directed_by FROM film | Show the title and director for all films. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT title , directed_by FROM film | What are the title and director of each film? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT DISTINCT directed_by FROM film | Show all directors. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT DISTINCT directed_by FROM film | Who are all the directors? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT directed_by , count(*) FROM film GROUP BY directed_by | List all directors along with the number of films directed by each director. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT T2.name , sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id | What is total number of show times per dat for each cinema? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id | What are the title and maximum price of each film? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id | Give me the title and highest price for each film. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT T3.name , T2.title , T1.date , T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id | Show cinema name, film title, date, and price for each record in schedule. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT title , directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule) | What are the title and director of the films without any schedule? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC LIMIT 1 | Show director with the largest number of show times in total. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 1 | Find the locations that have more than one movie theater with capacity above 300. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 1 | In which locations are there more than one movie theater with capacity above 300? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT count(*) FROM film WHERE title LIKE "%Dummy%" | How many films have the word 'Dummy' in their titles? | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT count(*) FROM film WHERE title LIKE "%Dummy%" | Count the number of films whose title contains the word 'Dummy'. | "Schema (values (type))": film : Film_ID (number) , Rank_in_series (number) , Number_in_season (number) , Title (text) , Directed_by (text) , Original_air_date (text) , Production_code (text) | cinema : Cinema_ID (number) , Name (text) , Openning_year (number) , Capacity (number) , Location (text) | schedule : Cinema_ID (number) , Film_ID (number) , Date (text) , Show_times_per_day (number) , Price (number)
"Primary Keys": film : Film_ID | cinema : Cinema_ID | schedule : Cinema_ID
"Foreign Keys": schedule : Cinema_ID equals cinema : Cinema_ID | schedule : Film_ID equals film : Film_ID |
SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500 | Are the customers holding coupons with amount 500 bad or good? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT T1.customer_id , T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | How many bookings did each customer make? List the customer id, first name, and the count. | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT customer_id , sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) DESC LIMIT 1 | What is the maximum total amount paid by a customer? List the customer id and amount. | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT T1.booking_id , T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) DESC LIMIT 1 | What are the id and the amount of refund of the booking that incurred the most times of payments? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*) = 3 | What is the id of the product that is booked for 3 times? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76 | What is the product description of the product booked with an amount of 102.76? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT T3.booking_start_date , T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A' | What are the start date and end date of the booking that has booked the product named 'Book collection A'? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1 | What are the names of products whose availability equals to 1? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT count(DISTINCT product_type_code) FROM products_for_hire | How many different product types are there? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT first_name , last_name , gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name | What are the first name, last name, and gender of all the good customers? Order by their last name. | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT avg(amount_due) FROM payments | What is the average amount due for all the payments? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT max(booked_count) , min(booked_count) , avg(booked_count) FROM products_booked | What are the maximum, minimum, and average booked count for the products booked? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT DISTINCT payment_type_code FROM payments | What are all the distinct payment types? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%' | What are the daily hire costs for the products with substring 'Book' in its name? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT count(*) FROM Products_for_hire WHERE product_id NOT IN ( SELECT product_id FROM products_booked WHERE booked_amount > 200 ) | How many products are never booked with amount higher than 200? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad' | What are the coupon amount of the coupons owned by both good and bad customers? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check' | What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check' | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT product_name , product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20 | What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20? | "Schema (values (type))": Discount_Coupons : coupon_id (number) , date_issued (time) , coupon_amount (number) | Customers : customer_id (number) , coupon_id (number) , good_or_bad_customer (text) , first_name (text) , last_name (text) , gender_mf (text) , date_became_customer (time) , date_last_hire (time) | Bookings : booking_id (number) , customer_id (number) , booking_status_code (text) , returned_damaged_yn (text) , booking_start_date (time) , booking_end_date (time) , count_hired (text) , amount_payable (number) , amount_of_discount (number) , amount_outstanding (number) , amount_of_refund (number) | Products_for_Hire : product_id (number) , product_type_code (text) , daily_hire_cost (number) , product_name (text) , product_description (text) | Payments : payment_id (number) , booking_id (number) , customer_id (number) , payment_type_code (text) , amount_paid_in_full_yn (text) , payment_date (time) , amount_due (number) , amount_paid (number) | Products_Booked : booking_id (number) , product_id (number) , returned_yn (text) , returned_late_yn (text) , booked_count (number) , booked_amount (number) | View_Product_Availability : product_id (number) , booking_id (number) , status_date (time) , available_yn (text)
"Primary Keys": Discount_Coupons : coupon_id | Customers : customer_id | Bookings : booking_id | Products_for_Hire : product_id | Payments : payment_id | Products_Booked : booking_id | View_Product_Availability : status_date
"Foreign Keys": Customers : coupon_id equals Discount_Coupons : coupon_id | Bookings : customer_id equals Customers : customer_id | Payments : customer_id equals Customers : customer_id | Payments : booking_id equals Bookings : booking_id | Products_Booked : product_id equals Products_for_Hire : product_id | Products_Booked : booking_id equals Bookings : booking_id | View_Product_Availability : product_id equals Products_for_Hire : product_id | View_Product_Availability : booking_id equals Bookings : booking_id |
SELECT count(*) FROM phone | How many phones are there? | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Name FROM phone ORDER BY Price ASC | List the names of phones in ascending order of price. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Memory_in_G , Carrier FROM phone | What are the memories and carriers of phones? | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32 | List the distinct carriers of phones with memories bigger than 32. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile" | Show the names of phones with carrier either "Sprint" or "TMobile". | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1 | What is the carrier of the most expensive phone? | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Carrier , COUNT(*) FROM phone GROUP BY Carrier | Show different carriers of phones together with the number of phones with each carrier. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1 | Show the most frequently used carrier of the phones. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64 | Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID | Show the names of phones and the districts of markets they are on. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking | Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50 | Show the names of phones that are on market with number of shops greater than 50. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT T2.Name , sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name | For each phone, show its names and total number of stocks. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000 ORDER BY sum(T1.Num_of_stock) DESC | Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market) | List the names of phones that are not on any market. | "Schema (values (type))": phone : Name (text) , Phone_ID (number) , Memory_in_G (number) , Carrier (text) , Price (number) | market : Market_ID (number) , District (text) , Num_of_employees (number) , Num_of_shops (number) , Ranking (number) | phone_market : Market_ID (number) , Phone_ID (text) , Num_of_stock (number)
"Primary Keys": phone : Phone_ID | market : Market_ID | phone_market : Market_ID
"Foreign Keys": phone_market : Phone_ID equals phone : Phone_ID | phone_market : Market_ID equals market : Market_ID |
SELECT count(*) FROM company | How many gas companies are there? | "Schema (values (type))": company : Company_ID (number) , Rank (number) , Company (text) , Headquarters (text) , Main_Industry (text) , Sales_billion (number) , Profits_billion (number) , Assets_billion (number) , Market_Value (number) | gas_station : Station_ID (number) , Open_Year (number) , Location (text) , Manager_Name (text) , Vice_Manager_Name (text) , Representative_Name (text) | station_company : Station_ID (number) , Company_ID (number) , Rank_of_the_Year (number)
"Primary Keys": company : Company_ID | gas_station : Station_ID | station_company : Station_ID
"Foreign Keys": station_company : Company_ID equals company : Company_ID | station_company : Station_ID equals gas_station : Station_ID |
SELECT count(*) FROM company | What is the total number of companies? | "Schema (values (type))": company : Company_ID (number) , Rank (number) , Company (text) , Headquarters (text) , Main_Industry (text) , Sales_billion (number) , Profits_billion (number) , Assets_billion (number) , Market_Value (number) | gas_station : Station_ID (number) , Open_Year (number) , Location (text) , Manager_Name (text) , Vice_Manager_Name (text) , Representative_Name (text) | station_company : Station_ID (number) , Company_ID (number) , Rank_of_the_Year (number)
"Primary Keys": company : Company_ID | gas_station : Station_ID | station_company : Station_ID
"Foreign Keys": station_company : Company_ID equals company : Company_ID | station_company : Station_ID equals gas_station : Station_ID |
SELECT company , rank FROM company ORDER BY Sales_billion DESC | List the company name and rank for all companies in the decreasing order of their sales. | "Schema (values (type))": company : Company_ID (number) , Rank (number) , Company (text) , Headquarters (text) , Main_Industry (text) , Sales_billion (number) , Profits_billion (number) , Assets_billion (number) , Market_Value (number) | gas_station : Station_ID (number) , Open_Year (number) , Location (text) , Manager_Name (text) , Vice_Manager_Name (text) , Representative_Name (text) | station_company : Station_ID (number) , Company_ID (number) , Rank_of_the_Year (number)
"Primary Keys": company : Company_ID | gas_station : Station_ID | station_company : Station_ID
"Foreign Keys": station_company : Company_ID equals company : Company_ID | station_company : Station_ID equals gas_station : Station_ID |
SELECT company , rank FROM company ORDER BY Sales_billion DESC | What is the name and rank of every company ordered by descending number of sales? | "Schema (values (type))": company : Company_ID (number) , Rank (number) , Company (text) , Headquarters (text) , Main_Industry (text) , Sales_billion (number) , Profits_billion (number) , Assets_billion (number) , Market_Value (number) | gas_station : Station_ID (number) , Open_Year (number) , Location (text) , Manager_Name (text) , Vice_Manager_Name (text) , Representative_Name (text) | station_company : Station_ID (number) , Company_ID (number) , Rank_of_the_Year (number)
"Primary Keys": company : Company_ID | gas_station : Station_ID | station_company : Station_ID
"Foreign Keys": station_company : Company_ID equals company : Company_ID | station_company : Station_ID equals gas_station : Station_ID |
SELECT company , main_industry FROM company WHERE headquarters != 'USA' | Show the company name and the main industry for all companies whose headquarters are not from USA. | "Schema (values (type))": company : Company_ID (number) , Rank (number) , Company (text) , Headquarters (text) , Main_Industry (text) , Sales_billion (number) , Profits_billion (number) , Assets_billion (number) , Market_Value (number) | gas_station : Station_ID (number) , Open_Year (number) , Location (text) , Manager_Name (text) , Vice_Manager_Name (text) , Representative_Name (text) | station_company : Station_ID (number) , Company_ID (number) , Rank_of_the_Year (number)
"Primary Keys": company : Company_ID | gas_station : Station_ID | station_company : Station_ID
"Foreign Keys": station_company : Company_ID equals company : Company_ID | station_company : Station_ID equals gas_station : Station_ID |
SELECT company , main_industry FROM company WHERE headquarters != 'USA' | What are the companies and main industries of all companies that are not headquartered in the United States? | "Schema (values (type))": company : Company_ID (number) , Rank (number) , Company (text) , Headquarters (text) , Main_Industry (text) , Sales_billion (number) , Profits_billion (number) , Assets_billion (number) , Market_Value (number) | gas_station : Station_ID (number) , Open_Year (number) , Location (text) , Manager_Name (text) , Vice_Manager_Name (text) , Representative_Name (text) | station_company : Station_ID (number) , Company_ID (number) , Rank_of_the_Year (number)
"Primary Keys": company : Company_ID | gas_station : Station_ID | station_company : Station_ID
"Foreign Keys": station_company : Company_ID equals company : Company_ID | station_company : Station_ID equals gas_station : Station_ID |
SELECT company , headquarters FROM company ORDER BY market_value DESC | Show all company names and headquarters in the descending order of market value. | "Schema (values (type))": company : Company_ID (number) , Rank (number) , Company (text) , Headquarters (text) , Main_Industry (text) , Sales_billion (number) , Profits_billion (number) , Assets_billion (number) , Market_Value (number) | gas_station : Station_ID (number) , Open_Year (number) , Location (text) , Manager_Name (text) , Vice_Manager_Name (text) , Representative_Name (text) | station_company : Station_ID (number) , Company_ID (number) , Rank_of_the_Year (number)
"Primary Keys": company : Company_ID | gas_station : Station_ID | station_company : Station_ID
"Foreign Keys": station_company : Company_ID equals company : Company_ID | station_company : Station_ID equals gas_station : Station_ID |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.