db_id
stringclasses
142 values
schema
stringclasses
142 values
schemaComEx
stringclasses
142 values
question
stringlengths
3
224
query
stringlengths
18
523
answer
stringlengths
13
498k
complexity
stringclasses
4 values
distinct
bool
2 classes
like
bool
2 classes
between
bool
2 classes
order_by
bool
2 classes
limit
bool
2 classes
grouby_by
bool
2 classes
having
bool
2 classes
single_join
bool
2 classes
multiple_join
bool
2 classes
multiple_select
bool
2 classes
intersect
bool
2 classes
except
bool
2 classes
union
bool
2 classes
sql_example_80
stringclasses
658 values
sql_example_85
stringclasses
728 values
sql_example_90
stringclasses
804 values
sql_example_95
stringclasses
875 values
hr_1
CREATE TABLE countries ( "COUNTRY_ID" VARCHAR(2) NOT NULL, "COUNTRY_NAME" VARCHAR(40) DEFAULT NULL, "REGION_ID" DECIMAL(10, 0) DEFAULT NULL, PRIMARY KEY ("COUNTRY_ID"), FOREIGN KEY("REGION_ID") REFERENCES regions ("REGION_ID") ) CREATE TABLE departments ( "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "DEPARTMENT_NAME" VARCHAR(30) NOT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "LOCATION_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("DEPARTMENT_ID") ) CREATE TABLE employees ( "EMPLOYEE_ID" DECIMAL(6, 0) DEFAULT '0' NOT NULL, "FIRST_NAME" VARCHAR(20) DEFAULT NULL, "LAST_NAME" VARCHAR(25) NOT NULL, "EMAIL" VARCHAR(25) NOT NULL, "PHONE_NUMBER" VARCHAR(20) DEFAULT NULL, "HIRE_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "SALARY" DECIMAL(8, 2) DEFAULT NULL, "COMMISSION_PCT" DECIMAL(2, 2) DEFAULT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID") ) CREATE TABLE job_history ( "EMPLOYEE_ID" DECIMAL(6, 0) NOT NULL, "START_DATE" DATE NOT NULL, "END_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID", "START_DATE"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID"), FOREIGN KEY("EMPLOYEE_ID") REFERENCES employees ("EMPLOYEE_ID") ) CREATE TABLE jobs ( "JOB_ID" VARCHAR(10) DEFAULT '' NOT NULL, "JOB_TITLE" VARCHAR(35) NOT NULL, "MIN_SALARY" DECIMAL(6, 0) DEFAULT NULL, "MAX_SALARY" DECIMAL(6, 0) DEFAULT NULL, PRIMARY KEY ("JOB_ID") ) CREATE TABLE locations ( "LOCATION_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "STREET_ADDRESS" VARCHAR(40) DEFAULT NULL, "POSTAL_CODE" VARCHAR(12) DEFAULT NULL, "CITY" VARCHAR(30) NOT NULL, "STATE_PROVINCE" VARCHAR(25) DEFAULT NULL, "COUNTRY_ID" VARCHAR(2) DEFAULT NULL, PRIMARY KEY ("LOCATION_ID"), FOREIGN KEY("COUNTRY_ID") REFERENCES countries ("COUNTRY_ID") ) CREATE TABLE regions ( "REGION_ID" DECIMAL(5, 0) NOT NULL, "REGION_NAME" VARCHAR(25) DEFAULT NULL, PRIMARY KEY ("REGION_ID") )
CREATE TABLE countries ( "COUNTRY_ID" VARCHAR(2) NOT NULL, "COUNTRY_NAME" VARCHAR(40) DEFAULT NULL, "REGION_ID" DECIMAL(10, 0) DEFAULT NULL, PRIMARY KEY ("COUNTRY_ID"), FOREIGN KEY("REGION_ID") REFERENCES regions ("REGION_ID") ) /* 2 rows from countries table: COUNTRY_ID COUNTRY_NAME REGION_ID AR Argentina 2 AU Australia 3 */ CREATE TABLE departments ( "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "DEPARTMENT_NAME" VARCHAR(30) NOT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "LOCATION_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("DEPARTMENT_ID") ) /* 2 rows from departments table: DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID 10 Administration 200 1700 20 Marketing 201 1800 */ CREATE TABLE employees ( "EMPLOYEE_ID" DECIMAL(6, 0) DEFAULT '0' NOT NULL, "FIRST_NAME" VARCHAR(20) DEFAULT NULL, "LAST_NAME" VARCHAR(25) NOT NULL, "EMAIL" VARCHAR(25) NOT NULL, "PHONE_NUMBER" VARCHAR(20) DEFAULT NULL, "HIRE_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "SALARY" DECIMAL(8, 2) DEFAULT NULL, "COMMISSION_PCT" DECIMAL(2, 2) DEFAULT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID") ) /* 2 rows from employees table: EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID 100 Steven King SKING 515.123.4567 1987-06-17 AD_PRES 24000.00 0.00 0 90 101 Neena Kochhar NKOCHHAR 515.123.4568 1987-06-18 AD_VP 17000.00 0.00 100 90 */ CREATE TABLE job_history ( "EMPLOYEE_ID" DECIMAL(6, 0) NOT NULL, "START_DATE" DATE NOT NULL, "END_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID", "START_DATE"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID"), FOREIGN KEY("EMPLOYEE_ID") REFERENCES employees ("EMPLOYEE_ID") ) /* 2 rows from job_history table: EMPLOYEE_ID START_DATE END_DATE JOB_ID DEPARTMENT_ID 102 1993-01-13 1998-07-24 IT_PROG 60 101 1989-09-21 1993-10-27 AC_ACCOUNT 110 */ CREATE TABLE jobs ( "JOB_ID" VARCHAR(10) DEFAULT '' NOT NULL, "JOB_TITLE" VARCHAR(35) NOT NULL, "MIN_SALARY" DECIMAL(6, 0) DEFAULT NULL, "MAX_SALARY" DECIMAL(6, 0) DEFAULT NULL, PRIMARY KEY ("JOB_ID") ) /* 2 rows from jobs table: JOB_ID JOB_TITLE MIN_SALARY MAX_SALARY AD_PRES President 20000 40000 AD_VP Administration Vice President 15000 30000 */ CREATE TABLE locations ( "LOCATION_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "STREET_ADDRESS" VARCHAR(40) DEFAULT NULL, "POSTAL_CODE" VARCHAR(12) DEFAULT NULL, "CITY" VARCHAR(30) NOT NULL, "STATE_PROVINCE" VARCHAR(25) DEFAULT NULL, "COUNTRY_ID" VARCHAR(2) DEFAULT NULL, PRIMARY KEY ("LOCATION_ID"), FOREIGN KEY("COUNTRY_ID") REFERENCES countries ("COUNTRY_ID") ) /* 2 rows from locations table: LOCATION_ID STREET_ADDRESS POSTAL_CODE CITY STATE_PROVINCE COUNTRY_ID 1000 1297 Via Cola di Rie 989 Roma IT 1100 93091 Calle della Testa 10934 Venice IT */ CREATE TABLE regions ( "REGION_ID" DECIMAL(5, 0) NOT NULL, "REGION_NAME" VARCHAR(25) DEFAULT NULL, PRIMARY KEY ("REGION_ID") ) /* 2 rows from regions table: REGION_ID REGION_NAME 1 Europe\r 2 Americas\r */
What are the full names and hire dates for employees in the same department as someone with the first name Clara, not including Clara?
SELECT first_name , last_name , hire_date FROM employees WHERE department_id = ( SELECT department_id FROM employees WHERE first_name = "Clara") AND first_name != "Clara"
[{'FIRST_NAME': 'John', 'LAST_NAME': 'Russell', 'HIRE_DATE': '1987-08-01'}, {'FIRST_NAME': 'Karen', 'LAST_NAME': 'Partners', 'HIRE_DATE': '1987-08-02'}, {'FIRST_NAME': 'Alberto', 'LAST_NAME': 'Errazuriz', 'HIRE_DATE': '1987-08-03'}, {'FIRST_NAME': 'Gerald', 'LAST_NAME': 'Cambrault', 'HIRE_DATE': '1987-08-04'}, {'FIRST_NAME': 'Eleni', 'LAST_NAME': 'Zlotkey', 'HIRE_DATE': '1987-08-05'}, {'FIRST_NAME': 'Peter', 'LAST_NAME': 'Tucker', 'HIRE_DATE': '1987-08-06'}, {'FIRST_NAME': 'David', 'LAST_NAME': 'Bernstein', 'HIRE_DATE': '1987-08-07'}, {'FIRST_NAME': 'Peter', 'LAST_NAME': 'Hall', 'HIRE_DATE': '1987-08-08'}, {'FIRST_NAME': 'Christopher', 'LAST_NAME': 'Olsen', 'HIRE_DATE': '1987-08-09'}, {'FIRST_NAME': 'Nanette', 'LAST_NAME': 'Cambrault', 'HIRE_DATE': '1987-08-10'}, {'FIRST_NAME': 'Oliver', 'LAST_NAME': 'Tuvault', 'HIRE_DATE': '1987-08-11'}, {'FIRST_NAME': 'Janette', 'LAST_NAME': 'King', 'HIRE_DATE': '1987-08-12'}, {'FIRST_NAME': 'Patrick', 'LAST_NAME': 'Sully', 'HIRE_DATE': '1987-08-13'}, {'FIRST_NAME': 'Allan', 'LAST_NAME': 'McEwen', 'HIRE_DATE': '1987-08-14'}, {'FIRST_NAME': 'Lindsey', 'LAST_NAME': 'Smith', 'HIRE_DATE': '1987-08-15'}, {'FIRST_NAME': 'Louise', 'LAST_NAME': 'Doran', 'HIRE_DATE': '1987-08-16'}, {'FIRST_NAME': 'Sarath', 'LAST_NAME': 'Sewall', 'HIRE_DATE': '1987-08-17'}, {'FIRST_NAME': 'Danielle', 'LAST_NAME': 'Greene', 'HIRE_DATE': '1987-08-19'}, {'FIRST_NAME': 'Mattea', 'LAST_NAME': 'Marvins', 'HIRE_DATE': '1987-08-20'}, {'FIRST_NAME': 'David', 'LAST_NAME': 'Lee', 'HIRE_DATE': '1987-08-21'}, {'FIRST_NAME': 'Sundar', 'LAST_NAME': 'Ande', 'HIRE_DATE': '1987-08-22'}, {'FIRST_NAME': 'Amit', 'LAST_NAME': 'Banda', 'HIRE_DATE': '1987-08-23'}, {'FIRST_NAME': 'Lisa', 'LAST_NAME': 'Ozer', 'HIRE_DATE': '1987-08-24'}, {'FIRST_NAME': 'Harrison', 'LAST_NAME': 'Bloom', 'HIRE_DATE': '1987-08-25'}, {'FIRST_NAME': 'Tayler', 'LAST_NAME': 'Fox', 'HIRE_DATE': '1987-08-26'}, {'FIRST_NAME': 'William', 'LAST_NAME': 'Smith', 'HIRE_DATE': '1987-08-27'}, {'FIRST_NAME': 'Elizabeth', 'LAST_NAME': 'Bates', 'HIRE_DATE': '1987-08-28'}, {'FIRST_NAME': 'Sundita', 'LAST_NAME': 'Kumar', 'HIRE_DATE': '1987-08-29'}, {'FIRST_NAME': 'Ellen', 'LAST_NAME': 'Abel', 'HIRE_DATE': '1987-08-30'}, {'FIRST_NAME': 'Alyssa', 'LAST_NAME': 'Hutton', 'HIRE_DATE': '1987-08-31'}, {'FIRST_NAME': 'Jonathon', 'LAST_NAME': 'Taylor', 'HIRE_DATE': '1987-09-01'}, {'FIRST_NAME': 'Jack', 'LAST_NAME': 'Livingston', 'HIRE_DATE': '1987-09-02'}, {'FIRST_NAME': 'Charles', 'LAST_NAME': 'Johnson', 'HIRE_DATE': '1987-09-04'}]
Extra Hard
false
false
false
false
false
false
false
false
false
true
false
false
false
[QUESTION]What are the first and last names of the employee with the earliest date of birth?[/QUESTION] [SQL]SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1[/SQL]
[QUESTION]What are the first and last names of the employee with the earliest date of birth?[/QUESTION] [SQL]SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1[/SQL]
[QUESTION]What are the first and last names of the employee with the earliest date of birth?[/QUESTION] [SQL]SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1[/SQL]
[QUESTION]What are the first and last names of the employee with the earliest date of birth?[/QUESTION] [SQL]SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1[/SQL]
program_share
CREATE TABLE broadcast ( "Channel_ID" INTEGER, "Program_ID" INTEGER, "Time_of_day" TEXT, PRIMARY KEY ("Channel_ID", "Program_ID"), FOREIGN KEY("Program_ID") REFERENCES program ("Program_ID"), FOREIGN KEY("Channel_ID") REFERENCES channel ("Channel_ID") ) CREATE TABLE broadcast_share ( "Channel_ID" INTEGER, "Program_ID" INTEGER, "Date" TEXT, "Share_in_percent" REAL, PRIMARY KEY ("Channel_ID", "Program_ID"), FOREIGN KEY("Program_ID") REFERENCES program ("Program_ID"), FOREIGN KEY("Channel_ID") REFERENCES channel ("Channel_ID") ) CREATE TABLE channel ( "Channel_ID" INTEGER, "Name" TEXT, "Owner" TEXT, "Share_in_percent" REAL, "Rating_in_percent" REAL, PRIMARY KEY ("Channel_ID") ) CREATE TABLE program ( "Program_ID" INTEGER, "Name" TEXT, "Origin" TEXT, "Launch" REAL, "Owner" TEXT, PRIMARY KEY ("Program_ID") )
CREATE TABLE broadcast ( "Channel_ID" INTEGER, "Program_ID" INTEGER, "Time_of_day" TEXT, PRIMARY KEY ("Channel_ID", "Program_ID"), FOREIGN KEY("Program_ID") REFERENCES program ("Program_ID"), FOREIGN KEY("Channel_ID") REFERENCES channel ("Channel_ID") ) /* 2 rows from broadcast table: Channel_ID Program_ID Time_of_day 1 1 Morning 2 1 Night */ CREATE TABLE broadcast_share ( "Channel_ID" INTEGER, "Program_ID" INTEGER, "Date" TEXT, "Share_in_percent" REAL, PRIMARY KEY ("Channel_ID", "Program_ID"), FOREIGN KEY("Program_ID") REFERENCES program ("Program_ID"), FOREIGN KEY("Channel_ID") REFERENCES channel ("Channel_ID") ) /* 2 rows from broadcast_share table: Channel_ID Program_ID Date Share_in_percent 1 1 01,May 3.1 2 1 02,May 1.8 */ CREATE TABLE channel ( "Channel_ID" INTEGER, "Name" TEXT, "Owner" TEXT, "Share_in_percent" REAL, "Rating_in_percent" REAL, PRIMARY KEY ("Channel_ID") ) /* 2 rows from channel table: Channel_ID Name Owner Share_in_percent Rating_in_percent 1 CCTV-1 CCTV 4.9 0.54 2 Hunan Satellite TV HBS 4.81 0.53 */ CREATE TABLE program ( "Program_ID" INTEGER, "Name" TEXT, "Origin" TEXT, "Launch" REAL, "Owner" TEXT, PRIMARY KEY ("Program_ID") ) /* 2 rows from program table: Program_ID Name Origin Launch Owner 1 Aniworld Hunan 2005.0 Hunan Broadcasting System (HBS) 2 Kaku Beijing 2004.0 Beijing Television (BTV) */
What are the names of the channels owned by CCTV or HBS?
SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS'
[{'Name': 'CCTV-1'}, {'Name': 'Hunan Satellite TV'}, {'Name': 'CCTV-8'}, {'Name': 'CCTV-13'}, {'Name': 'CCTV-3'}, {'Name': 'CCTV-6'}, {'Name': 'CCTV-14'}, {'Name': 'CCTV-4'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What are the Package Options of the TV Channels whose series names are Sky Radio?[/QUESTION] [SQL]SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio";[/SQL]
[QUESTION]What are the Package Options of the TV Channels whose series names are Sky Radio?[/QUESTION] [SQL]SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio";[/SQL]
[QUESTION]What are the Package Options of the TV Channels whose series names are Sky Radio?[/QUESTION] [SQL]SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio";[/SQL]
[QUESTION]What are the Package Options of the TV Channels whose series names are Sky Radio?[/QUESTION] [SQL]SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio";[/SQL]
city_record
CREATE TABLE "match" ( "Match_ID" INTEGER, "Date" TEXT, "Venue" TEXT, "Score" TEXT, "Result" TEXT, "Competition" TEXT, PRIMARY KEY ("Match_ID") ) CREATE TABLE city ( "City_ID" INTEGER, "City" TEXT, "Hanzi" TEXT, "Hanyu_Pinyin" TEXT, "Regional_Population" INTEGER, "GDP" REAL, PRIMARY KEY ("City_ID") ) CREATE TABLE hosting_city ( "Year" INTEGER, "Match_ID" INTEGER, "Host_City" TEXT, PRIMARY KEY ("Year"), FOREIGN KEY("Match_ID") REFERENCES "match" ("Match_ID"), FOREIGN KEY("Host_City") REFERENCES city ("City_ID") ) CREATE TABLE temperature ( "City_ID" INTEGER, "Jan" REAL, "Feb" REAL, "Mar" REAL, "Apr" REAL, "Jun" REAL, "Jul" REAL, "Aug" REAL, "Sep" REAL, "Oct" REAL, "Nov" REAL, "Dec" REAL, PRIMARY KEY ("City_ID"), FOREIGN KEY("City_ID") REFERENCES city ("City_ID") )
CREATE TABLE "match" ( "Match_ID" INTEGER, "Date" TEXT, "Venue" TEXT, "Score" TEXT, "Result" TEXT, "Competition" TEXT, PRIMARY KEY ("Match_ID") ) /* 2 rows from match table: Match_ID Date Venue Score Result Competition 1 18 February 1992 Estadio Cuscatlán , San Salvador , El Salvador 1-0 2-0 Friendly match 2 19 July 1992 Estadio Rigoberto López , Managua , Nicaragua 3-0 5-0 1994 FIFA World Cup qualification */ CREATE TABLE city ( "City_ID" INTEGER, "City" TEXT, "Hanzi" TEXT, "Hanyu_Pinyin" TEXT, "Regional_Population" INTEGER, "GDP" REAL, PRIMARY KEY ("City_ID") ) /* 2 rows from city table: City_ID City Hanzi Hanyu_Pinyin Regional_Population GDP 1 Shanghai 上海 Shànghǎi 23019148 1919.57 2 Nanjing ( Jiangsu ) 南京 Nánjīng 8004680 614.55 */ CREATE TABLE hosting_city ( "Year" INTEGER, "Match_ID" INTEGER, "Host_City" TEXT, PRIMARY KEY ("Year"), FOREIGN KEY("Match_ID") REFERENCES "match" ("Match_ID"), FOREIGN KEY("Host_City") REFERENCES city ("City_ID") ) /* 2 rows from hosting_city table: Year Match_ID Host_City 2008 1 1 2009 2 2 */ CREATE TABLE temperature ( "City_ID" INTEGER, "Jan" REAL, "Feb" REAL, "Mar" REAL, "Apr" REAL, "Jun" REAL, "Jul" REAL, "Aug" REAL, "Sep" REAL, "Oct" REAL, "Nov" REAL, "Dec" REAL, PRIMARY KEY ("City_ID"), FOREIGN KEY("City_ID") REFERENCES city ("City_ID") ) /* 2 rows from temperature table: City_ID Jan Feb Mar Apr Jun Jul Aug Sep Oct Nov Dec 1 17.8 17.8 18.3 18.9 20.0 20.6 20.6 20.6 20.0 19.4 18.3 2 26.1 26.1 26.1 26.1 27.8 27.8 28.3 28.3 28.3 27.2 26.7 */
Which city has the highest temperature in February?
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
[{'City': 'Suzhou ( Jiangsu )'}]
Medium
false
false
false
true
true
false
false
true
false
false
false
false
false
insurance_and_eClaims
CREATE TABLE "Claim_Headers" ( "Claim_Header_ID" INTEGER NOT NULL, "Claim_Status_Code" CHAR(15) NOT NULL, "Claim_Type_Code" CHAR(15) NOT NULL, "Policy_ID" INTEGER NOT NULL, "Date_of_Claim" DATETIME, "Date_of_Settlement" DATETIME, "Amount_Claimed" DECIMAL(20, 4), "Amount_Piad" DECIMAL(20, 4), PRIMARY KEY ("Claim_Header_ID"), FOREIGN KEY("Policy_ID") REFERENCES "Policies" ("Policy_ID") ) CREATE TABLE "Claims_Documents" ( "Claim_ID" INTEGER NOT NULL, "Document_Type_Code" CHAR(15) NOT NULL, "Created_by_Staff_ID" INTEGER, "Created_Date" INTEGER, PRIMARY KEY ("Claim_ID", "Document_Type_Code"), FOREIGN KEY("Claim_ID") REFERENCES "Claim_Headers" ("Claim_Header_ID"), FOREIGN KEY("Created_by_Staff_ID") REFERENCES "Staff" ("Staff_ID") ) CREATE TABLE "Claims_Processing" ( "Claim_Processing_ID" INTEGER NOT NULL, "Claim_ID" INTEGER NOT NULL, "Claim_Outcome_Code" CHAR(15) NOT NULL, "Claim_Stage_ID" INTEGER NOT NULL, "Staff_ID" INTEGER, PRIMARY KEY ("Claim_Processing_ID"), FOREIGN KEY("Claim_ID") REFERENCES "Claim_Headers" ("Claim_Header_ID"), FOREIGN KEY("Staff_ID") REFERENCES "Staff" ("Staff_ID") ) CREATE TABLE "Claims_Processing_Stages" ( "Claim_Stage_ID" INTEGER NOT NULL, "Next_Claim_Stage_ID" INTEGER, "Claim_Status_Name" VARCHAR(255) NOT NULL, "Claim_Status_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Claim_Stage_ID") ) CREATE TABLE "Customers" ( "Customer_ID" INTEGER NOT NULL, "Customer_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Customer_ID") ) CREATE TABLE "Policies" ( "Policy_ID" INTEGER NOT NULL, "Customer_ID" INTEGER NOT NULL, "Policy_Type_Code" CHAR(15) NOT NULL, "Start_Date" DATETIME, "End_Date" DATETIME, PRIMARY KEY ("Policy_ID"), FOREIGN KEY("Customer_ID") REFERENCES "Customers" ("Customer_ID") ) CREATE TABLE "Staff" ( "Staff_ID" INTEGER NOT NULL, "Staff_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Staff_ID") )
CREATE TABLE "Claim_Headers" ( "Claim_Header_ID" INTEGER NOT NULL, "Claim_Status_Code" CHAR(15) NOT NULL, "Claim_Type_Code" CHAR(15) NOT NULL, "Policy_ID" INTEGER NOT NULL, "Date_of_Claim" DATETIME, "Date_of_Settlement" DATETIME, "Amount_Claimed" DECIMAL(20, 4), "Amount_Piad" DECIMAL(20, 4), PRIMARY KEY ("Claim_Header_ID"), FOREIGN KEY("Policy_ID") REFERENCES "Policies" ("Policy_ID") ) /* 2 rows from Claim_Headers table: Claim_Header_ID Claim_Status_Code Claim_Type_Code Policy_ID Date_of_Claim Date_of_Settlement Amount_Claimed Amount_Piad 15 Settled Handphone Subsidy 518 2016-05-31 06:07:11 2018-02-23 03:46:38 349.1500 582.0300 24 Disputed Child Birth 518 2016-12-30 21:43:21 2017-10-08 21:43:14 318.1600 309.2000 */ CREATE TABLE "Claims_Documents" ( "Claim_ID" INTEGER NOT NULL, "Document_Type_Code" CHAR(15) NOT NULL, "Created_by_Staff_ID" INTEGER, "Created_Date" INTEGER, PRIMARY KEY ("Claim_ID", "Document_Type_Code"), FOREIGN KEY("Claim_ID") REFERENCES "Claim_Headers" ("Claim_Header_ID"), FOREIGN KEY("Created_by_Staff_ID") REFERENCES "Staff" ("Staff_ID") ) /* 2 rows from Claims_Documents table: Claim_ID Document_Type_Code Created_by_Staff_ID Created_Date 24 Document 718 8 27 Document 986 6 */ CREATE TABLE "Claims_Processing" ( "Claim_Processing_ID" INTEGER NOT NULL, "Claim_ID" INTEGER NOT NULL, "Claim_Outcome_Code" CHAR(15) NOT NULL, "Claim_Stage_ID" INTEGER NOT NULL, "Staff_ID" INTEGER, PRIMARY KEY ("Claim_Processing_ID"), FOREIGN KEY("Claim_ID") REFERENCES "Claim_Headers" ("Claim_Header_ID"), FOREIGN KEY("Staff_ID") REFERENCES "Staff" ("Staff_ID") ) /* 2 rows from Claims_Processing table: Claim_Processing_ID Claim_ID Claim_Outcome_Code Claim_Stage_ID Staff_ID 118 28 In progress 1 771 145 62 In progress 1 589 */ CREATE TABLE "Claims_Processing_Stages" ( "Claim_Stage_ID" INTEGER NOT NULL, "Next_Claim_Stage_ID" INTEGER, "Claim_Status_Name" VARCHAR(255) NOT NULL, "Claim_Status_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Claim_Stage_ID") ) /* 2 rows from Claims_Processing_Stages table: Claim_Stage_ID Next_Claim_Stage_ID Claim_Status_Name Claim_Status_Description 1 1 Open Open a new claim 3 1 Close Close a claim */ CREATE TABLE "Customers" ( "Customer_ID" INTEGER NOT NULL, "Customer_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Customer_ID") ) /* 2 rows from Customers table: Customer_ID Customer_Details 252 America Jaskolski 263 Ellsworth Paucek */ CREATE TABLE "Policies" ( "Policy_ID" INTEGER NOT NULL, "Customer_ID" INTEGER NOT NULL, "Policy_Type_Code" CHAR(15) NOT NULL, "Start_Date" DATETIME, "End_Date" DATETIME, PRIMARY KEY ("Policy_ID"), FOREIGN KEY("Customer_ID") REFERENCES "Customers" ("Customer_ID") ) /* 2 rows from Policies table: Policy_ID Customer_ID Policy_Type_Code Start_Date End_Date 125 808 Deputy 2018-02-10 08:56:30 2018-03-18 09:17:26 151 380 Jurisdiction 2017-12-20 06:02:31 2017-09-16 22:04:13 */ CREATE TABLE "Staff" ( "Staff_ID" INTEGER NOT NULL, "Staff_Details" VARCHAR(255) NOT NULL, PRIMARY KEY ("Staff_ID") ) /* 2 rows from Staff table: Staff_ID Staff_Details 406 Clifton 427 Cathryn */
Find the number of distinct stages in claim processing.
SELECT count(*) FROM claims_processing_stages
[{'count(*)': 2}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
swimming
CREATE TABLE event ( "ID" INTEGER, "Name" TEXT, "Stadium_ID" INTEGER, "Year" TEXT, PRIMARY KEY ("ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("ID") ) CREATE TABLE record ( "ID" INTEGER, "Result" TEXT, "Swimmer_ID" INTEGER, "Event_ID" INTEGER, PRIMARY KEY ("Swimmer_ID", "Event_ID"), FOREIGN KEY("Swimmer_ID") REFERENCES swimmer ("ID"), FOREIGN KEY("Event_ID") REFERENCES event ("ID") ) CREATE TABLE stadium ( "ID" INTEGER, name TEXT, "Capacity" INTEGER, "City" TEXT, "Country" TEXT, "Opening_year" INTEGER, PRIMARY KEY ("ID") ) CREATE TABLE swimmer ( "ID" INTEGER, name TEXT, "Nationality" TEXT, meter_100 REAL, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, "Time" TEXT, PRIMARY KEY ("ID") )
CREATE TABLE event ( "ID" INTEGER, "Name" TEXT, "Stadium_ID" INTEGER, "Year" TEXT, PRIMARY KEY ("ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("ID") ) /* 2 rows from event table: ID Name Stadium_ID Year 1 FINA 1 2016 2 Pacific 10 2011 */ CREATE TABLE record ( "ID" INTEGER, "Result" TEXT, "Swimmer_ID" INTEGER, "Event_ID" INTEGER, PRIMARY KEY ("Swimmer_ID", "Event_ID"), FOREIGN KEY("Swimmer_ID") REFERENCES swimmer ("ID"), FOREIGN KEY("Event_ID") REFERENCES event ("ID") ) /* 2 rows from record table: ID Result Swimmer_ID Event_ID 1 NC 1 1 2 Win 1 2 */ CREATE TABLE stadium ( "ID" INTEGER, name TEXT, "Capacity" INTEGER, "City" TEXT, "Country" TEXT, "Opening_year" INTEGER, PRIMARY KEY ("ID") ) /* 2 rows from stadium table: ID name Capacity City Country Opening_year 1 Nou Mestalla 75000 Valencia Spain 2004 2 Gazprom Arena 69501 Saint Petersburg Russia 2005 */ CREATE TABLE swimmer ( "ID" INTEGER, name TEXT, "Nationality" TEXT, meter_100 REAL, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, "Time" TEXT, PRIMARY KEY ("ID") ) /* 2 rows from swimmer table: ID name Nationality meter_100 meter_200 meter_300 meter_400 meter_500 meter_600 meter_700 Time 7 Przemysław Stańczyk Poland 57.31 1:57.10 2:56.02 3:55.36 4:54.21 5:52.59 6:50.91 7:47.91 4 Craig Stevens Australia 57.35 1:56.34 2:55.90 3:55.72 4:55.08 5:54.45 6:52.69 7:48.67 */
How many stadiums are not in country "Russia"?
SELECT count(*) FROM stadium WHERE country != 'Russia'
[{'count(*)': 6}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What are the names of all stadiums that did not have a concert in 2014?[/QUESTION] [SQL]SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014[/SQL]
[QUESTION]What are the names of all stadiums that did not have a concert in 2014?[/QUESTION] [SQL]SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014[/SQL]
[QUESTION]What are the names of all stadiums that did not have a concert in 2014?[/QUESTION] [SQL]SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014[/SQL]
[QUESTION]What are the names of all stadiums that did not have a concert in 2014?[/QUESTION] [SQL]SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.year = 2014[/SQL]
company_office
CREATE TABLE "Companies" ( id INTEGER, name TEXT, "Headquarters" TEXT, "Industry" TEXT, "Sales_billion" REAL, "Profits_billion" REAL, "Assets_billion" REAL, "Market_Value_billion" TEXT, PRIMARY KEY (id) ) CREATE TABLE "Office_locations" ( building_id INTEGER, company_id INTEGER, move_in_year INTEGER, PRIMARY KEY (building_id, company_id), FOREIGN KEY(building_id) REFERENCES buildings (id), FOREIGN KEY(company_id) REFERENCES "Companies" (id) ) CREATE TABLE buildings ( id INTEGER, name TEXT, "City" TEXT, "Height" INTEGER, "Stories" INTEGER, "Status" TEXT, PRIMARY KEY (id) )
CREATE TABLE "Companies" ( id INTEGER, name TEXT, "Headquarters" TEXT, "Industry" TEXT, "Sales_billion" REAL, "Profits_billion" REAL, "Assets_billion" REAL, "Market_Value_billion" TEXT, PRIMARY KEY (id) ) /* 2 rows from Companies table: id name Headquarters Industry Sales_billion Profits_billion Assets_billion Market_Value_billion 1 JPMorgan Chase USA Banking 115.5 17.4 2117.6 182.2 2 HSBC UK Banking 103.3 13.3 2467.9 186.5 */ CREATE TABLE "Office_locations" ( building_id INTEGER, company_id INTEGER, move_in_year INTEGER, PRIMARY KEY (building_id, company_id), FOREIGN KEY(building_id) REFERENCES buildings (id), FOREIGN KEY(company_id) REFERENCES "Companies" (id) ) /* 2 rows from Office_locations table: building_id company_id move_in_year 1 1 2021 2 2 2022 */ CREATE TABLE buildings ( id INTEGER, name TEXT, "City" TEXT, "Height" INTEGER, "Stories" INTEGER, "Status" TEXT, PRIMARY KEY (id) ) /* 2 rows from buildings table: id name City Height Stories Status 1 Torre KOI Monterrey 220 67 under construction 2 Torre Mitikah Mexico City 210 60 under construction */
List the names of companies in descending order of market value.
SELECT name FROM Companies ORDER BY Market_Value_billion DESC
[{'name': 'Santander Group'}, {'name': 'BNP Paribas'}, {'name': 'ExxonMobil'}, {'name': 'PetroChina'}, {'name': 'Industrial and Commercial Bank of China'}, {'name': 'Petrobras'}, {'name': 'China Construction Bank'}, {'name': 'General Electric'}, {'name': 'Royal Dutch Shell'}, {'name': 'Berkshire Hathaway'}, {'name': 'Chevron'}, {'name': 'Walmart'}, {'name': 'HSBC'}, {'name': 'JPMorgan Chase'}, {'name': 'Gazprom'}, {'name': 'Wells Fargo'}, {'name': 'AT&T Inc.'}, {'name': 'Total'}, {'name': 'Citigroup'}]
Easy
false
false
false
true
false
false
false
false
false
false
false
false
false
[QUESTION]List the name of all customers sorted by their account balance in ascending order.[/QUESTION] [SQL]SELECT cust_name FROM customer ORDER BY acc_bal[/SQL]
[QUESTION]List the name of all customers sorted by their account balance in ascending order.[/QUESTION] [SQL]SELECT cust_name FROM customer ORDER BY acc_bal[/SQL]
[QUESTION]List the name of all customers sorted by their account balance in ascending order.[/QUESTION] [SQL]SELECT cust_name FROM customer ORDER BY acc_bal[/SQL]
formula_1
CREATE TABLE "constructorResults" ( "constructorResultsId" INTEGER, "raceId" INTEGER, "constructorId" INTEGER, points REAL, status TEXT, PRIMARY KEY ("constructorResultsId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId") ) CREATE TABLE "constructorStandings" ( "constructorStandingsId" INTEGER, "raceId" INTEGER, "constructorId" INTEGER, points REAL, position INTEGER, "positionText" TEXT, wins INTEGER, PRIMARY KEY ("constructorStandingsId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId") ) CREATE TABLE "driverStandings" ( "driverStandingsId" INTEGER, "raceId" INTEGER, "driverId" INTEGER, points REAL, position INTEGER, "positionText" TEXT, wins INTEGER, PRIMARY KEY ("driverStandingsId"), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) CREATE TABLE "lapTimes" ( "raceId" INTEGER, "driverId" INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER, PRIMARY KEY ("raceId", "driverId", lap), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) CREATE TABLE "pitStops" ( "raceId" INTEGER, "driverId" INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER, PRIMARY KEY ("raceId", "driverId", stop), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) CREATE TABLE circuits ( "circuitId" INTEGER, "circuitRef" TEXT, name TEXT, location TEXT, country TEXT, lat REAL, lng REAL, alt TEXT, url TEXT, PRIMARY KEY ("circuitId") ) CREATE TABLE constructors ( "constructorId" INTEGER, "constructorRef" TEXT, name TEXT, nationality TEXT, url TEXT, PRIMARY KEY ("constructorId") ) CREATE TABLE drivers ( "driverId" INTEGER, "driverRef" TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, nationality TEXT, url TEXT, PRIMARY KEY ("driverId") ) CREATE TABLE qualifying ( "qualifyId" INTEGER, "raceId" INTEGER, "driverId" INTEGER, "constructorId" INTEGER, number INTEGER, position INTEGER, q1 TEXT, q2 TEXT, q3 TEXT, PRIMARY KEY ("qualifyId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) CREATE TABLE races ( "raceId" INTEGER, year INTEGER, round INTEGER, "circuitId" INTEGER, name TEXT, date TEXT, time TEXT, url TEXT, PRIMARY KEY ("raceId"), FOREIGN KEY("circuitId") REFERENCES circuits ("circuitId") ) CREATE TABLE results ( "resultId" INTEGER, "raceId" INTEGER, "driverId" INTEGER, "constructorId" INTEGER, number INTEGER, grid INTEGER, position TEXT, "positionText" TEXT, "positionOrder" INTEGER, points REAL, laps TEXT, time TEXT, milliseconds TEXT, "fastestLap" TEXT, rank TEXT, "fastestLapTime" TEXT, "fastestLapSpeed" TEXT, "statusId" INTEGER, PRIMARY KEY ("resultId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) CREATE TABLE seasons ( year INTEGER, url TEXT, PRIMARY KEY (year) ) CREATE TABLE status ( "statusId" INTEGER, status TEXT, PRIMARY KEY ("statusId") )
CREATE TABLE "constructorResults" ( "constructorResultsId" INTEGER, "raceId" INTEGER, "constructorId" INTEGER, points REAL, status TEXT, PRIMARY KEY ("constructorResultsId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId") ) /* 2 rows from constructorResults table: constructorResultsId raceId constructorId points status 1 18 1 14.0 NULL 2 18 2 8.0 NULL */ CREATE TABLE "constructorStandings" ( "constructorStandingsId" INTEGER, "raceId" INTEGER, "constructorId" INTEGER, points REAL, position INTEGER, "positionText" TEXT, wins INTEGER, PRIMARY KEY ("constructorStandingsId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId") ) /* 2 rows from constructorStandings table: constructorStandingsId raceId constructorId points position positionText wins 1 18 1 14.0 1 1 1 2 18 2 8.0 3 3 0 */ CREATE TABLE "driverStandings" ( "driverStandingsId" INTEGER, "raceId" INTEGER, "driverId" INTEGER, points REAL, position INTEGER, "positionText" TEXT, wins INTEGER, PRIMARY KEY ("driverStandingsId"), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) /* 2 rows from driverStandings table: driverStandingsId raceId driverId points position positionText wins 1 18 1 10.0 1 1 1 2 18 2 8.0 2 2 0 */ CREATE TABLE "lapTimes" ( "raceId" INTEGER, "driverId" INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER, PRIMARY KEY ("raceId", "driverId", lap), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) /* 2 rows from lapTimes table: raceId driverId lap position time milliseconds */ CREATE TABLE "pitStops" ( "raceId" INTEGER, "driverId" INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER, PRIMARY KEY ("raceId", "driverId", stop), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) /* 2 rows from pitStops table: raceId driverId stop lap time duration milliseconds */ CREATE TABLE circuits ( "circuitId" INTEGER, "circuitRef" TEXT, name TEXT, location TEXT, country TEXT, lat REAL, lng REAL, alt TEXT, url TEXT, PRIMARY KEY ("circuitId") ) /* 2 rows from circuits table: circuitId circuitRef name location country lat lng alt url 1 albert_park Albert Park Grand Prix Circuit Melbourne Australia -37.8497 144.968 10 http://en.wikipedia.org/wiki/Melbourne_Grand_Prix_Circuit 2 sepang Sepang International Circuit Kuala Lumpur Malaysia 2.76083 101.738 http://en.wikipedia.org/wiki/Sepang_International_Circuit */ CREATE TABLE constructors ( "constructorId" INTEGER, "constructorRef" TEXT, name TEXT, nationality TEXT, url TEXT, PRIMARY KEY ("constructorId") ) /* 2 rows from constructors table: constructorId constructorRef name nationality url 1 mclaren McLaren British http://en.wikipedia.org/wiki/McLaren 2 bmw_sauber BMW Sauber German http://en.wikipedia.org/wiki/BMW_Sauber */ CREATE TABLE drivers ( "driverId" INTEGER, "driverRef" TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, nationality TEXT, url TEXT, PRIMARY KEY ("driverId") ) /* 2 rows from drivers table: driverId driverRef number code forename surname dob nationality url 1 hamilton 44 HAM Lewis Hamilton 07/01/1985 British http://en.wikipedia.org/wiki/Lewis_Hamilton 2 heidfeld HEI Nick Heidfeld 10/05/1977 German http://en.wikipedia.org/wiki/Nick_Heidfeld */ CREATE TABLE qualifying ( "qualifyId" INTEGER, "raceId" INTEGER, "driverId" INTEGER, "constructorId" INTEGER, number INTEGER, position INTEGER, q1 TEXT, q2 TEXT, q3 TEXT, PRIMARY KEY ("qualifyId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) /* 2 rows from qualifying table: qualifyId raceId driverId constructorId number position q1 q2 q3 1 18 1 1 22 1 1:26.572 1:25.187 1:26.714 2 18 9 2 4 2 1:26.103 1:25.315 1:26.869 */ CREATE TABLE races ( "raceId" INTEGER, year INTEGER, round INTEGER, "circuitId" INTEGER, name TEXT, date TEXT, time TEXT, url TEXT, PRIMARY KEY ("raceId"), FOREIGN KEY("circuitId") REFERENCES circuits ("circuitId") ) /* 2 rows from races table: raceId year round circuitId name date time url 1 2009 1 1 Australian Grand Prix 2009-03-29 06:00:00 http://en.wikipedia.org/wiki/2009_Australian_Grand_Prix 2 2009 2 2 Malaysian Grand Prix 2009-04-05 09:00:00 http://en.wikipedia.org/wiki/2009_Malaysian_Grand_Prix */ CREATE TABLE results ( "resultId" INTEGER, "raceId" INTEGER, "driverId" INTEGER, "constructorId" INTEGER, number INTEGER, grid INTEGER, position TEXT, "positionText" TEXT, "positionOrder" INTEGER, points REAL, laps TEXT, time TEXT, milliseconds TEXT, "fastestLap" TEXT, rank TEXT, "fastestLapTime" TEXT, "fastestLapSpeed" TEXT, "statusId" INTEGER, PRIMARY KEY ("resultId"), FOREIGN KEY("constructorId") REFERENCES constructors ("constructorId"), FOREIGN KEY("raceId") REFERENCES races ("raceId"), FOREIGN KEY("driverId") REFERENCES drivers ("driverId") ) /* 2 rows from results table: resultId raceId driverId constructorId number grid position positionText positionOrder points laps time milliseconds fastestLap rank fastestLapTime fastestLapSpeed statusId 1 18 1 1 22 1 1 1 1 10.0 58 34:50.6 5690616 39 2 01:27.5 218.3 1 2 18 2 2 3 5 2 2 2 8.0 58 5.478 5696094 41 3 01:27.7 217.586 1 */ CREATE TABLE seasons ( year INTEGER, url TEXT, PRIMARY KEY (year) ) /* 2 rows from seasons table: year url 1950 http://en.wikipedia.org/wiki/1950_Formula_One_season 1951 http://en.wikipedia.org/wiki/1951_Formula_One_season */ CREATE TABLE status ( "statusId" INTEGER, status TEXT, PRIMARY KEY ("statusId") ) /* 2 rows from status table: statusId status 1 Finished 2 Disqualified */
What are the forenames and surnames of all unique drivers who had a lap time of less than 93000 milliseconds?
SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
[{'Nenhum': 'Nenhum resultado encontrado'}]
Medium
true
false
false
false
false
false
false
true
false
false
false
false
false
cre_Docs_and_Epenses
CREATE TABLE "Accounts" ( "Account_ID" INTEGER NOT NULL, "Statement_ID" INTEGER NOT NULL, "Account_Details" VARCHAR(255), PRIMARY KEY ("Account_ID"), FOREIGN KEY("Statement_ID") REFERENCES "Statements" ("Statement_ID") ) CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Document_Type_Code" CHAR(15) NOT NULL, "Project_ID" INTEGER NOT NULL, "Document_Date" DATETIME, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Document_Type_Code") REFERENCES "Ref_Document_Types" ("Document_Type_Code"), FOREIGN KEY("Project_ID") REFERENCES "Projects" ("Project_ID") ) CREATE TABLE "Documents_with_Expenses" ( "Document_ID" INTEGER NOT NULL, "Budget_Type_Code" CHAR(15) NOT NULL, "Document_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Budget_Type_Code") REFERENCES "Ref_Budget_Codes" ("Budget_Type_Code"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) CREATE TABLE "Projects" ( "Project_ID" INTEGER NOT NULL, "Project_Details" VARCHAR(255), PRIMARY KEY ("Project_ID") ) CREATE TABLE "Ref_Budget_Codes" ( "Budget_Type_Code" CHAR(15) NOT NULL, "Budget_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Budget_Type_Code") ) CREATE TABLE "Ref_Document_Types" ( "Document_Type_Code" CHAR(15) NOT NULL, "Document_Type_Name" VARCHAR(255) NOT NULL, "Document_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Document_Type_Code") ) CREATE TABLE "Statements" ( "Statement_ID" INTEGER NOT NULL, "Statement_Details" VARCHAR(255), PRIMARY KEY ("Statement_ID"), FOREIGN KEY("Statement_ID") REFERENCES "Documents" ("Document_ID") )
CREATE TABLE "Accounts" ( "Account_ID" INTEGER NOT NULL, "Statement_ID" INTEGER NOT NULL, "Account_Details" VARCHAR(255), PRIMARY KEY ("Account_ID"), FOREIGN KEY("Statement_ID") REFERENCES "Statements" ("Statement_ID") ) /* 2 rows from Accounts table: Account_ID Statement_ID Account_Details 7 57 495.063 61 57 930.14 */ CREATE TABLE "Documents" ( "Document_ID" INTEGER NOT NULL, "Document_Type_Code" CHAR(15) NOT NULL, "Project_ID" INTEGER NOT NULL, "Document_Date" DATETIME, "Document_Name" VARCHAR(255), "Document_Description" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Document_Type_Code") REFERENCES "Ref_Document_Types" ("Document_Type_Code"), FOREIGN KEY("Project_ID") REFERENCES "Projects" ("Project_ID") ) /* 2 rows from Documents table: Document_ID Document_Type_Code Project_ID Document_Date Document_Name Document_Description Other_Details 29 CV 30 2004-08-28 06:59:19 Review on UK files None None 42 BK 105 2012-12-27 19:09:18 Review on Canadian files None None */ CREATE TABLE "Documents_with_Expenses" ( "Document_ID" INTEGER NOT NULL, "Budget_Type_Code" CHAR(15) NOT NULL, "Document_Details" VARCHAR(255), PRIMARY KEY ("Document_ID"), FOREIGN KEY("Budget_Type_Code") REFERENCES "Ref_Budget_Codes" ("Budget_Type_Code"), FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Documents_with_Expenses table: Document_ID Budget_Type_Code Document_Details 57 GV government 192 GV government */ CREATE TABLE "Projects" ( "Project_ID" INTEGER NOT NULL, "Project_Details" VARCHAR(255), PRIMARY KEY ("Project_ID") ) /* 2 rows from Projects table: Project_ID Project_Details 30 Society Research project 35 Internet of Things project */ CREATE TABLE "Ref_Budget_Codes" ( "Budget_Type_Code" CHAR(15) NOT NULL, "Budget_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Budget_Type_Code") ) /* 2 rows from Ref_Budget_Codes table: Budget_Type_Code Budget_Type_Description GV Government ORG Organisation */ CREATE TABLE "Ref_Document_Types" ( "Document_Type_Code" CHAR(15) NOT NULL, "Document_Type_Name" VARCHAR(255) NOT NULL, "Document_Type_Description" VARCHAR(255) NOT NULL, PRIMARY KEY ("Document_Type_Code") ) /* 2 rows from Ref_Document_Types table: Document_Type_Code Document_Type_Name Document_Type_Description BK Book excellent CV CV excellent */ CREATE TABLE "Statements" ( "Statement_ID" INTEGER NOT NULL, "Statement_Details" VARCHAR(255), PRIMARY KEY ("Statement_ID"), FOREIGN KEY("Statement_ID") REFERENCES "Documents" ("Document_ID") ) /* 2 rows from Statements table: Statement_ID Statement_Details 57 Open Project 192 Private Project */
What is the project detail for the project with document "King Book"?
SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = "King Book"
[{'Project_Details': 'Human Resource project'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
music_2
CREATE TABLE "Albums" ( "AId" INTEGER, "Title" TEXT, "Year" INTEGER, "Label" TEXT, "Type" TEXT, PRIMARY KEY ("AId") ) CREATE TABLE "Band" ( "Id" INTEGER, "Firstname" TEXT, "Lastname" TEXT, PRIMARY KEY ("Id") ) CREATE TABLE "Instruments" ( "SongId" INTEGER, "BandmateId" INTEGER, "Instrument" TEXT, PRIMARY KEY ("SongId", "BandmateId", "Instrument"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("BandmateId") REFERENCES "Band" ("Id") ) CREATE TABLE "Performance" ( "SongId" INTEGER, "Bandmate" INTEGER, "StagePosition" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") ) CREATE TABLE "Songs" ( "SongId" INTEGER, "Title" TEXT, PRIMARY KEY ("SongId") ) CREATE TABLE "Tracklists" ( "AlbumId" INTEGER, "Position" INTEGER, "SongId" INTEGER, PRIMARY KEY ("AlbumId", "Position"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("AlbumId") REFERENCES "Albums" ("AId") ) CREATE TABLE "Vocals" ( "SongId" INTEGER, "Bandmate" INTEGER, "Type" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") )
CREATE TABLE "Albums" ( "AId" INTEGER, "Title" TEXT, "Year" INTEGER, "Label" TEXT, "Type" TEXT, PRIMARY KEY ("AId") ) /* 2 rows from Albums table: AId Title Year Label Type */ CREATE TABLE "Band" ( "Id" INTEGER, "Firstname" TEXT, "Lastname" TEXT, PRIMARY KEY ("Id") ) /* 2 rows from Band table: Id Firstname Lastname */ CREATE TABLE "Instruments" ( "SongId" INTEGER, "BandmateId" INTEGER, "Instrument" TEXT, PRIMARY KEY ("SongId", "BandmateId", "Instrument"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("BandmateId") REFERENCES "Band" ("Id") ) /* 2 rows from Instruments table: SongId BandmateId Instrument */ CREATE TABLE "Performance" ( "SongId" INTEGER, "Bandmate" INTEGER, "StagePosition" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") ) /* 2 rows from Performance table: SongId Bandmate StagePosition */ CREATE TABLE "Songs" ( "SongId" INTEGER, "Title" TEXT, PRIMARY KEY ("SongId") ) /* 2 rows from Songs table: SongId Title */ CREATE TABLE "Tracklists" ( "AlbumId" INTEGER, "Position" INTEGER, "SongId" INTEGER, PRIMARY KEY ("AlbumId", "Position"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("AlbumId") REFERENCES "Albums" ("AId") ) /* 2 rows from Tracklists table: AlbumId Position SongId */ CREATE TABLE "Vocals" ( "SongId" INTEGER, "Bandmate" INTEGER, "Type" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") ) /* 2 rows from Vocals table: SongId Bandmate Type */
What is the first and last name of artist who performed "Le Pop"?
SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Le Pop"
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
false
false
false
false
false
false
false
false
true
false
false
false
false
[QUESTION]What country is the artist who made the fewest songs from?[/QUESTION] [SQL]SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1[/SQL]
[QUESTION]What country is the artist who made the fewest songs from?[/QUESTION] [SQL]SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1[/SQL]
[QUESTION]What country is the artist who made the fewest songs from?[/QUESTION] [SQL]SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1[/SQL]
movie_1
CREATE TABLE "Movie" ( "mID" INTEGER, title TEXT, year INTEGER, director TEXT, PRIMARY KEY ("mID") ) CREATE TABLE "Rating" ( "rID" INTEGER, "mID" INTEGER, stars INTEGER, "ratingDate" DATE, FOREIGN KEY("mID") REFERENCES "Movie" ("mID"), FOREIGN KEY("rID") REFERENCES "Reviewer" ("rID") ) CREATE TABLE "Reviewer" ( "rID" INTEGER, name TEXT, PRIMARY KEY ("rID") )
CREATE TABLE "Movie" ( "mID" INTEGER, title TEXT, year INTEGER, director TEXT, PRIMARY KEY ("mID") ) /* 2 rows from Movie table: mID title year director 101 Gone with the Wind 1939 Victor Fleming 102 Star Wars 1977 George Lucas */ CREATE TABLE "Rating" ( "rID" INTEGER, "mID" INTEGER, stars INTEGER, "ratingDate" DATE, FOREIGN KEY("mID") REFERENCES "Movie" ("mID"), FOREIGN KEY("rID") REFERENCES "Reviewer" ("rID") ) /* 2 rows from Rating table: rID mID stars ratingDate 201 101 2 2011-01-22 201 101 4 2011-01-27 */ CREATE TABLE "Reviewer" ( "rID" INTEGER, name TEXT, PRIMARY KEY ("rID") ) /* 2 rows from Reviewer table: rID name 201 Sarah Martinez 202 Daniel Lewis */
What are the titles and directors of all movies that have a rating higher than the average James Cameron film rating?
SELECT T2.title , T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = "James Cameron")
[{'title': 'Snow White', 'director': None}, {'title': 'Avatar', 'director': 'James Cameron'}]
Hard
false
false
false
false
false
false
false
false
true
false
false
false
false
[QUESTION]How many movies did " Steven Spielberg " direct ?[/QUESTION] [SQL]SELECT COUNT ( DISTINCT t3.title ) FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.name = "Steven Spielberg";[/SQL]
[QUESTION]How many movies did " Steven Spielberg " direct ?[/QUESTION] [SQL]SELECT COUNT ( DISTINCT t3.title ) FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.name = "Steven Spielberg";[/SQL]
[QUESTION]How many movies did " Steven Spielberg " direct ?[/QUESTION] [SQL]SELECT COUNT ( DISTINCT t3.title ) FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.name = "Steven Spielberg";[/SQL]
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
Papers from pldi 2015 conference
SELECT DISTINCT t1.paperid FROM venue AS t2 JOIN paper AS t1 ON t2.venueid = t1.venueid WHERE t1.year = 2015 AND t2.venuename = "pldi";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Medium
true
false
false
false
false
false
false
true
false
false
false
false
false
[QUESTION]return me the authors who have more than 10 papers in the VLDB conference .[/QUESTION] [SQL]SELECT t1.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t2.name = "VLDB" GROUP BY t1.name HAVING COUNT ( DISTINCT t4.title ) > 10;[/SQL]
[QUESTION]return me the authors who have more than 10 papers in the VLDB conference .[/QUESTION] [SQL]SELECT t1.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t2.name = "VLDB" GROUP BY t1.name HAVING COUNT ( DISTINCT t4.title ) > 10;[/SQL]
musical
CREATE TABLE actor ( "Actor_ID" INTEGER, "Name" TEXT, "Musical_ID" INTEGER, "Character" TEXT, "Duration" TEXT, age INTEGER, PRIMARY KEY ("Actor_ID"), FOREIGN KEY("Musical_ID") REFERENCES actor ("Actor_ID") ) CREATE TABLE musical ( "Musical_ID" INTEGER, "Name" TEXT, "Year" INTEGER, "Award" TEXT, "Category" TEXT, "Nominee" TEXT, "Result" TEXT, PRIMARY KEY ("Musical_ID") )
CREATE TABLE actor ( "Actor_ID" INTEGER, "Name" TEXT, "Musical_ID" INTEGER, "Character" TEXT, "Duration" TEXT, age INTEGER, PRIMARY KEY ("Actor_ID"), FOREIGN KEY("Musical_ID") REFERENCES actor ("Actor_ID") ) /* 2 rows from actor table: Actor_ID Name Musical_ID Character Duration age 1 Ray Meagher 1 Alf Stewart 1988— 26 2 Tom Oliver 1 Lou Carpenter 1988, 1992— 22 */ CREATE TABLE musical ( "Musical_ID" INTEGER, "Name" TEXT, "Year" INTEGER, "Award" TEXT, "Category" TEXT, "Nominee" TEXT, "Result" TEXT, PRIMARY KEY ("Musical_ID") ) /* 2 rows from musical table: Musical_ID Name Year Award Category Nominee Result 1 The Phantom of the Opera 1986 Tony Award Best Book of a Musical Bob Fosse Nominated 2 Les Misérables 1986 Tony Award Best Performance by a Leading Actor in a Musical Cleavant Derricks Nominated */
What are the names of actors and the musicals that they are in?
SELECT T1.Name , T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID
[{'Name': 'The Phantom of the Opera'}, {'Name': 'The Phantom of the Opera'}, {'Name': 'Les Misérables'}, {'Name': 'Les Misérables'}, {'Name': 'West Side Story'}, {'Name': 'The Book of Mormon'}, {'Name': 'The Book of Mormon'}, {'Name': 'The Book of Mormon'}, {'Name': 'The Book of Mormon'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
election
CREATE TABLE county ( "County_Id" INTEGER, "County_name" TEXT, "Population" REAL, "Zip_code" TEXT, PRIMARY KEY ("County_Id") ) CREATE TABLE election ( "Election_ID" INTEGER, "Counties_Represented" TEXT, "District" INTEGER, "Delegate" TEXT, "Party" INTEGER, "First_Elected" REAL, "Committee" TEXT, PRIMARY KEY ("Election_ID"), FOREIGN KEY("District") REFERENCES county ("County_Id"), FOREIGN KEY("Party") REFERENCES party ("Party_ID") ) CREATE TABLE party ( "Party_ID" INTEGER, "Year" REAL, "Party" TEXT, "Governor" TEXT, "Lieutenant_Governor" TEXT, "Comptroller" TEXT, "Attorney_General" TEXT, "US_Senate" TEXT, PRIMARY KEY ("Party_ID") )
CREATE TABLE county ( "County_Id" INTEGER, "County_name" TEXT, "Population" REAL, "Zip_code" TEXT, PRIMARY KEY ("County_Id") ) /* 2 rows from county table: County_Id County_name Population Zip_code 1 Howard 21000.0 D21 2 Baltimore County 90000.0 D08 */ CREATE TABLE election ( "Election_ID" INTEGER, "Counties_Represented" TEXT, "District" INTEGER, "Delegate" TEXT, "Party" INTEGER, "First_Elected" REAL, "Committee" TEXT, PRIMARY KEY ("Election_ID"), FOREIGN KEY("District") REFERENCES county ("County_Id"), FOREIGN KEY("Party") REFERENCES party ("Party_ID") ) /* 2 rows from election table: Election_ID Counties_Represented District Delegate Party First_Elected Committee 1 09.1 9A 1 Bates, Gail H. Gail H. Bates 1 2002.0 Appropriations 2 09.1 9A 1 Miller, Warren E. Warren E. Miller 1 2003.0 Economic Matters */ CREATE TABLE party ( "Party_ID" INTEGER, "Year" REAL, "Party" TEXT, "Governor" TEXT, "Lieutenant_Governor" TEXT, "Comptroller" TEXT, "Attorney_General" TEXT, "US_Senate" TEXT, PRIMARY KEY ("Party_ID") ) /* 2 rows from party table: Party_ID Year Party Governor Lieutenant_Governor Comptroller Attorney_General US_Senate 1 1998.0 Democratic Peter Vallone Sandra Frankel Carl McCall Eliot Spitzer Charles Schumer 2 1998.0 Liberal Betsy McCaughey Ross Jonathan Reiter Carl McCall Eliot Spitzer Charles Schumer */
Show the delegates and the names of county they belong to.
SELECT T2.Delegate , T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District
[{'Delegate': 'Bates, Gail H. Gail H. Bates', 'County_name': 'Howard'}, {'Delegate': 'Miller, Warren E. Warren E. Miller', 'County_name': 'Howard'}, {'Delegate': 'DeBoy, Steven J. Sr. Steven J. DeBoy, Sr.', 'County_name': 'Baltimore County'}, {'Delegate': 'Malone, James E. Jr. James E. Malone, Jr.', 'County_name': 'Colony'}, {'Delegate': 'Bobo, Elizabeth Elizabeth Bobo', 'County_name': 'Baltimore County'}, {'Delegate': 'Pendergrass, Shane E. Shane Pendergrass', 'County_name': 'Howard'}, {'Delegate': 'Guzzone, Guy Guy Guzzone', 'County_name': 'Mansfield'}, {'Delegate': 'Turner, Frank S. Frank S. Turner', 'County_name': 'Colony'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
farm
CREATE TABLE city ( "City_ID" INTEGER, "Official_Name" TEXT, "Status" TEXT, "Area_km_2" REAL, "Population" REAL, "Census_Ranking" TEXT, PRIMARY KEY ("City_ID") ) CREATE TABLE competition_record ( "Competition_ID" INTEGER, "Farm_ID" INTEGER, "Rank" INTEGER, PRIMARY KEY ("Competition_ID", "Farm_ID"), FOREIGN KEY("Farm_ID") REFERENCES farm ("Farm_ID"), FOREIGN KEY("Competition_ID") REFERENCES farm_competition ("Competition_ID") ) CREATE TABLE farm ( "Farm_ID" INTEGER, "Year" INTEGER, "Total_Horses" REAL, "Working_Horses" REAL, "Total_Cattle" REAL, "Oxen" REAL, "Bulls" REAL, "Cows" REAL, "Pigs" REAL, "Sheep_and_Goats" REAL, PRIMARY KEY ("Farm_ID") ) CREATE TABLE farm_competition ( "Competition_ID" INTEGER, "Year" INTEGER, "Theme" TEXT, "Host_city_ID" INTEGER, "Hosts" TEXT, PRIMARY KEY ("Competition_ID"), FOREIGN KEY("Host_city_ID") REFERENCES city ("City_ID") )
CREATE TABLE city ( "City_ID" INTEGER, "Official_Name" TEXT, "Status" TEXT, "Area_km_2" REAL, "Population" REAL, "Census_Ranking" TEXT, PRIMARY KEY ("City_ID") ) /* 2 rows from city table: City_ID Official_Name Status Area_km_2 Population Census_Ranking 1 Grand Falls/Grand-Sault Town 18.06 5706.0 636 of 5008 2 Perth-Andover Village 8.89 1778.0 1442 of 5,008 */ CREATE TABLE competition_record ( "Competition_ID" INTEGER, "Farm_ID" INTEGER, "Rank" INTEGER, PRIMARY KEY ("Competition_ID", "Farm_ID"), FOREIGN KEY("Farm_ID") REFERENCES farm ("Farm_ID"), FOREIGN KEY("Competition_ID") REFERENCES farm_competition ("Competition_ID") ) /* 2 rows from competition_record table: Competition_ID Farm_ID Rank 1 8 1 1 2 2 */ CREATE TABLE farm ( "Farm_ID" INTEGER, "Year" INTEGER, "Total_Horses" REAL, "Working_Horses" REAL, "Total_Cattle" REAL, "Oxen" REAL, "Bulls" REAL, "Cows" REAL, "Pigs" REAL, "Sheep_and_Goats" REAL, PRIMARY KEY ("Farm_ID") ) /* 2 rows from farm table: Farm_ID Year Total_Horses Working_Horses Total_Cattle Oxen Bulls Cows Pigs Sheep_and_Goats 1 1927 5056.5 3900.1 8374.5 805.5 31.6 3852.1 4412.4 7956.3 2 1928 5486.9 4090.5 8604.8 895.3 32.8 3987.0 6962.9 8112.2 */ CREATE TABLE farm_competition ( "Competition_ID" INTEGER, "Year" INTEGER, "Theme" TEXT, "Host_city_ID" INTEGER, "Hosts" TEXT, PRIMARY KEY ("Competition_ID"), FOREIGN KEY("Host_city_ID") REFERENCES city ("City_ID") ) /* 2 rows from farm_competition table: Competition_ID Year Theme Host_city_ID Hosts 1 2013 Carnival M is back! 1 Miley Cyrus Jared Leto and Karen Mok 2 2006 Codehunters 2 Leehom Wang and Kelly Rowland */
What are the themes of competitions that have corresponding host cities with more than 1000 residents?
SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000
[{'Theme': 'Carnival M is back!'}, {'Theme': 'Codehunters'}, {'Theme': 'MTV Asia Aid'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
[QUESTION]What are the names of all districts with a city area greater than 10 or have more than 100000 people living there?[/QUESTION] [SQL]SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000[/SQL]
hr_1
CREATE TABLE countries ( "COUNTRY_ID" VARCHAR(2) NOT NULL, "COUNTRY_NAME" VARCHAR(40) DEFAULT NULL, "REGION_ID" DECIMAL(10, 0) DEFAULT NULL, PRIMARY KEY ("COUNTRY_ID"), FOREIGN KEY("REGION_ID") REFERENCES regions ("REGION_ID") ) CREATE TABLE departments ( "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "DEPARTMENT_NAME" VARCHAR(30) NOT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "LOCATION_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("DEPARTMENT_ID") ) CREATE TABLE employees ( "EMPLOYEE_ID" DECIMAL(6, 0) DEFAULT '0' NOT NULL, "FIRST_NAME" VARCHAR(20) DEFAULT NULL, "LAST_NAME" VARCHAR(25) NOT NULL, "EMAIL" VARCHAR(25) NOT NULL, "PHONE_NUMBER" VARCHAR(20) DEFAULT NULL, "HIRE_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "SALARY" DECIMAL(8, 2) DEFAULT NULL, "COMMISSION_PCT" DECIMAL(2, 2) DEFAULT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID") ) CREATE TABLE job_history ( "EMPLOYEE_ID" DECIMAL(6, 0) NOT NULL, "START_DATE" DATE NOT NULL, "END_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID", "START_DATE"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID"), FOREIGN KEY("EMPLOYEE_ID") REFERENCES employees ("EMPLOYEE_ID") ) CREATE TABLE jobs ( "JOB_ID" VARCHAR(10) DEFAULT '' NOT NULL, "JOB_TITLE" VARCHAR(35) NOT NULL, "MIN_SALARY" DECIMAL(6, 0) DEFAULT NULL, "MAX_SALARY" DECIMAL(6, 0) DEFAULT NULL, PRIMARY KEY ("JOB_ID") ) CREATE TABLE locations ( "LOCATION_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "STREET_ADDRESS" VARCHAR(40) DEFAULT NULL, "POSTAL_CODE" VARCHAR(12) DEFAULT NULL, "CITY" VARCHAR(30) NOT NULL, "STATE_PROVINCE" VARCHAR(25) DEFAULT NULL, "COUNTRY_ID" VARCHAR(2) DEFAULT NULL, PRIMARY KEY ("LOCATION_ID"), FOREIGN KEY("COUNTRY_ID") REFERENCES countries ("COUNTRY_ID") ) CREATE TABLE regions ( "REGION_ID" DECIMAL(5, 0) NOT NULL, "REGION_NAME" VARCHAR(25) DEFAULT NULL, PRIMARY KEY ("REGION_ID") )
CREATE TABLE countries ( "COUNTRY_ID" VARCHAR(2) NOT NULL, "COUNTRY_NAME" VARCHAR(40) DEFAULT NULL, "REGION_ID" DECIMAL(10, 0) DEFAULT NULL, PRIMARY KEY ("COUNTRY_ID"), FOREIGN KEY("REGION_ID") REFERENCES regions ("REGION_ID") ) /* 2 rows from countries table: COUNTRY_ID COUNTRY_NAME REGION_ID AR Argentina 2 AU Australia 3 */ CREATE TABLE departments ( "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "DEPARTMENT_NAME" VARCHAR(30) NOT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "LOCATION_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("DEPARTMENT_ID") ) /* 2 rows from departments table: DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID 10 Administration 200 1700 20 Marketing 201 1800 */ CREATE TABLE employees ( "EMPLOYEE_ID" DECIMAL(6, 0) DEFAULT '0' NOT NULL, "FIRST_NAME" VARCHAR(20) DEFAULT NULL, "LAST_NAME" VARCHAR(25) NOT NULL, "EMAIL" VARCHAR(25) NOT NULL, "PHONE_NUMBER" VARCHAR(20) DEFAULT NULL, "HIRE_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "SALARY" DECIMAL(8, 2) DEFAULT NULL, "COMMISSION_PCT" DECIMAL(2, 2) DEFAULT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID") ) /* 2 rows from employees table: EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID 100 Steven King SKING 515.123.4567 1987-06-17 AD_PRES 24000.00 0.00 0 90 101 Neena Kochhar NKOCHHAR 515.123.4568 1987-06-18 AD_VP 17000.00 0.00 100 90 */ CREATE TABLE job_history ( "EMPLOYEE_ID" DECIMAL(6, 0) NOT NULL, "START_DATE" DATE NOT NULL, "END_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID", "START_DATE"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID"), FOREIGN KEY("EMPLOYEE_ID") REFERENCES employees ("EMPLOYEE_ID") ) /* 2 rows from job_history table: EMPLOYEE_ID START_DATE END_DATE JOB_ID DEPARTMENT_ID 102 1993-01-13 1998-07-24 IT_PROG 60 101 1989-09-21 1993-10-27 AC_ACCOUNT 110 */ CREATE TABLE jobs ( "JOB_ID" VARCHAR(10) DEFAULT '' NOT NULL, "JOB_TITLE" VARCHAR(35) NOT NULL, "MIN_SALARY" DECIMAL(6, 0) DEFAULT NULL, "MAX_SALARY" DECIMAL(6, 0) DEFAULT NULL, PRIMARY KEY ("JOB_ID") ) /* 2 rows from jobs table: JOB_ID JOB_TITLE MIN_SALARY MAX_SALARY AD_PRES President 20000 40000 AD_VP Administration Vice President 15000 30000 */ CREATE TABLE locations ( "LOCATION_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "STREET_ADDRESS" VARCHAR(40) DEFAULT NULL, "POSTAL_CODE" VARCHAR(12) DEFAULT NULL, "CITY" VARCHAR(30) NOT NULL, "STATE_PROVINCE" VARCHAR(25) DEFAULT NULL, "COUNTRY_ID" VARCHAR(2) DEFAULT NULL, PRIMARY KEY ("LOCATION_ID"), FOREIGN KEY("COUNTRY_ID") REFERENCES countries ("COUNTRY_ID") ) /* 2 rows from locations table: LOCATION_ID STREET_ADDRESS POSTAL_CODE CITY STATE_PROVINCE COUNTRY_ID 1000 1297 Via Cola di Rie 989 Roma IT 1100 93091 Calle della Testa 10934 Venice IT */ CREATE TABLE regions ( "REGION_ID" DECIMAL(5, 0) NOT NULL, "REGION_NAME" VARCHAR(25) DEFAULT NULL, PRIMARY KEY ("REGION_ID") ) /* 2 rows from regions table: REGION_ID REGION_NAME 1 Europe\r 2 Americas\r */
display all the details from Employees table for those employees who was hired before 2002-06-21.
SELECT * FROM employees WHERE hire_date < '2002-06-21'
[{'EMPLOYEE_ID': 100, 'FIRST_NAME': 'Steven', 'LAST_NAME': 'King', 'EMAIL': 'SKING', 'PHONE_NUMBER': '515.123.4567', 'HIRE_DATE': '1987-06-17', 'JOB_ID': 'AD_PRES', 'SALARY': 24000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 0, 'DEPARTMENT_ID': 90}, {'EMPLOYEE_ID': 101, 'FIRST_NAME': 'Neena', 'LAST_NAME': 'Kochhar', 'EMAIL': 'NKOCHHAR', 'PHONE_NUMBER': '515.123.4568', 'HIRE_DATE': '1987-06-18', 'JOB_ID': 'AD_VP', 'SALARY': 17000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 90}, {'EMPLOYEE_ID': 102, 'FIRST_NAME': 'Lex', 'LAST_NAME': 'De Haan', 'EMAIL': 'LDEHAAN', 'PHONE_NUMBER': '515.123.4569', 'HIRE_DATE': '1987-06-19', 'JOB_ID': 'AD_VP', 'SALARY': 17000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 90}, {'EMPLOYEE_ID': 103, 'FIRST_NAME': 'Alexander', 'LAST_NAME': 'Hunold', 'EMAIL': 'AHUNOLD', 'PHONE_NUMBER': '590.423.4567', 'HIRE_DATE': '1987-06-20', 'JOB_ID': 'IT_PROG', 'SALARY': 9000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 102, 'DEPARTMENT_ID': 60}, {'EMPLOYEE_ID': 104, 'FIRST_NAME': 'Bruce', 'LAST_NAME': 'Ernst', 'EMAIL': 'BERNST', 'PHONE_NUMBER': '590.423.4568', 'HIRE_DATE': '1987-06-21', 'JOB_ID': 'IT_PROG', 'SALARY': 6000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 103, 'DEPARTMENT_ID': 60}, {'EMPLOYEE_ID': 105, 'FIRST_NAME': 'David', 'LAST_NAME': 'Austin', 'EMAIL': 'DAUSTIN', 'PHONE_NUMBER': '590.423.4569', 'HIRE_DATE': '1987-06-22', 'JOB_ID': 'IT_PROG', 'SALARY': 4800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 103, 'DEPARTMENT_ID': 60}, {'EMPLOYEE_ID': 106, 'FIRST_NAME': 'Valli', 'LAST_NAME': 'Pataballa', 'EMAIL': 'VPATABAL', 'PHONE_NUMBER': '590.423.4560', 'HIRE_DATE': '1987-06-23', 'JOB_ID': 'IT_PROG', 'SALARY': 4800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 103, 'DEPARTMENT_ID': 60}, {'EMPLOYEE_ID': 107, 'FIRST_NAME': 'Diana', 'LAST_NAME': 'Lorentz', 'EMAIL': 'DLORENTZ', 'PHONE_NUMBER': '590.423.5567', 'HIRE_DATE': '1987-06-24', 'JOB_ID': 'IT_PROG', 'SALARY': 4200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 103, 'DEPARTMENT_ID': 60}, {'EMPLOYEE_ID': 108, 'FIRST_NAME': 'Nancy', 'LAST_NAME': 'Greenberg', 'EMAIL': 'NGREENBE', 'PHONE_NUMBER': '515.124.4569', 'HIRE_DATE': '1987-06-25', 'JOB_ID': 'FI_MGR', 'SALARY': 12000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 101, 'DEPARTMENT_ID': 100}, {'EMPLOYEE_ID': 109, 'FIRST_NAME': 'Daniel', 'LAST_NAME': 'Faviet', 'EMAIL': 'DFAVIET', 'PHONE_NUMBER': '515.124.4169', 'HIRE_DATE': '1987-06-26', 'JOB_ID': 'FI_ACCOUNT', 'SALARY': 9000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 108, 'DEPARTMENT_ID': 100}, {'EMPLOYEE_ID': 110, 'FIRST_NAME': 'John', 'LAST_NAME': 'Chen', 'EMAIL': 'JCHEN', 'PHONE_NUMBER': '515.124.4269', 'HIRE_DATE': '1987-06-27', 'JOB_ID': 'FI_ACCOUNT', 'SALARY': 8200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 108, 'DEPARTMENT_ID': 100}, {'EMPLOYEE_ID': 111, 'FIRST_NAME': 'Ismael', 'LAST_NAME': 'Sciarra', 'EMAIL': 'ISCIARRA', 'PHONE_NUMBER': '515.124.4369', 'HIRE_DATE': '1987-06-28', 'JOB_ID': 'FI_ACCOUNT', 'SALARY': 7700, 'COMMISSION_PCT': 0, 'MANAGER_ID': 108, 'DEPARTMENT_ID': 100}, {'EMPLOYEE_ID': 112, 'FIRST_NAME': 'Jose Manuel', 'LAST_NAME': 'Urman', 'EMAIL': 'JMURMAN', 'PHONE_NUMBER': '515.124.4469', 'HIRE_DATE': '1987-06-29', 'JOB_ID': 'FI_ACCOUNT', 'SALARY': 7800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 108, 'DEPARTMENT_ID': 100}, {'EMPLOYEE_ID': 113, 'FIRST_NAME': 'Luis', 'LAST_NAME': 'Popp', 'EMAIL': 'LPOPP', 'PHONE_NUMBER': '515.124.4567', 'HIRE_DATE': '1987-06-30', 'JOB_ID': 'FI_ACCOUNT', 'SALARY': 6900, 'COMMISSION_PCT': 0, 'MANAGER_ID': 108, 'DEPARTMENT_ID': 100}, {'EMPLOYEE_ID': 114, 'FIRST_NAME': 'Den', 'LAST_NAME': 'Raphaely', 'EMAIL': 'DRAPHEAL', 'PHONE_NUMBER': '515.127.4561', 'HIRE_DATE': '1987-07-01', 'JOB_ID': 'PU_MAN', 'SALARY': 11000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 30}, {'EMPLOYEE_ID': 115, 'FIRST_NAME': 'Alexander', 'LAST_NAME': 'Khoo', 'EMAIL': 'AKHOO', 'PHONE_NUMBER': '515.127.4562', 'HIRE_DATE': '1987-07-02', 'JOB_ID': 'PU_CLERK', 'SALARY': 3100, 'COMMISSION_PCT': 0, 'MANAGER_ID': 114, 'DEPARTMENT_ID': 30}, {'EMPLOYEE_ID': 116, 'FIRST_NAME': 'Shelli', 'LAST_NAME': 'Baida', 'EMAIL': 'SBAIDA', 'PHONE_NUMBER': '515.127.4563', 'HIRE_DATE': '1987-07-03', 'JOB_ID': 'PU_CLERK', 'SALARY': 2900, 'COMMISSION_PCT': 0, 'MANAGER_ID': 114, 'DEPARTMENT_ID': 30}, {'EMPLOYEE_ID': 117, 'FIRST_NAME': 'Sigal', 'LAST_NAME': 'Tobias', 'EMAIL': 'STOBIAS', 'PHONE_NUMBER': '515.127.4564', 'HIRE_DATE': '1987-07-04', 'JOB_ID': 'PU_CLERK', 'SALARY': 2800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 114, 'DEPARTMENT_ID': 30}, {'EMPLOYEE_ID': 118, 'FIRST_NAME': 'Guy', 'LAST_NAME': 'Himuro', 'EMAIL': 'GHIMURO', 'PHONE_NUMBER': '515.127.4565', 'HIRE_DATE': '1987-07-05', 'JOB_ID': 'PU_CLERK', 'SALARY': 2600, 'COMMISSION_PCT': 0, 'MANAGER_ID': 114, 'DEPARTMENT_ID': 30}, {'EMPLOYEE_ID': 119, 'FIRST_NAME': 'Karen', 'LAST_NAME': 'Colmenares', 'EMAIL': 'KCOLMENA', 'PHONE_NUMBER': '515.127.4566', 'HIRE_DATE': '1987-07-06', 'JOB_ID': 'PU_CLERK', 'SALARY': 2500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 114, 'DEPARTMENT_ID': 30}, {'EMPLOYEE_ID': 120, 'FIRST_NAME': 'Matthew', 'LAST_NAME': 'Weiss', 'EMAIL': 'MWEISS', 'PHONE_NUMBER': '650.123.1234', 'HIRE_DATE': '1987-07-07', 'JOB_ID': 'ST_MAN', 'SALARY': 8000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 121, 'FIRST_NAME': 'Adam', 'LAST_NAME': 'Fripp', 'EMAIL': 'AFRIPP', 'PHONE_NUMBER': '650.123.2234', 'HIRE_DATE': '1987-07-08', 'JOB_ID': 'ST_MAN', 'SALARY': 8200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 122, 'FIRST_NAME': 'Payam', 'LAST_NAME': 'Kaufling', 'EMAIL': 'PKAUFLIN', 'PHONE_NUMBER': '650.123.3234', 'HIRE_DATE': '1987-07-09', 'JOB_ID': 'ST_MAN', 'SALARY': 7900, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 123, 'FIRST_NAME': 'Shanta', 'LAST_NAME': 'Vollman', 'EMAIL': 'SVOLLMAN', 'PHONE_NUMBER': '650.123.4234', 'HIRE_DATE': '1987-07-10', 'JOB_ID': 'ST_MAN', 'SALARY': 6500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 124, 'FIRST_NAME': 'Kevin', 'LAST_NAME': 'Mourgos', 'EMAIL': 'KMOURGOS', 'PHONE_NUMBER': '650.123.5234', 'HIRE_DATE': '1987-07-11', 'JOB_ID': 'ST_MAN', 'SALARY': 5800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 125, 'FIRST_NAME': 'Julia', 'LAST_NAME': 'Nayer', 'EMAIL': 'JNAYER', 'PHONE_NUMBER': '650.124.1214', 'HIRE_DATE': '1987-07-12', 'JOB_ID': 'ST_CLERK', 'SALARY': 3200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 126, 'FIRST_NAME': 'Irene', 'LAST_NAME': 'Mikkilineni', 'EMAIL': 'IMIKKILI', 'PHONE_NUMBER': '650.124.1224', 'HIRE_DATE': '1987-07-13', 'JOB_ID': 'ST_CLERK', 'SALARY': 2700, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 127, 'FIRST_NAME': 'James', 'LAST_NAME': 'Landry', 'EMAIL': 'JLANDRY', 'PHONE_NUMBER': '650.124.1334', 'HIRE_DATE': '1987-07-14', 'JOB_ID': 'ST_CLERK', 'SALARY': 2400, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 128, 'FIRST_NAME': 'Steven', 'LAST_NAME': 'Markle', 'EMAIL': 'SMARKLE', 'PHONE_NUMBER': '650.124.1434', 'HIRE_DATE': '1987-07-15', 'JOB_ID': 'ST_CLERK', 'SALARY': 2200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 129, 'FIRST_NAME': 'Laura', 'LAST_NAME': 'Bissot', 'EMAIL': 'LBISSOT', 'PHONE_NUMBER': '650.124.5234', 'HIRE_DATE': '1987-07-16', 'JOB_ID': 'ST_CLERK', 'SALARY': 3300, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 130, 'FIRST_NAME': 'Mozhe', 'LAST_NAME': 'Atkinson', 'EMAIL': 'MATKINSO', 'PHONE_NUMBER': '650.124.6234', 'HIRE_DATE': '1987-07-17', 'JOB_ID': 'ST_CLERK', 'SALARY': 2800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 131, 'FIRST_NAME': 'James', 'LAST_NAME': 'Marlow', 'EMAIL': 'JAMRLOW', 'PHONE_NUMBER': '650.124.7234', 'HIRE_DATE': '1987-07-18', 'JOB_ID': 'ST_CLERK', 'SALARY': 2500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 132, 'FIRST_NAME': 'TJ', 'LAST_NAME': 'Olson', 'EMAIL': 'TJOLSON', 'PHONE_NUMBER': '650.124.8234', 'HIRE_DATE': '1987-07-19', 'JOB_ID': 'ST_CLERK', 'SALARY': 2100, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 133, 'FIRST_NAME': 'Jason', 'LAST_NAME': 'Mallin', 'EMAIL': 'JMALLIN', 'PHONE_NUMBER': '650.127.1934', 'HIRE_DATE': '1987-07-20', 'JOB_ID': 'ST_CLERK', 'SALARY': 3300, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 134, 'FIRST_NAME': 'Michael', 'LAST_NAME': 'Rogers', 'EMAIL': 'MROGERS', 'PHONE_NUMBER': '650.127.1834', 'HIRE_DATE': '1987-07-21', 'JOB_ID': 'ST_CLERK', 'SALARY': 2900, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 135, 'FIRST_NAME': 'Ki', 'LAST_NAME': 'Gee', 'EMAIL': 'KGEE', 'PHONE_NUMBER': '650.127.1734', 'HIRE_DATE': '1987-07-22', 'JOB_ID': 'ST_CLERK', 'SALARY': 2400, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 136, 'FIRST_NAME': 'Hazel', 'LAST_NAME': 'Philtanker', 'EMAIL': 'HPHILTAN', 'PHONE_NUMBER': '650.127.1634', 'HIRE_DATE': '1987-07-23', 'JOB_ID': 'ST_CLERK', 'SALARY': 2200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 137, 'FIRST_NAME': 'Renske', 'LAST_NAME': 'Ladwig', 'EMAIL': 'RLADWIG', 'PHONE_NUMBER': '650.121.1234', 'HIRE_DATE': '1987-07-24', 'JOB_ID': 'ST_CLERK', 'SALARY': 3600, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 138, 'FIRST_NAME': 'Stephen', 'LAST_NAME': 'Stiles', 'EMAIL': 'SSTILES', 'PHONE_NUMBER': '650.121.2034', 'HIRE_DATE': '1987-07-25', 'JOB_ID': 'ST_CLERK', 'SALARY': 3200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 139, 'FIRST_NAME': 'John', 'LAST_NAME': 'Seo', 'EMAIL': 'JSEO', 'PHONE_NUMBER': '650.121.2019', 'HIRE_DATE': '1987-07-26', 'JOB_ID': 'ST_CLERK', 'SALARY': 2700, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 140, 'FIRST_NAME': 'Joshua', 'LAST_NAME': 'Patel', 'EMAIL': 'JPATEL', 'PHONE_NUMBER': '650.121.1834', 'HIRE_DATE': '1987-07-27', 'JOB_ID': 'ST_CLERK', 'SALARY': 2500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 141, 'FIRST_NAME': 'Trenna', 'LAST_NAME': 'Rajs', 'EMAIL': 'TRAJS', 'PHONE_NUMBER': '650.121.8009', 'HIRE_DATE': '1987-07-28', 'JOB_ID': 'ST_CLERK', 'SALARY': 3500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 142, 'FIRST_NAME': 'Curtis', 'LAST_NAME': 'Davies', 'EMAIL': 'CDAVIES', 'PHONE_NUMBER': '650.121.2994', 'HIRE_DATE': '1987-07-29', 'JOB_ID': 'ST_CLERK', 'SALARY': 3100, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 143, 'FIRST_NAME': 'Randall', 'LAST_NAME': 'Matos', 'EMAIL': 'RMATOS', 'PHONE_NUMBER': '650.121.2874', 'HIRE_DATE': '1987-07-30', 'JOB_ID': 'ST_CLERK', 'SALARY': 2600, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 144, 'FIRST_NAME': 'Peter', 'LAST_NAME': 'Vargas', 'EMAIL': 'PVARGAS', 'PHONE_NUMBER': '650.121.2004', 'HIRE_DATE': '1987-07-31', 'JOB_ID': 'ST_CLERK', 'SALARY': 2500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 145, 'FIRST_NAME': 'John', 'LAST_NAME': 'Russell', 'EMAIL': 'JRUSSEL', 'PHONE_NUMBER': '011.44.1344.429268', 'HIRE_DATE': '1987-08-01', 'JOB_ID': 'SA_MAN', 'SALARY': 14000, 'COMMISSION_PCT': 0.4, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 146, 'FIRST_NAME': 'Karen', 'LAST_NAME': 'Partners', 'EMAIL': 'KPARTNER', 'PHONE_NUMBER': '011.44.1344.467268', 'HIRE_DATE': '1987-08-02', 'JOB_ID': 'SA_MAN', 'SALARY': 13500, 'COMMISSION_PCT': 0.3, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 147, 'FIRST_NAME': 'Alberto', 'LAST_NAME': 'Errazuriz', 'EMAIL': 'AERRAZUR', 'PHONE_NUMBER': '011.44.1344.429278', 'HIRE_DATE': '1987-08-03', 'JOB_ID': 'SA_MAN', 'SALARY': 12000, 'COMMISSION_PCT': 0.3, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 148, 'FIRST_NAME': 'Gerald', 'LAST_NAME': 'Cambrault', 'EMAIL': 'GCAMBRAU', 'PHONE_NUMBER': '011.44.1344.619268', 'HIRE_DATE': '1987-08-04', 'JOB_ID': 'SA_MAN', 'SALARY': 11000, 'COMMISSION_PCT': 0.3, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 149, 'FIRST_NAME': 'Eleni', 'LAST_NAME': 'Zlotkey', 'EMAIL': 'EZLOTKEY', 'PHONE_NUMBER': '011.44.1344.429018', 'HIRE_DATE': '1987-08-05', 'JOB_ID': 'SA_MAN', 'SALARY': 10500, 'COMMISSION_PCT': 0.2, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 150, 'FIRST_NAME': 'Peter', 'LAST_NAME': 'Tucker', 'EMAIL': 'PTUCKER', 'PHONE_NUMBER': '011.44.1344.129268', 'HIRE_DATE': '1987-08-06', 'JOB_ID': 'SA_REP', 'SALARY': 10000, 'COMMISSION_PCT': 0.3, 'MANAGER_ID': 145, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 151, 'FIRST_NAME': 'David', 'LAST_NAME': 'Bernstein', 'EMAIL': 'DBERNSTE', 'PHONE_NUMBER': '011.44.1344.345268', 'HIRE_DATE': '1987-08-07', 'JOB_ID': 'SA_REP', 'SALARY': 9500, 'COMMISSION_PCT': 0.25, 'MANAGER_ID': 145, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 152, 'FIRST_NAME': 'Peter', 'LAST_NAME': 'Hall', 'EMAIL': 'PHALL', 'PHONE_NUMBER': '011.44.1344.478968', 'HIRE_DATE': '1987-08-08', 'JOB_ID': 'SA_REP', 'SALARY': 9000, 'COMMISSION_PCT': 0.25, 'MANAGER_ID': 145, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 153, 'FIRST_NAME': 'Christopher', 'LAST_NAME': 'Olsen', 'EMAIL': 'COLSEN', 'PHONE_NUMBER': '011.44.1344.498718', 'HIRE_DATE': '1987-08-09', 'JOB_ID': 'SA_REP', 'SALARY': 8000, 'COMMISSION_PCT': 0.2, 'MANAGER_ID': 145, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 154, 'FIRST_NAME': 'Nanette', 'LAST_NAME': 'Cambrault', 'EMAIL': 'NCAMBRAU', 'PHONE_NUMBER': '011.44.1344.987668', 'HIRE_DATE': '1987-08-10', 'JOB_ID': 'SA_REP', 'SALARY': 7500, 'COMMISSION_PCT': 0.2, 'MANAGER_ID': 145, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 155, 'FIRST_NAME': 'Oliver', 'LAST_NAME': 'Tuvault', 'EMAIL': 'OTUVAULT', 'PHONE_NUMBER': '011.44.1344.486508', 'HIRE_DATE': '1987-08-11', 'JOB_ID': 'SA_REP', 'SALARY': 7000, 'COMMISSION_PCT': 0.15, 'MANAGER_ID': 145, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 156, 'FIRST_NAME': 'Janette', 'LAST_NAME': 'King', 'EMAIL': 'JKING', 'PHONE_NUMBER': '011.44.1345.429268', 'HIRE_DATE': '1987-08-12', 'JOB_ID': 'SA_REP', 'SALARY': 10000, 'COMMISSION_PCT': 0.35, 'MANAGER_ID': 146, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 157, 'FIRST_NAME': 'Patrick', 'LAST_NAME': 'Sully', 'EMAIL': 'PSULLY', 'PHONE_NUMBER': '011.44.1345.929268', 'HIRE_DATE': '1987-08-13', 'JOB_ID': 'SA_REP', 'SALARY': 9500, 'COMMISSION_PCT': 0.35, 'MANAGER_ID': 146, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 158, 'FIRST_NAME': 'Allan', 'LAST_NAME': 'McEwen', 'EMAIL': 'AMCEWEN', 'PHONE_NUMBER': '011.44.1345.829268', 'HIRE_DATE': '1987-08-14', 'JOB_ID': 'SA_REP', 'SALARY': 9000, 'COMMISSION_PCT': 0.35, 'MANAGER_ID': 146, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 159, 'FIRST_NAME': 'Lindsey', 'LAST_NAME': 'Smith', 'EMAIL': 'LSMITH', 'PHONE_NUMBER': '011.44.1345.729268', 'HIRE_DATE': '1987-08-15', 'JOB_ID': 'SA_REP', 'SALARY': 8000, 'COMMISSION_PCT': 0.3, 'MANAGER_ID': 146, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 160, 'FIRST_NAME': 'Louise', 'LAST_NAME': 'Doran', 'EMAIL': 'LDORAN', 'PHONE_NUMBER': '011.44.1345.629268', 'HIRE_DATE': '1987-08-16', 'JOB_ID': 'SA_REP', 'SALARY': 7500, 'COMMISSION_PCT': 0.3, 'MANAGER_ID': 146, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 161, 'FIRST_NAME': 'Sarath', 'LAST_NAME': 'Sewall', 'EMAIL': 'SSEWALL', 'PHONE_NUMBER': '011.44.1345.529268', 'HIRE_DATE': '1987-08-17', 'JOB_ID': 'SA_REP', 'SALARY': 7000, 'COMMISSION_PCT': 0.25, 'MANAGER_ID': 146, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 162, 'FIRST_NAME': 'Clara', 'LAST_NAME': 'Vishney', 'EMAIL': 'CVISHNEY', 'PHONE_NUMBER': '011.44.1346.129268', 'HIRE_DATE': '1987-08-18', 'JOB_ID': 'SA_REP', 'SALARY': 10500, 'COMMISSION_PCT': 0.25, 'MANAGER_ID': 147, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 163, 'FIRST_NAME': 'Danielle', 'LAST_NAME': 'Greene', 'EMAIL': 'DGREENE', 'PHONE_NUMBER': '011.44.1346.229268', 'HIRE_DATE': '1987-08-19', 'JOB_ID': 'SA_REP', 'SALARY': 9500, 'COMMISSION_PCT': 0.15, 'MANAGER_ID': 147, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 164, 'FIRST_NAME': 'Mattea', 'LAST_NAME': 'Marvins', 'EMAIL': 'MMARVINS', 'PHONE_NUMBER': '011.44.1346.329268', 'HIRE_DATE': '1987-08-20', 'JOB_ID': 'SA_REP', 'SALARY': 7200, 'COMMISSION_PCT': 0.1, 'MANAGER_ID': 147, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 165, 'FIRST_NAME': 'David', 'LAST_NAME': 'Lee', 'EMAIL': 'DLEE', 'PHONE_NUMBER': '011.44.1346.529268', 'HIRE_DATE': '1987-08-21', 'JOB_ID': 'SA_REP', 'SALARY': 6800, 'COMMISSION_PCT': 0.1, 'MANAGER_ID': 147, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 166, 'FIRST_NAME': 'Sundar', 'LAST_NAME': 'Ande', 'EMAIL': 'SANDE', 'PHONE_NUMBER': '011.44.1346.629268', 'HIRE_DATE': '1987-08-22', 'JOB_ID': 'SA_REP', 'SALARY': 6400, 'COMMISSION_PCT': 0.1, 'MANAGER_ID': 147, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 167, 'FIRST_NAME': 'Amit', 'LAST_NAME': 'Banda', 'EMAIL': 'ABANDA', 'PHONE_NUMBER': '011.44.1346.729268', 'HIRE_DATE': '1987-08-23', 'JOB_ID': 'SA_REP', 'SALARY': 6200, 'COMMISSION_PCT': 0.1, 'MANAGER_ID': 147, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 168, 'FIRST_NAME': 'Lisa', 'LAST_NAME': 'Ozer', 'EMAIL': 'LOZER', 'PHONE_NUMBER': '011.44.1343.929268', 'HIRE_DATE': '1987-08-24', 'JOB_ID': 'SA_REP', 'SALARY': 11500, 'COMMISSION_PCT': 0.25, 'MANAGER_ID': 148, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 169, 'FIRST_NAME': 'Harrison', 'LAST_NAME': 'Bloom', 'EMAIL': 'HBLOOM', 'PHONE_NUMBER': '011.44.1343.829268', 'HIRE_DATE': '1987-08-25', 'JOB_ID': 'SA_REP', 'SALARY': 10000, 'COMMISSION_PCT': 0.2, 'MANAGER_ID': 148, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 170, 'FIRST_NAME': 'Tayler', 'LAST_NAME': 'Fox', 'EMAIL': 'TFOX', 'PHONE_NUMBER': '011.44.1343.729268', 'HIRE_DATE': '1987-08-26', 'JOB_ID': 'SA_REP', 'SALARY': 9600, 'COMMISSION_PCT': 0.2, 'MANAGER_ID': 148, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 171, 'FIRST_NAME': 'William', 'LAST_NAME': 'Smith', 'EMAIL': 'WSMITH', 'PHONE_NUMBER': '011.44.1343.629268', 'HIRE_DATE': '1987-08-27', 'JOB_ID': 'SA_REP', 'SALARY': 7400, 'COMMISSION_PCT': 0.15, 'MANAGER_ID': 148, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 172, 'FIRST_NAME': 'Elizabeth', 'LAST_NAME': 'Bates', 'EMAIL': 'EBATES', 'PHONE_NUMBER': '011.44.1343.529268', 'HIRE_DATE': '1987-08-28', 'JOB_ID': 'SA_REP', 'SALARY': 7300, 'COMMISSION_PCT': 0.15, 'MANAGER_ID': 148, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 173, 'FIRST_NAME': 'Sundita', 'LAST_NAME': 'Kumar', 'EMAIL': 'SKUMAR', 'PHONE_NUMBER': '011.44.1343.329268', 'HIRE_DATE': '1987-08-29', 'JOB_ID': 'SA_REP', 'SALARY': 6100, 'COMMISSION_PCT': 0.1, 'MANAGER_ID': 148, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 174, 'FIRST_NAME': 'Ellen', 'LAST_NAME': 'Abel', 'EMAIL': 'EABEL', 'PHONE_NUMBER': '011.44.1644.429267', 'HIRE_DATE': '1987-08-30', 'JOB_ID': 'SA_REP', 'SALARY': 11000, 'COMMISSION_PCT': 0.3, 'MANAGER_ID': 149, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 175, 'FIRST_NAME': 'Alyssa', 'LAST_NAME': 'Hutton', 'EMAIL': 'AHUTTON', 'PHONE_NUMBER': '011.44.1644.429266', 'HIRE_DATE': '1987-08-31', 'JOB_ID': 'SA_REP', 'SALARY': 8800, 'COMMISSION_PCT': 0.25, 'MANAGER_ID': 149, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 176, 'FIRST_NAME': 'Jonathon', 'LAST_NAME': 'Taylor', 'EMAIL': 'JTAYLOR', 'PHONE_NUMBER': '011.44.1644.429265', 'HIRE_DATE': '1987-09-01', 'JOB_ID': 'SA_REP', 'SALARY': 8600, 'COMMISSION_PCT': 0.2, 'MANAGER_ID': 149, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 177, 'FIRST_NAME': 'Jack', 'LAST_NAME': 'Livingston', 'EMAIL': 'JLIVINGS', 'PHONE_NUMBER': '011.44.1644.429264', 'HIRE_DATE': '1987-09-02', 'JOB_ID': 'SA_REP', 'SALARY': 8400, 'COMMISSION_PCT': 0.2, 'MANAGER_ID': 149, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 178, 'FIRST_NAME': 'Kimberely', 'LAST_NAME': 'Grant', 'EMAIL': 'KGRANT', 'PHONE_NUMBER': '011.44.1644.429263', 'HIRE_DATE': '1987-09-03', 'JOB_ID': 'SA_REP', 'SALARY': 7000, 'COMMISSION_PCT': 0.15, 'MANAGER_ID': 149, 'DEPARTMENT_ID': 0}, {'EMPLOYEE_ID': 179, 'FIRST_NAME': 'Charles', 'LAST_NAME': 'Johnson', 'EMAIL': 'CJOHNSON', 'PHONE_NUMBER': '011.44.1644.429262', 'HIRE_DATE': '1987-09-04', 'JOB_ID': 'SA_REP', 'SALARY': 6200, 'COMMISSION_PCT': 0.1, 'MANAGER_ID': 149, 'DEPARTMENT_ID': 80}, {'EMPLOYEE_ID': 180, 'FIRST_NAME': 'Winston', 'LAST_NAME': 'Taylor', 'EMAIL': 'WTAYLOR', 'PHONE_NUMBER': '650.507.9876', 'HIRE_DATE': '1987-09-05', 'JOB_ID': 'SH_CLERK', 'SALARY': 3200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 181, 'FIRST_NAME': 'Jean', 'LAST_NAME': 'Fleaur', 'EMAIL': 'JFLEAUR', 'PHONE_NUMBER': '650.507.9877', 'HIRE_DATE': '1987-09-06', 'JOB_ID': 'SH_CLERK', 'SALARY': 3100, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 182, 'FIRST_NAME': 'Martha', 'LAST_NAME': 'Sullivan', 'EMAIL': 'MSULLIVA', 'PHONE_NUMBER': '650.507.9878', 'HIRE_DATE': '1987-09-07', 'JOB_ID': 'SH_CLERK', 'SALARY': 2500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 183, 'FIRST_NAME': 'Girard', 'LAST_NAME': 'Geoni', 'EMAIL': 'GGEONI', 'PHONE_NUMBER': '650.507.9879', 'HIRE_DATE': '1987-09-08', 'JOB_ID': 'SH_CLERK', 'SALARY': 2800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 120, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 184, 'FIRST_NAME': 'Nandita', 'LAST_NAME': 'Sarchand', 'EMAIL': 'NSARCHAN', 'PHONE_NUMBER': '650.509.1876', 'HIRE_DATE': '1987-09-09', 'JOB_ID': 'SH_CLERK', 'SALARY': 4200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 185, 'FIRST_NAME': 'Alexis', 'LAST_NAME': 'Bull', 'EMAIL': 'ABULL', 'PHONE_NUMBER': '650.509.2876', 'HIRE_DATE': '1987-09-10', 'JOB_ID': 'SH_CLERK', 'SALARY': 4100, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 186, 'FIRST_NAME': 'Julia', 'LAST_NAME': 'Dellinger', 'EMAIL': 'JDELLING', 'PHONE_NUMBER': '650.509.3876', 'HIRE_DATE': '1987-09-11', 'JOB_ID': 'SH_CLERK', 'SALARY': 3400, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 187, 'FIRST_NAME': 'Anthony', 'LAST_NAME': 'Cabrio', 'EMAIL': 'ACABRIO', 'PHONE_NUMBER': '650.509.4876', 'HIRE_DATE': '1987-09-12', 'JOB_ID': 'SH_CLERK', 'SALARY': 3000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 121, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 188, 'FIRST_NAME': 'Kelly', 'LAST_NAME': 'Chung', 'EMAIL': 'KCHUNG', 'PHONE_NUMBER': '650.505.1876', 'HIRE_DATE': '1987-09-13', 'JOB_ID': 'SH_CLERK', 'SALARY': 3800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 189, 'FIRST_NAME': 'Jennifer', 'LAST_NAME': 'Dilly', 'EMAIL': 'JDILLY', 'PHONE_NUMBER': '650.505.2876', 'HIRE_DATE': '1987-09-14', 'JOB_ID': 'SH_CLERK', 'SALARY': 3600, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 190, 'FIRST_NAME': 'Timothy', 'LAST_NAME': 'Gates', 'EMAIL': 'TGATES', 'PHONE_NUMBER': '650.505.3876', 'HIRE_DATE': '1987-09-15', 'JOB_ID': 'SH_CLERK', 'SALARY': 2900, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 191, 'FIRST_NAME': 'Randall', 'LAST_NAME': 'Perkins', 'EMAIL': 'RPERKINS', 'PHONE_NUMBER': '650.505.4876', 'HIRE_DATE': '1987-09-16', 'JOB_ID': 'SH_CLERK', 'SALARY': 2500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 122, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 192, 'FIRST_NAME': 'Sarah', 'LAST_NAME': 'Bell', 'EMAIL': 'SBELL', 'PHONE_NUMBER': '650.501.1876', 'HIRE_DATE': '1987-09-17', 'JOB_ID': 'SH_CLERK', 'SALARY': 4000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 193, 'FIRST_NAME': 'Britney', 'LAST_NAME': 'Everett', 'EMAIL': 'BEVERETT', 'PHONE_NUMBER': '650.501.2876', 'HIRE_DATE': '1987-09-18', 'JOB_ID': 'SH_CLERK', 'SALARY': 3900, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 194, 'FIRST_NAME': 'Samuel', 'LAST_NAME': 'McCain', 'EMAIL': 'SMCCAIN', 'PHONE_NUMBER': '650.501.3876', 'HIRE_DATE': '1987-09-19', 'JOB_ID': 'SH_CLERK', 'SALARY': 3200, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 195, 'FIRST_NAME': 'Vance', 'LAST_NAME': 'Jones', 'EMAIL': 'VJONES', 'PHONE_NUMBER': '650.501.4876', 'HIRE_DATE': '1987-09-20', 'JOB_ID': 'SH_CLERK', 'SALARY': 2800, 'COMMISSION_PCT': 0, 'MANAGER_ID': 123, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 196, 'FIRST_NAME': 'Alana', 'LAST_NAME': 'Walsh', 'EMAIL': 'AWALSH', 'PHONE_NUMBER': '650.507.9811', 'HIRE_DATE': '1987-09-21', 'JOB_ID': 'SH_CLERK', 'SALARY': 3100, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 197, 'FIRST_NAME': 'Kevin', 'LAST_NAME': 'Feeney', 'EMAIL': 'KFEENEY', 'PHONE_NUMBER': '650.507.9822', 'HIRE_DATE': '1987-09-22', 'JOB_ID': 'SH_CLERK', 'SALARY': 3000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 198, 'FIRST_NAME': 'Donald', 'LAST_NAME': 'OConnell', 'EMAIL': 'DOCONNEL', 'PHONE_NUMBER': '650.507.9833', 'HIRE_DATE': '1987-09-23', 'JOB_ID': 'SH_CLERK', 'SALARY': 2600, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 199, 'FIRST_NAME': 'Douglas', 'LAST_NAME': 'Grant', 'EMAIL': 'DGRANT', 'PHONE_NUMBER': '650.507.9844', 'HIRE_DATE': '1987-09-24', 'JOB_ID': 'SH_CLERK', 'SALARY': 2600, 'COMMISSION_PCT': 0, 'MANAGER_ID': 124, 'DEPARTMENT_ID': 50}, {'EMPLOYEE_ID': 200, 'FIRST_NAME': 'Jennifer', 'LAST_NAME': 'Whalen', 'EMAIL': 'JWHALEN', 'PHONE_NUMBER': '515.123.4444', 'HIRE_DATE': '1987-09-25', 'JOB_ID': 'AD_ASST', 'SALARY': 4400, 'COMMISSION_PCT': 0, 'MANAGER_ID': 101, 'DEPARTMENT_ID': 10}, {'EMPLOYEE_ID': 201, 'FIRST_NAME': 'Michael', 'LAST_NAME': 'Hartstein', 'EMAIL': 'MHARTSTE', 'PHONE_NUMBER': '515.123.5555', 'HIRE_DATE': '1987-09-26', 'JOB_ID': 'MK_MAN', 'SALARY': 13000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 100, 'DEPARTMENT_ID': 20}, {'EMPLOYEE_ID': 202, 'FIRST_NAME': 'Pat', 'LAST_NAME': 'Fay', 'EMAIL': 'PFAY', 'PHONE_NUMBER': '603.123.6666', 'HIRE_DATE': '1987-09-27', 'JOB_ID': 'MK_REP', 'SALARY': 6000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 201, 'DEPARTMENT_ID': 20}, {'EMPLOYEE_ID': 203, 'FIRST_NAME': 'Susan', 'LAST_NAME': 'Mavris', 'EMAIL': 'SMAVRIS', 'PHONE_NUMBER': '515.123.7777', 'HIRE_DATE': '1987-09-28', 'JOB_ID': 'HR_REP', 'SALARY': 6500, 'COMMISSION_PCT': 0, 'MANAGER_ID': 101, 'DEPARTMENT_ID': 40}, {'EMPLOYEE_ID': 204, 'FIRST_NAME': 'Hermann', 'LAST_NAME': 'Baer', 'EMAIL': 'HBAER', 'PHONE_NUMBER': '515.123.8888', 'HIRE_DATE': '1987-09-29', 'JOB_ID': 'PR_REP', 'SALARY': 10000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 101, 'DEPARTMENT_ID': 70}, {'EMPLOYEE_ID': 205, 'FIRST_NAME': 'Shelley', 'LAST_NAME': 'Higgins', 'EMAIL': 'SHIGGINS', 'PHONE_NUMBER': '515.123.8080', 'HIRE_DATE': '1987-09-30', 'JOB_ID': 'AC_MGR', 'SALARY': 12000, 'COMMISSION_PCT': 0, 'MANAGER_ID': 101, 'DEPARTMENT_ID': 110}, {'EMPLOYEE_ID': 206, 'FIRST_NAME': 'William', 'LAST_NAME': 'Gietz', 'EMAIL': 'WGIETZ', 'PHONE_NUMBER': '515.123.8181', 'HIRE_DATE': '1987-10-01', 'JOB_ID': 'AC_ACCOUNT', 'SALARY': 8300, 'COMMISSION_PCT': 0, 'MANAGER_ID': 205, 'DEPARTMENT_ID': 110}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]List the names of employees and sort in ascending order of age.[/QUESTION] [SQL]SELECT name FROM employee ORDER BY age[/SQL]
[QUESTION]List the names of employees and sort in ascending order of age.[/QUESTION] [SQL]SELECT name FROM employee ORDER BY age[/SQL]
[QUESTION]List the names of employees and sort in ascending order of age.[/QUESTION] [SQL]SELECT name FROM employee ORDER BY age[/SQL]
[QUESTION]List the names of employees and sort in ascending order of age.[/QUESTION] [SQL]SELECT name FROM employee ORDER BY age[/SQL]
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
how many states have major rivers
SELECT COUNT ( traverse ) FROM river WHERE LENGTH > 750;
[{'COUNT ( traverse )': 0}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]how many rivers are in the state with the largest population[/QUESTION] [SQL]SELECT COUNT ( t2.river_name ) FROM river AS t2 JOIN state AS t1 ON t1.state_name = t2.traverse WHERE t1.state_name = ( SELECT state_name FROM state WHERE population = ( SELECT MAX ( population ) FROM state ) );[/SQL]
[QUESTION]how many rivers are in the state with the largest population[/QUESTION] [SQL]SELECT COUNT ( t2.river_name ) FROM river AS t2 JOIN state AS t1 ON t1.state_name = t2.traverse WHERE t1.state_name = ( SELECT state_name FROM state WHERE population = ( SELECT MAX ( population ) FROM state ) );[/SQL]
[QUESTION]how many rivers are in the state with the largest population[/QUESTION] [SQL]SELECT COUNT ( t2.river_name ) FROM river AS t2 JOIN state AS t1 ON t1.state_name = t2.traverse WHERE t1.state_name = ( SELECT state_name FROM state WHERE population = ( SELECT MAX ( population ) FROM state ) );[/SQL]
[QUESTION]how many rivers are in the state with the largest population[/QUESTION] [SQL]SELECT COUNT ( t2.river_name ) FROM river AS t2 JOIN state AS t1 ON t1.state_name = t2.traverse WHERE t1.state_name = ( SELECT state_name FROM state WHERE population = ( SELECT MAX ( population ) FROM state ) );[/SQL]
wine_1
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") )
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) /* 2 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No */ CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) /* 2 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red */ CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") ) /* 2 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now */
What are the average price and score of wines grouped by appelation?
SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation
[{'avg(Price)': 29.142857142857142, 'avg(Score)': 88.14285714285714, 'Appelation': 'Alexander Valley'}, {'avg(Price)': 31.5, 'avg(Score)': 90.0, 'Appelation': 'Amador County'}, {'avg(Price)': 18.0, 'avg(Score)': 87.0, 'Appelation': 'Amador-Mendocino-Sonoma Counties'}, {'avg(Price)': 53.333333333333336, 'avg(Score)': 92.33333333333333, 'Appelation': 'Anderson Valley'}, {'avg(Price)': 31.0, 'avg(Score)': 92.0, 'Appelation': 'Arroyo Grande Valley'}, {'avg(Price)': 125.0, 'avg(Score)': 88.0, 'Appelation': 'Atlas Peak'}, {'avg(Price)': 46.5, 'avg(Score)': 91.0, 'Appelation': 'Bennett Valley'}, {'avg(Price)': 20.0, 'avg(Score)': 84.0, 'Appelation': 'Calaveras County'}, {'avg(Price)': 39.48275862068966, 'avg(Score)': 87.82758620689656, 'Appelation': 'California'}, {'avg(Price)': 36.166666666666664, 'avg(Score)': 90.0, 'Appelation': 'Carneros'}, {'avg(Price)': 13.0, 'avg(Score)': 87.0, 'Appelation': 'Central Coast'}, {'avg(Price)': 52.5, 'avg(Score)': 92.0, 'Appelation': 'Chalk Hill'}, {'avg(Price)': 25.0, 'avg(Score)': 92.0, 'Appelation': 'Chalone'}, {'avg(Price)': 27.8, 'avg(Score)': 87.2, 'Appelation': 'Contra Costa County'}, {'avg(Price)': 27.653846153846153, 'avg(Score)': 89.3076923076923, 'Appelation': 'Dry Creek Valley'}, {'avg(Price)': 29.5, 'avg(Score)': 89.0, 'Appelation': 'Edna Valley'}, {'avg(Price)': 25.0, 'avg(Score)': 78.0, 'Appelation': 'Fiddletown'}, {'avg(Price)': 40.0, 'avg(Score)': 91.0, 'Appelation': 'Green Valley of Russian River Valley'}, {'avg(Price)': 20.0, 'avg(Score)': 87.0, 'Appelation': 'Guenoc Valley'}, {'avg(Price)': 21.0, 'avg(Score)': 88.0, 'Appelation': 'Happy Canyon of Santa Barbara'}, {'avg(Price)': 29.0, 'avg(Score)': 93.0, 'Appelation': 'Howell Mountain'}, {'avg(Price)': 37.5, 'avg(Score)': 89.5, 'Appelation': 'Knights Valley'}, {'avg(Price)': 26.0, 'avg(Score)': 87.0, 'Appelation': 'Lake County'}, {'avg(Price)': 40.0, 'avg(Score)': 89.0, 'Appelation': 'Livermore Valley'}, {'avg(Price)': 21.5, 'avg(Score)': 87.5, 'Appelation': 'Lodi'}, {'avg(Price)': 15.333333333333334, 'avg(Score)': 86.33333333333333, 'Appelation': 'Mendocino County'}, {'avg(Price)': 22.5, 'avg(Score)': 89.0, 'Appelation': 'Monterey County'}, {'avg(Price)': 38.333333333333336, 'avg(Score)': 90.66666666666667, 'Appelation': 'Mount Harlan'}, {'avg(Price)': 53.333333333333336, 'avg(Score)': 90.66666666666667, 'Appelation': 'Mount Vedeer'}, {'avg(Price)': 59.135416666666664, 'avg(Score)': 90.47916666666667, 'Appelation': 'Napa Valley'}, {'avg(Price)': 18.0, 'avg(Score)': 86.0, 'Appelation': 'Napa-Sonoma counties'}, {'avg(Price)': 12.0, 'avg(Score)': 85.0, 'Appelation': 'North Coast'}, {'avg(Price)': 95.0, 'avg(Score)': 90.5, 'Appelation': 'Oakville'}, {'avg(Price)': 32.285714285714285, 'avg(Score)': 88.42857142857143, 'Appelation': 'Paso Robles'}, {'avg(Price)': 49.0, 'avg(Score)': 90.5, 'Appelation': 'Red Hills Lake County'}, {'avg(Price)': 38.0, 'avg(Score)': 90.0, 'Appelation': 'Rockpile'}, {'avg(Price)': 49.60377358490566, 'avg(Score)': 91.79245283018868, 'Appelation': 'Russian River Valley'}, {'avg(Price)': 45.714285714285715, 'avg(Score)': 89.42857142857143, 'Appelation': 'Rutherford'}, {'avg(Price)': 31.5, 'avg(Score)': 89.5, 'Appelation': 'San Luis Obispo County'}, {'avg(Price)': 28.0, 'avg(Score)': 89.41666666666667, 'Appelation': 'Santa Barbara County'}, {'avg(Price)': 40.0, 'avg(Score)': 93.0, 'Appelation': 'Santa Cruz Mountains'}, {'avg(Price)': 46.285714285714285, 'avg(Score)': 91.23809523809524, 'Appelation': 'Santa Lucia Highlands'}, {'avg(Price)': 41.5, 'avg(Score)': 91.25, 'Appelation': 'Santa Maria Valley'}, {'avg(Price)': 29.333333333333332, 'avg(Score)': 88.73333333333333, 'Appelation': 'Santa Ynez Valley'}, {'avg(Price)': 25.0, 'avg(Score)': 86.0, 'Appelation': 'Shenandoah Valley'}, {'avg(Price)': 10.0, 'avg(Score)': 82.0, 'Appelation': 'Sierra Foothills'}, {'avg(Price)': 35.0, 'avg(Score)': 89.0, 'Appelation': 'Solano County'}, {'avg(Price)': 49.02564102564103, 'avg(Score)': 90.82051282051282, 'Appelation': 'Sonoma Coast'}, {'avg(Price)': 43.48148148148148, 'avg(Score)': 90.4074074074074, 'Appelation': 'Sonoma County'}, {'avg(Price)': 42.68421052631579, 'avg(Score)': 89.78947368421052, 'Appelation': 'Sonoma Valley'}, {'avg(Price)': 15.0, 'avg(Score)': 86.0, 'Appelation': 'Sonoma-Lake Counties'}, {'avg(Price)': 70.66666666666667, 'avg(Score)': 89.33333333333333, 'Appelation': 'Spring Mountain District'}, {'avg(Price)': 77.5, 'avg(Score)': 91.5, 'Appelation': 'St. Helena'}, {'avg(Price)': 60.35294117647059, 'avg(Score)': 90.88235294117646, 'Appelation': 'Sta. Rita Hills'}, {'avg(Price)': 84.5, 'avg(Score)': 92.25, 'Appelation': 'Stags Leap District'}, {'avg(Price)': 25.0, 'avg(Score)': 91.0, 'Appelation': 'Yolo County'}, {'avg(Price)': 90.0, 'avg(Score)': 90.0, 'Appelation': 'Yountville'}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
store_1
CREATE TABLE albums ( id INTEGER, title VARCHAR(160) NOT NULL, artist_id INTEGER NOT NULL, PRIMARY KEY (id), FOREIGN KEY(artist_id) REFERENCES artists (id) ) CREATE TABLE artists ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) CREATE TABLE customers ( id INTEGER, first_name VARCHAR(40) NOT NULL, last_name VARCHAR(20) NOT NULL, company VARCHAR(80), address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), phone VARCHAR(24), fax VARCHAR(24), email VARCHAR(60) NOT NULL, support_rep_id INTEGER, PRIMARY KEY (id), FOREIGN KEY(support_rep_id) REFERENCES employees (id) ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20) NOT NULL, first_name VARCHAR(20) NOT NULL, title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, hire_date TIMESTAMP, address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), phone VARCHAR(24), fax VARCHAR(24), email VARCHAR(60), PRIMARY KEY (id), FOREIGN KEY(reports_to) REFERENCES employees (id) ) CREATE TABLE genres ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) CREATE TABLE invoice_lines ( id INTEGER, invoice_id INTEGER NOT NULL, track_id INTEGER NOT NULL, unit_price NUMERIC(10, 2) NOT NULL, quantity INTEGER NOT NULL, PRIMARY KEY (id), FOREIGN KEY(invoice_id) REFERENCES invoices (id), FOREIGN KEY(track_id) REFERENCES tracks (id) ) CREATE TABLE invoices ( id INTEGER, customer_id INTEGER NOT NULL, invoice_date TIMESTAMP NOT NULL, billing_address VARCHAR(70), billing_city VARCHAR(40), billing_state VARCHAR(40), billing_country VARCHAR(40), billing_postal_code VARCHAR(10), total NUMERIC(10, 2) NOT NULL, PRIMARY KEY (id), FOREIGN KEY(customer_id) REFERENCES customers (id) ) CREATE TABLE media_types ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) CREATE TABLE playlist_tracks ( playlist_id INTEGER NOT NULL, track_id INTEGER NOT NULL, CONSTRAINT "PK_PlaylistTrack" PRIMARY KEY (playlist_id, track_id), FOREIGN KEY(playlist_id) REFERENCES playlists (id), FOREIGN KEY(track_id) REFERENCES tracks (id) ) CREATE TABLE playlists ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) CREATE TABLE tracks ( id INTEGER, name VARCHAR(200) NOT NULL, album_id INTEGER, media_type_id INTEGER NOT NULL, genre_id INTEGER, composer VARCHAR(220), milliseconds INTEGER NOT NULL, bytes INTEGER, unit_price NUMERIC(10, 2) NOT NULL, PRIMARY KEY (id), FOREIGN KEY(album_id) REFERENCES albums (id), FOREIGN KEY(genre_id) REFERENCES genres (id), FOREIGN KEY(media_type_id) REFERENCES media_types (id) )
CREATE TABLE albums ( id INTEGER, title VARCHAR(160) NOT NULL, artist_id INTEGER NOT NULL, PRIMARY KEY (id), FOREIGN KEY(artist_id) REFERENCES artists (id) ) /* 2 rows from albums table: id title artist_id 1 For Those About To Rock We Salute You 1 2 Balls to the Wall 2 */ CREATE TABLE artists ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) /* 2 rows from artists table: id name 1 AC/DC 2 Accept */ CREATE TABLE customers ( id INTEGER, first_name VARCHAR(40) NOT NULL, last_name VARCHAR(20) NOT NULL, company VARCHAR(80), address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), phone VARCHAR(24), fax VARCHAR(24), email VARCHAR(60) NOT NULL, support_rep_id INTEGER, PRIMARY KEY (id), FOREIGN KEY(support_rep_id) REFERENCES employees (id) ) /* 2 rows from customers table: id first_name last_name company address city state country postal_code phone fax email support_rep_id 1 Luís Gonçalves Embraer - Empresa Brasileira de Aeronáutica S.A. Av. Brigadeiro Faria Lima, 2170 São José dos Campos SP Brazil 12227-000 +55 (12) 3923-5555 +55 (12) 3923-5566 [email protected] 3 2 Leonie Köhler None Theodor-Heuss-Straße 34 Stuttgart None Germany 70174 +49 0711 2842222 None [email protected] 5 */ CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20) NOT NULL, first_name VARCHAR(20) NOT NULL, title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, hire_date TIMESTAMP, address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), phone VARCHAR(24), fax VARCHAR(24), email VARCHAR(60), PRIMARY KEY (id), FOREIGN KEY(reports_to) REFERENCES employees (id) ) /* 2 rows from employees table: id last_name first_name title reports_to birth_date hire_date address city state country postal_code phone fax email 1 Adams Andrew General Manager None 1962-02-18 00:00:00 2002-08-14 00:00:00 11120 Jasper Ave NW Edmonton AB Canada T5K 2N1 +1 (780) 428-9482 +1 (780) 428-3457 [email protected] 2 Edwards Nancy Sales Manager 1 1958-12-08 00:00:00 2002-05-01 00:00:00 825 8 Ave SW Calgary AB Canada T2P 2T3 +1 (403) 262-3443 +1 (403) 262-3322 [email protected] */ CREATE TABLE genres ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) /* 2 rows from genres table: id name 1 Rock 2 Jazz */ CREATE TABLE invoice_lines ( id INTEGER, invoice_id INTEGER NOT NULL, track_id INTEGER NOT NULL, unit_price NUMERIC(10, 2) NOT NULL, quantity INTEGER NOT NULL, PRIMARY KEY (id), FOREIGN KEY(invoice_id) REFERENCES invoices (id), FOREIGN KEY(track_id) REFERENCES tracks (id) ) /* 2 rows from invoice_lines table: id invoice_id track_id unit_price quantity 1 1 2 0.99 1 2 1 4 0.99 1 */ CREATE TABLE invoices ( id INTEGER, customer_id INTEGER NOT NULL, invoice_date TIMESTAMP NOT NULL, billing_address VARCHAR(70), billing_city VARCHAR(40), billing_state VARCHAR(40), billing_country VARCHAR(40), billing_postal_code VARCHAR(10), total NUMERIC(10, 2) NOT NULL, PRIMARY KEY (id), FOREIGN KEY(customer_id) REFERENCES customers (id) ) /* 2 rows from invoices table: id customer_id invoice_date billing_address billing_city billing_state billing_country billing_postal_code total 1 2 2007-01-01 00:00:00 Theodor-Heuss-Straße 34 Stuttgart None Germany 70174 1.98 2 4 2007-01-02 00:00:00 Ullevålsveien 14 Oslo None Norway 0171 3.96 */ CREATE TABLE media_types ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) /* 2 rows from media_types table: id name 1 MPEG audio file 2 Protected AAC audio file */ CREATE TABLE playlist_tracks ( playlist_id INTEGER NOT NULL, track_id INTEGER NOT NULL, CONSTRAINT "PK_PlaylistTrack" PRIMARY KEY (playlist_id, track_id), FOREIGN KEY(playlist_id) REFERENCES playlists (id), FOREIGN KEY(track_id) REFERENCES tracks (id) ) /* 2 rows from playlist_tracks table: playlist_id track_id 1 3402 1 3389 */ CREATE TABLE playlists ( id INTEGER, name VARCHAR(120), PRIMARY KEY (id) ) /* 2 rows from playlists table: id name 1 Music 2 Movies */ CREATE TABLE tracks ( id INTEGER, name VARCHAR(200) NOT NULL, album_id INTEGER, media_type_id INTEGER NOT NULL, genre_id INTEGER, composer VARCHAR(220), milliseconds INTEGER NOT NULL, bytes INTEGER, unit_price NUMERIC(10, 2) NOT NULL, PRIMARY KEY (id), FOREIGN KEY(album_id) REFERENCES albums (id), FOREIGN KEY(genre_id) REFERENCES genres (id), FOREIGN KEY(media_type_id) REFERENCES media_types (id) ) /* 2 rows from tracks table: id name album_id media_type_id genre_id composer milliseconds bytes unit_price 1 For Those About To Rock (We Salute You) 1 1 1 Angus Young, Malcolm Young, Brian Johnson 343719 11170334 0.99 2 Balls to the Wall 2 2 1 None 342562 5510424 0.99 */
What is the total amount of money spent by Lucas Mancini?
SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini";
[{'sum(T2.total)': 37.620000000000005}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
cre_Theme_park
CREATE TABLE "Features" ( "Feature_ID" INTEGER NOT NULL, "Feature_Details" VARCHAR(255), PRIMARY KEY ("Feature_ID") ) CREATE TABLE "Hotels" ( hotel_id INTEGER NOT NULL, star_rating_code CHAR(15) NOT NULL, pets_allowed_yn CHAR(1), price_range REAL, other_hotel_details VARCHAR(255), PRIMARY KEY (hotel_id), FOREIGN KEY(star_rating_code) REFERENCES "Ref_Hotel_Star_Ratings" (star_rating_code) ) CREATE TABLE "Locations" ( "Location_ID" INTEGER NOT NULL, "Location_Name" VARCHAR(255), "Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Location_ID") ) CREATE TABLE "Museums" ( "Museum_ID" INTEGER NOT NULL, "Museum_Details" VARCHAR(255), PRIMARY KEY ("Museum_ID"), FOREIGN KEY("Museum_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Photos" ( "Photo_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(255), "Description" VARCHAR(255), "Filename" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Photo_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Ref_Attraction_Types" ( "Attraction_Type_Code" CHAR(15) NOT NULL, "Attraction_Type_Description" VARCHAR(255), PRIMARY KEY ("Attraction_Type_Code"), UNIQUE ("Attraction_Type_Code") ) CREATE TABLE "Ref_Hotel_Star_Ratings" ( star_rating_code CHAR(15) NOT NULL, star_rating_description VARCHAR(80), PRIMARY KEY (star_rating_code), UNIQUE (star_rating_code) ) CREATE TABLE "Royal_Family" ( "Royal_Family_ID" INTEGER NOT NULL, "Royal_Family_Details" VARCHAR(255), PRIMARY KEY ("Royal_Family_ID"), FOREIGN KEY("Royal_Family_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Shops" ( "Shop_ID" INTEGER NOT NULL, "Shop_Details" VARCHAR(255), PRIMARY KEY ("Shop_ID"), FOREIGN KEY("Shop_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Staff" ( "Staff_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(40), "Other_Details" VARCHAR(255), PRIMARY KEY ("Staff_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Street_Markets" ( "Market_ID" INTEGER NOT NULL, "Market_Details" VARCHAR(255), PRIMARY KEY ("Market_ID"), FOREIGN KEY("Market_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Theme_Parks" ( "Theme_Park_ID" INTEGER NOT NULL, "Theme_Park_Details" VARCHAR(255), PRIMARY KEY ("Theme_Park_ID"), FOREIGN KEY("Theme_Park_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Tourist_Attraction_Features" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Feature_ID" INTEGER NOT NULL, PRIMARY KEY ("Tourist_Attraction_ID", "Feature_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Feature_ID") REFERENCES "Features" ("Feature_ID") ) CREATE TABLE "Tourist_Attractions" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Attraction_Type_Code" CHAR(15) NOT NULL, "Location_ID" INTEGER NOT NULL, "How_to_Get_There" VARCHAR(255), "Name" VARCHAR(255), "Description" VARCHAR(255), "Opening_Hours" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Tourist_Attraction_ID"), FOREIGN KEY("Location_ID") REFERENCES "Locations" ("Location_ID"), FOREIGN KEY("Attraction_Type_Code") REFERENCES "Ref_Attraction_Types" ("Attraction_Type_Code") ) CREATE TABLE "Visitors" ( "Tourist_ID" INTEGER NOT NULL, "Tourist_Details" VARCHAR(255), PRIMARY KEY ("Tourist_ID"), UNIQUE ("Tourist_ID") ) CREATE TABLE "Visits" ( "Visit_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Tourist_ID" INTEGER NOT NULL, "Visit_Date" DATETIME NOT NULL, "Visit_Details" VARCHAR(40) NOT NULL, PRIMARY KEY ("Visit_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Tourist_ID") REFERENCES "Visitors" ("Tourist_ID") )
CREATE TABLE "Features" ( "Feature_ID" INTEGER NOT NULL, "Feature_Details" VARCHAR(255), PRIMARY KEY ("Feature_ID") ) /* 2 rows from Features table: Feature_ID Feature_Details 523 cafe 528 park */ CREATE TABLE "Hotels" ( hotel_id INTEGER NOT NULL, star_rating_code CHAR(15) NOT NULL, pets_allowed_yn CHAR(1), price_range REAL, other_hotel_details VARCHAR(255), PRIMARY KEY (hotel_id), FOREIGN KEY(star_rating_code) REFERENCES "Ref_Hotel_Star_Ratings" (star_rating_code) ) /* 2 rows from Hotels table: hotel_id star_rating_code pets_allowed_yn price_range other_hotel_details 123 5 1 2914989.571 None 144 4 None */ CREATE TABLE "Locations" ( "Location_ID" INTEGER NOT NULL, "Location_Name" VARCHAR(255), "Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Location_ID") ) /* 2 rows from Locations table: Location_ID Location_Name Address Other_Details 333 Astro Orbiter 660 Shea Crescent None 368 African Animals 254 Ottilie Junction None */ CREATE TABLE "Museums" ( "Museum_ID" INTEGER NOT NULL, "Museum_Details" VARCHAR(255), PRIMARY KEY ("Museum_ID"), FOREIGN KEY("Museum_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Museums table: Museum_ID Museum_Details 2113 Yale Center for British Art 2701 The Metropolitan Museum of Art */ CREATE TABLE "Photos" ( "Photo_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(255), "Description" VARCHAR(255), "Filename" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Photo_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Photos table: Photo_ID Tourist_Attraction_ID Name Description Filename Other_Details 211 8449 game1 None 702 None 280 7067 game2 None 762 None */ CREATE TABLE "Ref_Attraction_Types" ( "Attraction_Type_Code" CHAR(15) NOT NULL, "Attraction_Type_Description" VARCHAR(255), PRIMARY KEY ("Attraction_Type_Code"), UNIQUE ("Attraction_Type_Code") ) /* 2 rows from Ref_Attraction_Types table: Attraction_Type_Code Attraction_Type_Description 2 park 3 garden */ CREATE TABLE "Ref_Hotel_Star_Ratings" ( star_rating_code CHAR(15) NOT NULL, star_rating_description VARCHAR(80), PRIMARY KEY (star_rating_code), UNIQUE (star_rating_code) ) /* 2 rows from Ref_Hotel_Star_Ratings table: star_rating_code star_rating_description 1 star 2 star */ CREATE TABLE "Royal_Family" ( "Royal_Family_ID" INTEGER NOT NULL, "Royal_Family_Details" VARCHAR(255), PRIMARY KEY ("Royal_Family_ID"), FOREIGN KEY("Royal_Family_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Royal_Family table: Royal_Family_ID Royal_Family_Details 9561 None 9919 None */ CREATE TABLE "Shops" ( "Shop_ID" INTEGER NOT NULL, "Shop_Details" VARCHAR(255), PRIMARY KEY ("Shop_ID"), FOREIGN KEY("Shop_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Shops table: Shop_ID Shop_Details 8429 soup 8449 coffee */ CREATE TABLE "Staff" ( "Staff_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(40), "Other_Details" VARCHAR(255), PRIMARY KEY ("Staff_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Staff table: Staff_ID Tourist_Attraction_ID Name Other_Details 170 6476 Whitney None 219 6476 Kaela None */ CREATE TABLE "Street_Markets" ( "Market_ID" INTEGER NOT NULL, "Market_Details" VARCHAR(255), PRIMARY KEY ("Market_ID"), FOREIGN KEY("Market_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Street_Markets table: Market_ID Market_Details 6852 Broadway 7067 Fish Farm Market */ CREATE TABLE "Theme_Parks" ( "Theme_Park_ID" INTEGER NOT NULL, "Theme_Park_Details" VARCHAR(255), PRIMARY KEY ("Theme_Park_ID"), FOREIGN KEY("Theme_Park_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Theme_Parks table: Theme_Park_ID Theme_Park_Details 5265 Disney 6476 Sea World */ CREATE TABLE "Tourist_Attraction_Features" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Feature_ID" INTEGER NOT NULL, PRIMARY KEY ("Tourist_Attraction_ID", "Feature_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Feature_ID") REFERENCES "Features" ("Feature_ID") ) /* 2 rows from Tourist_Attraction_Features table: Tourist_Attraction_ID Feature_ID 5076 528 5076 681 */ CREATE TABLE "Tourist_Attractions" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Attraction_Type_Code" CHAR(15) NOT NULL, "Location_ID" INTEGER NOT NULL, "How_to_Get_There" VARCHAR(255), "Name" VARCHAR(255), "Description" VARCHAR(255), "Opening_Hours" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Tourist_Attraction_ID"), FOREIGN KEY("Location_ID") REFERENCES "Locations" ("Location_ID"), FOREIGN KEY("Attraction_Type_Code") REFERENCES "Ref_Attraction_Types" ("Attraction_Type_Code") ) /* 2 rows from Tourist_Attractions table: Tourist_Attraction_ID Attraction_Type_Code Location_ID How_to_Get_There Name Description Opening_Hours Other_Details 2113 2 579 bus art museum None None None 2701 6 417 walk UK gallery None None None */ CREATE TABLE "Visitors" ( "Tourist_ID" INTEGER NOT NULL, "Tourist_Details" VARCHAR(255), PRIMARY KEY ("Tourist_ID"), UNIQUE ("Tourist_ID") ) /* 2 rows from Visitors table: Tourist_ID Tourist_Details 164 Toney 189 Graciela */ CREATE TABLE "Visits" ( "Visit_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Tourist_ID" INTEGER NOT NULL, "Visit_Date" DATETIME NOT NULL, "Visit_Details" VARCHAR(40) NOT NULL, PRIMARY KEY ("Visit_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Tourist_ID") REFERENCES "Visitors" ("Tourist_ID") ) /* 2 rows from Visits table: Visit_ID Tourist_Attraction_ID Tourist_ID Visit_Date Visit_Details 183 6653 377 2004-08-21 03:06:14 268 5076 204 2013-08-06 05:35:51 */
Return the detail of the location named "UK Gallery".
SELECT Other_Details FROM LOCATIONS WHERE Location_Name = "UK Gallery"
[{'Other_Details': None}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
cre_Theme_park
CREATE TABLE "Features" ( "Feature_ID" INTEGER NOT NULL, "Feature_Details" VARCHAR(255), PRIMARY KEY ("Feature_ID") ) CREATE TABLE "Hotels" ( hotel_id INTEGER NOT NULL, star_rating_code CHAR(15) NOT NULL, pets_allowed_yn CHAR(1), price_range REAL, other_hotel_details VARCHAR(255), PRIMARY KEY (hotel_id), FOREIGN KEY(star_rating_code) REFERENCES "Ref_Hotel_Star_Ratings" (star_rating_code) ) CREATE TABLE "Locations" ( "Location_ID" INTEGER NOT NULL, "Location_Name" VARCHAR(255), "Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Location_ID") ) CREATE TABLE "Museums" ( "Museum_ID" INTEGER NOT NULL, "Museum_Details" VARCHAR(255), PRIMARY KEY ("Museum_ID"), FOREIGN KEY("Museum_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Photos" ( "Photo_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(255), "Description" VARCHAR(255), "Filename" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Photo_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Ref_Attraction_Types" ( "Attraction_Type_Code" CHAR(15) NOT NULL, "Attraction_Type_Description" VARCHAR(255), PRIMARY KEY ("Attraction_Type_Code"), UNIQUE ("Attraction_Type_Code") ) CREATE TABLE "Ref_Hotel_Star_Ratings" ( star_rating_code CHAR(15) NOT NULL, star_rating_description VARCHAR(80), PRIMARY KEY (star_rating_code), UNIQUE (star_rating_code) ) CREATE TABLE "Royal_Family" ( "Royal_Family_ID" INTEGER NOT NULL, "Royal_Family_Details" VARCHAR(255), PRIMARY KEY ("Royal_Family_ID"), FOREIGN KEY("Royal_Family_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Shops" ( "Shop_ID" INTEGER NOT NULL, "Shop_Details" VARCHAR(255), PRIMARY KEY ("Shop_ID"), FOREIGN KEY("Shop_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Staff" ( "Staff_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(40), "Other_Details" VARCHAR(255), PRIMARY KEY ("Staff_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Street_Markets" ( "Market_ID" INTEGER NOT NULL, "Market_Details" VARCHAR(255), PRIMARY KEY ("Market_ID"), FOREIGN KEY("Market_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Theme_Parks" ( "Theme_Park_ID" INTEGER NOT NULL, "Theme_Park_Details" VARCHAR(255), PRIMARY KEY ("Theme_Park_ID"), FOREIGN KEY("Theme_Park_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) CREATE TABLE "Tourist_Attraction_Features" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Feature_ID" INTEGER NOT NULL, PRIMARY KEY ("Tourist_Attraction_ID", "Feature_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Feature_ID") REFERENCES "Features" ("Feature_ID") ) CREATE TABLE "Tourist_Attractions" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Attraction_Type_Code" CHAR(15) NOT NULL, "Location_ID" INTEGER NOT NULL, "How_to_Get_There" VARCHAR(255), "Name" VARCHAR(255), "Description" VARCHAR(255), "Opening_Hours" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Tourist_Attraction_ID"), FOREIGN KEY("Location_ID") REFERENCES "Locations" ("Location_ID"), FOREIGN KEY("Attraction_Type_Code") REFERENCES "Ref_Attraction_Types" ("Attraction_Type_Code") ) CREATE TABLE "Visitors" ( "Tourist_ID" INTEGER NOT NULL, "Tourist_Details" VARCHAR(255), PRIMARY KEY ("Tourist_ID"), UNIQUE ("Tourist_ID") ) CREATE TABLE "Visits" ( "Visit_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Tourist_ID" INTEGER NOT NULL, "Visit_Date" DATETIME NOT NULL, "Visit_Details" VARCHAR(40) NOT NULL, PRIMARY KEY ("Visit_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Tourist_ID") REFERENCES "Visitors" ("Tourist_ID") )
CREATE TABLE "Features" ( "Feature_ID" INTEGER NOT NULL, "Feature_Details" VARCHAR(255), PRIMARY KEY ("Feature_ID") ) /* 2 rows from Features table: Feature_ID Feature_Details 523 cafe 528 park */ CREATE TABLE "Hotels" ( hotel_id INTEGER NOT NULL, star_rating_code CHAR(15) NOT NULL, pets_allowed_yn CHAR(1), price_range REAL, other_hotel_details VARCHAR(255), PRIMARY KEY (hotel_id), FOREIGN KEY(star_rating_code) REFERENCES "Ref_Hotel_Star_Ratings" (star_rating_code) ) /* 2 rows from Hotels table: hotel_id star_rating_code pets_allowed_yn price_range other_hotel_details 123 5 1 2914989.571 None 144 4 None */ CREATE TABLE "Locations" ( "Location_ID" INTEGER NOT NULL, "Location_Name" VARCHAR(255), "Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Location_ID") ) /* 2 rows from Locations table: Location_ID Location_Name Address Other_Details 333 Astro Orbiter 660 Shea Crescent None 368 African Animals 254 Ottilie Junction None */ CREATE TABLE "Museums" ( "Museum_ID" INTEGER NOT NULL, "Museum_Details" VARCHAR(255), PRIMARY KEY ("Museum_ID"), FOREIGN KEY("Museum_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Museums table: Museum_ID Museum_Details 2113 Yale Center for British Art 2701 The Metropolitan Museum of Art */ CREATE TABLE "Photos" ( "Photo_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(255), "Description" VARCHAR(255), "Filename" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Photo_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Photos table: Photo_ID Tourist_Attraction_ID Name Description Filename Other_Details 211 8449 game1 None 702 None 280 7067 game2 None 762 None */ CREATE TABLE "Ref_Attraction_Types" ( "Attraction_Type_Code" CHAR(15) NOT NULL, "Attraction_Type_Description" VARCHAR(255), PRIMARY KEY ("Attraction_Type_Code"), UNIQUE ("Attraction_Type_Code") ) /* 2 rows from Ref_Attraction_Types table: Attraction_Type_Code Attraction_Type_Description 2 park 3 garden */ CREATE TABLE "Ref_Hotel_Star_Ratings" ( star_rating_code CHAR(15) NOT NULL, star_rating_description VARCHAR(80), PRIMARY KEY (star_rating_code), UNIQUE (star_rating_code) ) /* 2 rows from Ref_Hotel_Star_Ratings table: star_rating_code star_rating_description 1 star 2 star */ CREATE TABLE "Royal_Family" ( "Royal_Family_ID" INTEGER NOT NULL, "Royal_Family_Details" VARCHAR(255), PRIMARY KEY ("Royal_Family_ID"), FOREIGN KEY("Royal_Family_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Royal_Family table: Royal_Family_ID Royal_Family_Details 9561 None 9919 None */ CREATE TABLE "Shops" ( "Shop_ID" INTEGER NOT NULL, "Shop_Details" VARCHAR(255), PRIMARY KEY ("Shop_ID"), FOREIGN KEY("Shop_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Shops table: Shop_ID Shop_Details 8429 soup 8449 coffee */ CREATE TABLE "Staff" ( "Staff_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Name" VARCHAR(40), "Other_Details" VARCHAR(255), PRIMARY KEY ("Staff_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Staff table: Staff_ID Tourist_Attraction_ID Name Other_Details 170 6476 Whitney None 219 6476 Kaela None */ CREATE TABLE "Street_Markets" ( "Market_ID" INTEGER NOT NULL, "Market_Details" VARCHAR(255), PRIMARY KEY ("Market_ID"), FOREIGN KEY("Market_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Street_Markets table: Market_ID Market_Details 6852 Broadway 7067 Fish Farm Market */ CREATE TABLE "Theme_Parks" ( "Theme_Park_ID" INTEGER NOT NULL, "Theme_Park_Details" VARCHAR(255), PRIMARY KEY ("Theme_Park_ID"), FOREIGN KEY("Theme_Park_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID") ) /* 2 rows from Theme_Parks table: Theme_Park_ID Theme_Park_Details 5265 Disney 6476 Sea World */ CREATE TABLE "Tourist_Attraction_Features" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Feature_ID" INTEGER NOT NULL, PRIMARY KEY ("Tourist_Attraction_ID", "Feature_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Feature_ID") REFERENCES "Features" ("Feature_ID") ) /* 2 rows from Tourist_Attraction_Features table: Tourist_Attraction_ID Feature_ID 5076 528 5076 681 */ CREATE TABLE "Tourist_Attractions" ( "Tourist_Attraction_ID" INTEGER NOT NULL, "Attraction_Type_Code" CHAR(15) NOT NULL, "Location_ID" INTEGER NOT NULL, "How_to_Get_There" VARCHAR(255), "Name" VARCHAR(255), "Description" VARCHAR(255), "Opening_Hours" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Tourist_Attraction_ID"), FOREIGN KEY("Location_ID") REFERENCES "Locations" ("Location_ID"), FOREIGN KEY("Attraction_Type_Code") REFERENCES "Ref_Attraction_Types" ("Attraction_Type_Code") ) /* 2 rows from Tourist_Attractions table: Tourist_Attraction_ID Attraction_Type_Code Location_ID How_to_Get_There Name Description Opening_Hours Other_Details 2113 2 579 bus art museum None None None 2701 6 417 walk UK gallery None None None */ CREATE TABLE "Visitors" ( "Tourist_ID" INTEGER NOT NULL, "Tourist_Details" VARCHAR(255), PRIMARY KEY ("Tourist_ID"), UNIQUE ("Tourist_ID") ) /* 2 rows from Visitors table: Tourist_ID Tourist_Details 164 Toney 189 Graciela */ CREATE TABLE "Visits" ( "Visit_ID" INTEGER NOT NULL, "Tourist_Attraction_ID" INTEGER NOT NULL, "Tourist_ID" INTEGER NOT NULL, "Visit_Date" DATETIME NOT NULL, "Visit_Details" VARCHAR(40) NOT NULL, PRIMARY KEY ("Visit_ID"), FOREIGN KEY("Tourist_Attraction_ID") REFERENCES "Tourist_Attractions" ("Tourist_Attraction_ID"), FOREIGN KEY("Tourist_ID") REFERENCES "Visitors" ("Tourist_ID") ) /* 2 rows from Visits table: Visit_ID Tourist_Attraction_ID Tourist_ID Visit_Date Visit_Details 183 6653 377 2004-08-21 03:06:14 268 5076 204 2013-08-06 05:35:51 */
Show the names and details of all the staff members.
SELECT Name , Other_Details FROM Staff
[{'Name': 'Whitney', 'Other_Details': None}, {'Name': 'Kaela', 'Other_Details': None}, {'Name': 'Eunice', 'Other_Details': None}, {'Name': 'Kiarra', 'Other_Details': None}, {'Name': 'Phoebe', 'Other_Details': None}, {'Name': 'Vickie', 'Other_Details': None}, {'Name': 'Jannie', 'Other_Details': None}, {'Name': 'Lenore', 'Other_Details': None}, {'Name': 'Asia', 'Other_Details': None}, {'Name': 'Janet', 'Other_Details': None}, {'Name': 'Elouise', 'Other_Details': None}, {'Name': 'Gina', 'Other_Details': None}, {'Name': 'Beth', 'Other_Details': None}, {'Name': 'Ruthie', 'Other_Details': None}, {'Name': 'Aurore', 'Other_Details': None}, {'Name': 'Cortney', 'Other_Details': None}, {'Name': 'Astrid', 'Other_Details': None}, {'Name': 'Shemar', 'Other_Details': None}, {'Name': 'Trinity', 'Other_Details': None}, {'Name': 'Carmella', 'Other_Details': None}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]Find the id and name of the museum that has the most staff members?[/QUESTION] [SQL]SELECT museum_id , name FROM museum ORDER BY num_of_staff DESC LIMIT 1[/SQL]
[QUESTION]Find the id and name of the museum that has the most staff members?[/QUESTION] [SQL]SELECT museum_id , name FROM museum ORDER BY num_of_staff DESC LIMIT 1[/SQL]
[QUESTION]Find the id and name of the museum that has the most staff members?[/QUESTION] [SQL]SELECT museum_id , name FROM museum ORDER BY num_of_staff DESC LIMIT 1[/SQL]
[QUESTION]Find the id and name of the museum that has the most staff members?[/QUESTION] [SQL]SELECT museum_id , name FROM museum ORDER BY num_of_staff DESC LIMIT 1[/SQL]
dorm_1
CREATE TABLE "Dorm" ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE "Dorm_amenity" ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE "Has_amenity" ( dormid INTEGER, amenid INTEGER, FOREIGN KEY(amenid) REFERENCES "Dorm_amenity" (amenid), FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid) ) CREATE TABLE "Lives_in" ( stuid INTEGER, dormid INTEGER, room_number INTEGER, FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid), FOREIGN KEY(stuid) REFERENCES "Student" ("StuID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Dorm" ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) /* 2 rows from Dorm table: dormid dorm_name student_capacity gender 100 Smith Hall 85 X 110 Bud Jones Hall 116 M */ CREATE TABLE "Dorm_amenity" ( amenid INTEGER, amenity_name VARCHAR(25) ) /* 2 rows from Dorm_amenity table: amenid amenity_name 900 TV Lounge 901 Study Room */ CREATE TABLE "Has_amenity" ( dormid INTEGER, amenid INTEGER, FOREIGN KEY(amenid) REFERENCES "Dorm_amenity" (amenid), FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid) ) /* 2 rows from Has_amenity table: dormid amenid 109 900 109 901 */ CREATE TABLE "Lives_in" ( stuid INTEGER, dormid INTEGER, room_number INTEGER, FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid), FOREIGN KEY(stuid) REFERENCES "Student" ("StuID") ) /* 2 rows from Lives_in table: stuid dormid room_number 1001 109 105 1002 100 112 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
Find the average age of students living in each dorm and the name of dorm.
SELECT avg(T1.age) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name
[{'avg(T1.age)': 19.666666666666668, 'dorm_name': 'Anonymous Donor Hall'}, {'avg(T1.age)': 20.0, 'dorm_name': 'Bud Jones Hall'}, {'avg(T1.age)': 19.6, 'dorm_name': 'Dorm-plex 2000'}, {'avg(T1.age)': 19.77777777777778, 'dorm_name': 'Fawlty Towers'}, {'avg(T1.age)': 18.0, 'dorm_name': 'Grad Student Asylum'}, {'avg(T1.age)': 20.166666666666668, 'dorm_name': 'Smith Hall'}, {'avg(T1.age)': 18.0, 'dorm_name': 'University Hovels'}]
Hard
false
false
false
false
false
true
false
false
true
false
false
false
false
[QUESTION]Find the total number of hours have done for all students in each department.[/QUESTION] [SQL]SELECT sum(stu_hrs) , dept_code FROM student GROUP BY dept_code[/SQL]
[QUESTION]Find the total number of hours have done for all students in each department.[/QUESTION] [SQL]SELECT sum(stu_hrs) , dept_code FROM student GROUP BY dept_code[/SQL]
inn_1
CREATE TABLE "Reservations" ( "Code" INTEGER, "Room" TEXT, "CheckIn" TEXT, "CheckOut" TEXT, "Rate" REAL, "LastName" TEXT, "FirstName" TEXT, "Adults" INTEGER, "Kids" INTEGER, PRIMARY KEY ("Code"), FOREIGN KEY("Room") REFERENCES "Rooms" ("RoomId") ) CREATE TABLE "Rooms" ( "RoomId" TEXT, "roomName" TEXT, beds INTEGER, "bedType" TEXT, "maxOccupancy" INTEGER, "basePrice" INTEGER, decor TEXT, PRIMARY KEY ("RoomId") )
CREATE TABLE "Reservations" ( "Code" INTEGER, "Room" TEXT, "CheckIn" TEXT, "CheckOut" TEXT, "Rate" REAL, "LastName" TEXT, "FirstName" TEXT, "Adults" INTEGER, "Kids" INTEGER, PRIMARY KEY ("Code"), FOREIGN KEY("Room") REFERENCES "Rooms" ("RoomId") ) /* 2 rows from Reservations table: Code Room CheckIn CheckOut Rate LastName FirstName Adults Kids 10105 HBB 23-OCT-10 25-OCT-10 100.0 SELBIG CONRAD 1 0 10183 IBD 19-SEP-10 20-SEP-10 150.0 GABLER DOLLIE 2 0 */ CREATE TABLE "Rooms" ( "RoomId" TEXT, "roomName" TEXT, beds INTEGER, "bedType" TEXT, "maxOccupancy" INTEGER, "basePrice" INTEGER, decor TEXT, PRIMARY KEY ("RoomId") ) /* 2 rows from Rooms table: RoomId roomName beds bedType maxOccupancy basePrice decor RND Recluse and defiance 1 King 2 150 modern IBS Interim but salutary 1 King 2 150 traditional */
List the name of rooms with king or queen bed.
SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen";
[{'roomName': 'Recluse and defiance'}, {'roomName': 'Interim but salutary'}, {'roomName': 'Abscond or bolster'}, {'roomName': 'Harbinger but bequest'}, {'roomName': 'Immutable before decorum'}, {'roomName': 'Convoke and sanguine'}, {'roomName': 'Riddle to exculpate'}, {'roomName': 'Frugal not apropos'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What are the names of properties that are either houses or apartments with more than 1 room?[/QUESTION] [SQL]SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1[/SQL]
[QUESTION]What are the names of properties that are either houses or apartments with more than 1 room?[/QUESTION] [SQL]SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1[/SQL]
[QUESTION]What are the names of properties that are either houses or apartments with more than 1 room?[/QUESTION] [SQL]SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1[/SQL]
match_season
CREATE TABLE country ( "Country_id" INTEGER, "Country_name" TEXT, "Capital" TEXT, "Official_native_language" TEXT, PRIMARY KEY ("Country_id") ) CREATE TABLE match_season ( "Season" REAL, "Player" TEXT, "Position" TEXT, "Country" INTEGER, "Team" INTEGER, "Draft_Pick_Number" INTEGER, "Draft_Class" TEXT, "College" TEXT, PRIMARY KEY ("Season"), FOREIGN KEY("Team") REFERENCES team ("Team_id"), FOREIGN KEY("Country") REFERENCES country ("Country_id") ) CREATE TABLE player ( "Player_ID" INTEGER, "Player" TEXT, "Years_Played" TEXT, "Total_WL" TEXT, "Singles_WL" TEXT, "Doubles_WL" TEXT, "Team" INTEGER, PRIMARY KEY ("Player_ID"), FOREIGN KEY("Team") REFERENCES team ("Team_id") ) CREATE TABLE team ( "Team_id" INTEGER, "Name" TEXT, PRIMARY KEY ("Team_id") )
CREATE TABLE country ( "Country_id" INTEGER, "Country_name" TEXT, "Capital" TEXT, "Official_native_language" TEXT, PRIMARY KEY ("Country_id") ) /* 2 rows from country table: Country_id Country_name Capital Official_native_language 1 Indonesia Jakarta Bahasa Indonesia 2 Iran Tehran Persian ( Arabic script ) */ CREATE TABLE match_season ( "Season" REAL, "Player" TEXT, "Position" TEXT, "Country" INTEGER, "Team" INTEGER, "Draft_Pick_Number" INTEGER, "Draft_Class" TEXT, "College" TEXT, PRIMARY KEY ("Season"), FOREIGN KEY("Team") REFERENCES team ("Team_id"), FOREIGN KEY("Country") REFERENCES country ("Country_id") ) /* 2 rows from match_season table: Season Player Position Country Team Draft_Pick_Number Draft_Class College 1996.0 Steve Ralston Category:Articles with hCards Midfielder 6 1 18 1996 MLS College Draft Florida International 1997.0 Mike Duhaney Category:Articles with hCards Defender 6 2 87 1996 MLS Inaugural Player Draft UNLV */ CREATE TABLE player ( "Player_ID" INTEGER, "Player" TEXT, "Years_Played" TEXT, "Total_WL" TEXT, "Singles_WL" TEXT, "Doubles_WL" TEXT, "Team" INTEGER, PRIMARY KEY ("Player_ID"), FOREIGN KEY("Team") REFERENCES team ("Team_id") ) /* 2 rows from player table: Player_ID Player Years_Played Total_WL Singles_WL Doubles_WL Team 1 Cho Soong-Jae (630) 1 (2011) 2–0 1–0 1–0 1 2 Chung Hong (717) 1 (2011) 0–0 0–0 0–0 1 */ CREATE TABLE team ( "Team_id" INTEGER, "Name" TEXT, PRIMARY KEY ("Team_id") ) /* 2 rows from team table: Team_id Name 1 Columbus Crew 2 Evalyn Feil */
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender"
[{'College': 'Maryland'}]
Hard
false
false
false
false
false
false
false
false
false
false
true
false
false
climbing
CREATE TABLE climber ( "Climber_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Time" TEXT, "Points" REAL, "Mountain_ID" INTEGER, PRIMARY KEY ("Climber_ID"), FOREIGN KEY("Mountain_ID") REFERENCES mountain ("Mountain_ID") ) CREATE TABLE mountain ( "Mountain_ID" INTEGER, "Name" TEXT, "Height" REAL, "Prominence" REAL, "Range" TEXT, "Country" TEXT, PRIMARY KEY ("Mountain_ID") )
CREATE TABLE climber ( "Climber_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Time" TEXT, "Points" REAL, "Mountain_ID" INTEGER, PRIMARY KEY ("Climber_ID"), FOREIGN KEY("Mountain_ID") REFERENCES mountain ("Mountain_ID") ) /* 2 rows from climber table: Climber_ID Name Country Time Points Mountain_ID 1 Klaus Enders West Germany 1:13.05.6 15.0 1 2 Siegfried Schauzu West Germany 1:14.56.4 12.0 1 */ CREATE TABLE mountain ( "Mountain_ID" INTEGER, "Name" TEXT, "Height" REAL, "Prominence" REAL, "Range" TEXT, "Country" TEXT, PRIMARY KEY ("Mountain_ID") ) /* 2 rows from mountain table: Mountain_ID Name Height Prominence Range Country 1 Kibo (Uhuru Pk) 5895.0 5885.0 Kilimanjaro Tanzania 2 Mount Kenya (Batian) 5199.0 3825.0 Mount Kenya Kenya */
Which range contains the most mountains?
SELECT RANGE FROM mountain GROUP BY RANGE ORDER BY COUNT(*) DESC LIMIT 1
[{'Range': 'Rwenzori'}]
Easy
false
false
false
true
true
true
false
false
false
false
false
false
false
candidate_poll
CREATE TABLE candidate ( "Candidate_ID" INTEGER, "People_ID" INTEGER, "Poll_Source" TEXT, "Date" TEXT, "Support_rate" REAL, "Consider_rate" REAL, "Oppose_rate" REAL, "Unsure_rate" REAL, PRIMARY KEY ("Candidate_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) CREATE TABLE people ( "People_ID" INTEGER, "Sex" TEXT, "Name" TEXT, "Date_of_Birth" TEXT, "Height" REAL, "Weight" REAL, PRIMARY KEY ("People_ID") )
CREATE TABLE candidate ( "Candidate_ID" INTEGER, "People_ID" INTEGER, "Poll_Source" TEXT, "Date" TEXT, "Support_rate" REAL, "Consider_rate" REAL, "Oppose_rate" REAL, "Unsure_rate" REAL, PRIMARY KEY ("Candidate_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from candidate table: Candidate_ID People_ID Poll_Source Date Support_rate Consider_rate Oppose_rate Unsure_rate 1 1 WNBC/Marist Poll Feb 12–15, 2007 0.25 0.3 0.43 0.2 2 3 WNBC/Marist Poll Feb 12–15, 2007 0.17 0.42 0.32 0.9 */ CREATE TABLE people ( "People_ID" INTEGER, "Sex" TEXT, "Name" TEXT, "Date_of_Birth" TEXT, "Height" REAL, "Weight" REAL, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Sex Name Date_of_Birth Height Weight 1 M Hubert Henno 06.10.1976 188.0 83.0 2 M Dominique Daquin 10.11.1972 197.0 85.0 */
Find the names of the candidates whose support percentage is lower than their oppose rate.
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate
[{'Name': 'Hubert Henno'}, {'Name': 'Stéphane Antiga'}, {'Name': 'Laurent Capet'}, {'Name': 'Vincent Montméat'}, {'Name': 'Loïc De Kergret'}, {'Name': 'Guillaume Samica'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
dorm_1
CREATE TABLE "Dorm" ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE "Dorm_amenity" ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE "Has_amenity" ( dormid INTEGER, amenid INTEGER, FOREIGN KEY(amenid) REFERENCES "Dorm_amenity" (amenid), FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid) ) CREATE TABLE "Lives_in" ( stuid INTEGER, dormid INTEGER, room_number INTEGER, FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid), FOREIGN KEY(stuid) REFERENCES "Student" ("StuID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Dorm" ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) /* 2 rows from Dorm table: dormid dorm_name student_capacity gender 100 Smith Hall 85 X 110 Bud Jones Hall 116 M */ CREATE TABLE "Dorm_amenity" ( amenid INTEGER, amenity_name VARCHAR(25) ) /* 2 rows from Dorm_amenity table: amenid amenity_name 900 TV Lounge 901 Study Room */ CREATE TABLE "Has_amenity" ( dormid INTEGER, amenid INTEGER, FOREIGN KEY(amenid) REFERENCES "Dorm_amenity" (amenid), FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid) ) /* 2 rows from Has_amenity table: dormid amenid 109 900 109 901 */ CREATE TABLE "Lives_in" ( stuid INTEGER, dormid INTEGER, room_number INTEGER, FOREIGN KEY(dormid) REFERENCES "Dorm" (dormid), FOREIGN KEY(stuid) REFERENCES "Student" ("StuID") ) /* 2 rows from Lives_in table: stuid dormid room_number 1001 109 105 1002 100 112 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
What are the amenities in the dorm that a student who has the last name of Smith lives in?
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'
[{'amenity_name': 'TV Lounge'}, {'amenity_name': 'Study Room'}, {'amenity_name': 'Carpeted Rooms'}, {'amenity_name': '4 Walls'}, {'amenity_name': 'Heat'}, {'amenity_name': 'Roof'}, {'amenity_name': 'Ethernet Ports'}, {'amenity_name': 'Air Conditioning'}, {'amenity_name': 'Study Room'}, {'amenity_name': 'Carpeted Rooms'}, {'amenity_name': '4 Walls'}, {'amenity_name': 'Heat'}, {'amenity_name': 'Roof'}]
Hard
false
false
false
false
false
false
false
false
true
false
false
false
false
[QUESTION]What are the description and credit of the course which the student whose last name is Smithson took?[/QUESTION] [SQL]SELECT T4.crs_description , T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'[/SQL]
[QUESTION]What are the description and credit of the course which the student whose last name is Smithson took?[/QUESTION] [SQL]SELECT T4.crs_description , T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'[/SQL]
[QUESTION]What are the description and credit of the course which the student whose last name is Smithson took?[/QUESTION] [SQL]SELECT T4.crs_description , T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'[/SQL]
party_people
CREATE TABLE member ( "Member_ID" INTEGER, "Member_Name" TEXT, "Party_ID" TEXT, "In_office" TEXT, PRIMARY KEY ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) CREATE TABLE party ( "Party_ID" INTEGER, "Minister" TEXT, "Took_office" TEXT, "Left_office" TEXT, "Region_ID" INTEGER, "Party_name" TEXT, PRIMARY KEY ("Party_ID"), FOREIGN KEY("Region_ID") REFERENCES region ("Region_ID") ) CREATE TABLE party_events ( "Event_ID" INTEGER, "Event_Name" TEXT, "Party_ID" INTEGER, "Member_in_charge_ID" INTEGER, PRIMARY KEY ("Event_ID"), FOREIGN KEY("Member_in_charge_ID") REFERENCES member ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) CREATE TABLE region ( "Region_ID" INTEGER, "Region_name" TEXT, "Date" TEXT, "Label" TEXT, "Format" TEXT, "Catalogue" TEXT, PRIMARY KEY ("Region_ID") )
CREATE TABLE member ( "Member_ID" INTEGER, "Member_Name" TEXT, "Party_ID" TEXT, "In_office" TEXT, PRIMARY KEY ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) /* 2 rows from member table: Member_ID Member_Name Party_ID In_office 1 Hon Tony Abbott 3 1994–present 2 Hon Dick Adams 2 1993–2013 */ CREATE TABLE party ( "Party_ID" INTEGER, "Minister" TEXT, "Took_office" TEXT, "Left_office" TEXT, "Region_ID" INTEGER, "Party_name" TEXT, PRIMARY KEY ("Party_ID"), FOREIGN KEY("Region_ID") REFERENCES region ("Region_ID") ) /* 2 rows from party table: Party_ID Minister Took_office Left_office Region_ID Party_name 1 Dr. Kwame Nkrumah (MP) 1957 1958 1 Convention Peoples Party 2 Kojo Botsio (MP) 1958 1959 2 Progress Party */ CREATE TABLE party_events ( "Event_ID" INTEGER, "Event_Name" TEXT, "Party_ID" INTEGER, "Member_in_charge_ID" INTEGER, PRIMARY KEY ("Event_ID"), FOREIGN KEY("Member_in_charge_ID") REFERENCES member ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) /* 2 rows from party_events table: Event_ID Event_Name Party_ID Member_in_charge_ID 1 Annaual Meeting 1 4 2 Conference 1 12 */ CREATE TABLE region ( "Region_ID" INTEGER, "Region_name" TEXT, "Date" TEXT, "Label" TEXT, "Format" TEXT, "Catalogue" TEXT, PRIMARY KEY ("Region_ID") ) /* 2 rows from region table: Region_ID Region_name Date Label Format Catalogue 1 United Kingdom 1 July 2002 Parlophone CD 540 3622 2 United Kingdom 1 July 2002 Parlophone 2× LP 539 9821 */
How many regions do we have?
SELECT count(*) FROM region
[{'count(*)': 5}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]How many states are there?[/QUESTION] [SQL]SELECT count(*) FROM area_code_state[/SQL]
[QUESTION]How many states are there?[/QUESTION] [SQL]SELECT count(*) FROM area_code_state[/SQL]
[QUESTION]How many states are there?[/QUESTION] [SQL]SELECT count(*) FROM area_code_state[/SQL]
[QUESTION]How many states are there?[/QUESTION] [SQL]SELECT count(*) FROM area_code_state[/SQL]
school_bus
CREATE TABLE driver ( "Driver_ID" INTEGER, "Name" TEXT, "Party" TEXT, "Home_city" TEXT, "Age" INTEGER, PRIMARY KEY ("Driver_ID") ) CREATE TABLE school ( "School_ID" INTEGER, "Grade" TEXT, "School" TEXT, "Location" TEXT, "Type" TEXT, PRIMARY KEY ("School_ID") ) CREATE TABLE school_bus ( "School_ID" INTEGER, "Driver_ID" INTEGER, "Years_Working" INTEGER, "If_full_time" BOOLEAN, PRIMARY KEY ("School_ID", "Driver_ID"), FOREIGN KEY("Driver_ID") REFERENCES driver ("Driver_ID"), FOREIGN KEY("School_ID") REFERENCES school ("School_ID") )
CREATE TABLE driver ( "Driver_ID" INTEGER, "Name" TEXT, "Party" TEXT, "Home_city" TEXT, "Age" INTEGER, PRIMARY KEY ("Driver_ID") ) /* 2 rows from driver table: Driver_ID Name Party Home_city Age 1 Matthew Ritter Dem Hartford 40 2 Dan Carter Rep Bethel 30 */ CREATE TABLE school ( "School_ID" INTEGER, "Grade" TEXT, "School" TEXT, "Location" TEXT, "Type" TEXT, PRIMARY KEY ("School_ID") ) /* 2 rows from school table: School_ID Grade School Location Type 1 Kindergarten Noelani Elementary School Honolulu, Hawaii Public 2 1st-3rd grade St. Francis Assisi Jakarta, Indonesia Private Catholic */ CREATE TABLE school_bus ( "School_ID" INTEGER, "Driver_ID" INTEGER, "Years_Working" INTEGER, "If_full_time" BOOLEAN, PRIMARY KEY ("School_ID", "Driver_ID"), FOREIGN KEY("Driver_ID") REFERENCES driver ("Driver_ID"), FOREIGN KEY("School_ID") REFERENCES school ("School_ID") ) /* 2 rows from school_bus table: School_ID Driver_ID Years_Working If_full_time 1 10 10 True 5 7 8 True */
Show the types of schools that have two schools.
SELECT TYPE FROM school GROUP BY TYPE HAVING count(*) = 2
[{'Type': 'Public'}]
Easy
false
false
false
false
false
true
true
false
false
false
false
false
false
[QUESTION]How many different locations does each school have?[/QUESTION] [SQL]SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code[/SQL]
[QUESTION]How many different locations does each school have?[/QUESTION] [SQL]SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code[/SQL]
[QUESTION]How many different locations does each school have?[/QUESTION] [SQL]SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code[/SQL]
[QUESTION]How many different locations does each school have?[/QUESTION] [SQL]SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code[/SQL]
customer_complaints
CREATE TABLE "Complaints" ( complaint_id INTEGER NOT NULL, product_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, complaint_outcome_code VARCHAR(20) NOT NULL, complaint_status_code VARCHAR(20) NOT NULL, complaint_type_code VARCHAR(20) NOT NULL, date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER NOT NULL, FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(staff_id) REFERENCES "Staff" (staff_id) ) CREATE TABLE "Customers" ( customer_id INTEGER, customer_type_code VARCHAR(20) NOT NULL, address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80), PRIMARY KEY (customer_id) ) CREATE TABLE "Products" ( product_id INTEGER, parent_product_id INTEGER, product_category_code VARCHAR(20) NOT NULL, date_product_first_available DATETIME, date_product_discontinued DATETIME, product_name VARCHAR(80), product_description VARCHAR(255), product_price DECIMAL(19, 4), PRIMARY KEY (product_id) ) CREATE TABLE "Staff" ( staff_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80), PRIMARY KEY (staff_id) )
CREATE TABLE "Complaints" ( complaint_id INTEGER NOT NULL, product_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, complaint_outcome_code VARCHAR(20) NOT NULL, complaint_status_code VARCHAR(20) NOT NULL, complaint_type_code VARCHAR(20) NOT NULL, date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER NOT NULL, FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(staff_id) REFERENCES "Staff" (staff_id) ) /* 2 rows from Complaints table: complaint_id product_id customer_id complaint_outcome_code complaint_status_code complaint_type_code date_complaint_raised date_complaint_closed staff_id 1 117 120 OK Closed Product Failure 2002-07-18 10:59:35 1976-04-19 11:03:06 114 2 118 113 OK New Product Unusable 1973-02-10 22:55:56 2013-09-14 02:59:10 120 */ CREATE TABLE "Customers" ( customer_id INTEGER, customer_type_code VARCHAR(20) NOT NULL, address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80), PRIMARY KEY (customer_id) ) /* 2 rows from Customers table: customer_id customer_type_code address_line_1 address_line_2 town_city state email_address phone_number 113 Good Credit Rating 144 Legros Landing Apt. 551 Maryamport Kansas [email protected] 06963347450 114 Good Credit Rating 039 Jedidiah Estate Suite 537 Apt. 245 Sauerberg Hawaii [email protected] 470-803-0244 */ CREATE TABLE "Products" ( product_id INTEGER, parent_product_id INTEGER, product_category_code VARCHAR(20) NOT NULL, date_product_first_available DATETIME, date_product_discontinued DATETIME, product_name VARCHAR(80), product_description VARCHAR(255), product_price DECIMAL(19, 4), PRIMARY KEY (product_id) ) /* 2 rows from Products table: product_id parent_product_id product_category_code date_product_first_available date_product_discontinued product_name product_description product_price 117 4 Food 1988-09-29 17:54:50 1987-12-20 13:46:16 Chocolate Handmade chocolate 2.8800 118 3 Book 1974-06-25 12:26:47 1991-08-20 05:22:31 The Great Gatsby American novel 35.0000 */ CREATE TABLE "Staff" ( staff_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80), PRIMARY KEY (staff_id) ) /* 2 rows from Staff table: staff_id gender first_name last_name email_address phone_number 114 0 Ward Boehm [email protected] (379)551-0838x146 115 1 Lucie Lowe [email protected] 142-311-6503x206 */
Return the average price of products that have each category code.
SELECT avg(product_price) , product_category_code FROM products GROUP BY product_category_code
[{'avg(product_price)': 35.0, 'product_category_code': 'Book'}, {'avg(product_price)': 2.88, 'product_category_code': 'Food'}, {'avg(product_price)': 66.67, 'product_category_code': 'Hardware'}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
which is the density of the state that the largest river in the united states runs through
SELECT density FROM state WHERE state_name IN ( SELECT traverse FROM river WHERE LENGTH = ( SELECT MAX ( LENGTH ) FROM river ) );
[{'Nenhum': 'Nenhum resultado encontrado'}]
Extra Hard
false
false
false
false
false
false
false
false
false
true
false
false
false
[QUESTION]what is the biggest american city in a state with a river[/QUESTION] [SQL]SELECT DISTINCT t1.city_name FROM city AS t1 JOIN river AS t2 ON t2.traverse = t1.state_name WHERE t1.population = ( SELECT MAX ( t1.population ) FROM river AS t2 JOIN city AS t1 ON t2.traverse = t1.state_name );[/SQL]
[QUESTION]what is the biggest american city in a state with a river[/QUESTION] [SQL]SELECT DISTINCT t1.city_name FROM city AS t1 JOIN river AS t2 ON t2.traverse = t1.state_name WHERE t1.population = ( SELECT MAX ( t1.population ) FROM river AS t2 JOIN city AS t1 ON t2.traverse = t1.state_name );[/SQL]
[QUESTION]what is the biggest american city in a state with a river[/QUESTION] [SQL]SELECT DISTINCT t1.city_name FROM city AS t1 JOIN river AS t2 ON t2.traverse = t1.state_name WHERE t1.population = ( SELECT MAX ( t1.population ) FROM river AS t2 JOIN city AS t1 ON t2.traverse = t1.state_name );[/SQL]
[QUESTION]what is the biggest american city in a state with a river[/QUESTION] [SQL]SELECT DISTINCT t1.city_name FROM city AS t1 JOIN river AS t2 ON t2.traverse = t1.state_name WHERE t1.population = ( SELECT MAX ( t1.population ) FROM river AS t2 JOIN city AS t1 ON t2.traverse = t1.state_name );[/SQL]
device
CREATE TABLE device ( "Device_ID" INTEGER, "Device" TEXT, "Carrier" TEXT, "Package_Version" TEXT, "Applications" TEXT, "Software_Platform" TEXT, PRIMARY KEY ("Device_ID") ) CREATE TABLE shop ( "Shop_ID" INTEGER, "Shop_Name" TEXT, "Location" TEXT, "Open_Date" TEXT, "Open_Year" INTEGER, PRIMARY KEY ("Shop_ID") ) CREATE TABLE stock ( "Shop_ID" INTEGER, "Device_ID" INTEGER, "Quantity" INTEGER, PRIMARY KEY ("Shop_ID", "Device_ID"), FOREIGN KEY("Device_ID") REFERENCES device ("Device_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") )
CREATE TABLE device ( "Device_ID" INTEGER, "Device" TEXT, "Carrier" TEXT, "Package_Version" TEXT, "Applications" TEXT, "Software_Platform" TEXT, PRIMARY KEY ("Device_ID") ) /* 2 rows from device table: Device_ID Device Carrier Package_Version Applications Software_Platform 1 BlackBerry Storm 9530 MTS Mobility 5.0.0.808 5.0.0.419 Android 2 Apple Verizon Wireless 5.0.0.328 5.0.0.328 iOS */ CREATE TABLE shop ( "Shop_ID" INTEGER, "Shop_Name" TEXT, "Location" TEXT, "Open_Date" TEXT, "Open_Year" INTEGER, PRIMARY KEY ("Shop_ID") ) /* 2 rows from shop table: Shop_ID Shop_Name Location Open_Date Open_Year 1 Dinas Device Dinas 1 January 2014 2 Best Buy Cymmer 15 July 2006 */ CREATE TABLE stock ( "Shop_ID" INTEGER, "Device_ID" INTEGER, "Quantity" INTEGER, PRIMARY KEY ("Shop_ID", "Device_ID"), FOREIGN KEY("Device_ID") REFERENCES device ("Device_ID"), FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID") ) /* 2 rows from stock table: Shop_ID Device_ID Quantity 1 6 100 2 6 110 */
What are the different software platforms for devices, and how many devices have each?
SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform
[{'Software_Platform': 'Android', 'COUNT(*)': 5}, {'Software_Platform': 'iOS', 'COUNT(*)': 1}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
gas_company
CREATE TABLE company ( "Company_ID" INTEGER, "Rank" INTEGER, "Company" TEXT, "Headquarters" TEXT, "Main_Industry" TEXT, "Sales_billion" REAL, "Profits_billion" REAL, "Assets_billion" REAL, "Market_Value" REAL, PRIMARY KEY ("Company_ID") ) CREATE TABLE gas_station ( "Station_ID" INTEGER, "Open_Year" INTEGER, "Location" TEXT, "Manager_Name" TEXT, "Vice_Manager_Name" TEXT, "Representative_Name" TEXT, PRIMARY KEY ("Station_ID") ) CREATE TABLE station_company ( "Station_ID" INTEGER, "Company_ID" INTEGER, "Rank_of_the_Year" INTEGER, PRIMARY KEY ("Station_ID", "Company_ID"), FOREIGN KEY("Company_ID") REFERENCES company ("Company_ID"), FOREIGN KEY("Station_ID") REFERENCES gas_station ("Station_ID") )
CREATE TABLE company ( "Company_ID" INTEGER, "Rank" INTEGER, "Company" TEXT, "Headquarters" TEXT, "Main_Industry" TEXT, "Sales_billion" REAL, "Profits_billion" REAL, "Assets_billion" REAL, "Market_Value" REAL, PRIMARY KEY ("Company_ID") ) /* 2 rows from company table: Company_ID Rank Company Headquarters Main_Industry Sales_billion Profits_billion Assets_billion Market_Value 1 1 ExxonMobil USA Oil and gas 433.5 41.1 331.1 407.4 2 3 General Electric USA Conglomerate 147.3 14.2 717.2 213.7 */ CREATE TABLE gas_station ( "Station_ID" INTEGER, "Open_Year" INTEGER, "Location" TEXT, "Manager_Name" TEXT, "Vice_Manager_Name" TEXT, "Representative_Name" TEXT, PRIMARY KEY ("Station_ID") ) /* 2 rows from gas_station table: Station_ID Open_Year Location Manager_Name Vice_Manager_Name Representative_Name 1 1998 Herne Hill BrianWingrave Russell Denman Clive Burr 2 1999 Channel Hill SimonMarloe Russell Brown Rob Jefferies */ CREATE TABLE station_company ( "Station_ID" INTEGER, "Company_ID" INTEGER, "Rank_of_the_Year" INTEGER, PRIMARY KEY ("Station_ID", "Company_ID"), FOREIGN KEY("Company_ID") REFERENCES company ("Company_ID"), FOREIGN KEY("Station_ID") REFERENCES gas_station ("Station_ID") ) /* 2 rows from station_company table: Station_ID Company_ID Rank_of_the_Year 11 1 1 1 3 2 */
For each company id, what are the companies and how many gas stations does each one operate?
SELECT T2.company , count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id
[{'Company': 'ExxonMobil', 'count(*)': 2}, {'Company': 'Royal Dutch Shell', 'count(*)': 1}, {'Company': 'PetroChina', 'count(*)': 1}, {'Company': 'Petrobras', 'count(*)': 1}, {'Company': 'BP', 'count(*)': 1}]
Medium
false
false
false
false
false
true
false
true
false
false
false
false
false
[QUESTION]How many employees are there all together?[/QUESTION] [SQL]SELECT count(*) FROM employee[/SQL]
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
what is the shortest river in the united states
SELECT river_name FROM river WHERE LENGTH = ( SELECT MIN ( LENGTH ) FROM river );
[{'Nenhum': 'Nenhum resultado encontrado'}]
Extra Hard
false
false
false
false
false
false
false
false
false
true
false
false
false
[QUESTION]what is the longest river in the state with the highest point[/QUESTION] [SQL]SELECT t1.river_name FROM highlow AS t2 JOIN river AS t1 ON t1.traverse = t2.state_name WHERE t2.highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow ) ORDER BY t1.length DESC LIMIT 1;[/SQL]
[QUESTION]what is the longest river in the state with the highest point[/QUESTION] [SQL]SELECT t1.river_name FROM highlow AS t2 JOIN river AS t1 ON t1.traverse = t2.state_name WHERE t2.highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow ) ORDER BY t1.length DESC LIMIT 1;[/SQL]
[QUESTION]what is the longest river in the state with the highest point[/QUESTION] [SQL]SELECT t1.river_name FROM highlow AS t2 JOIN river AS t1 ON t1.traverse = t2.state_name WHERE t2.highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow ) ORDER BY t1.length DESC LIMIT 1;[/SQL]
[QUESTION]what is the longest river in the state with the highest point[/QUESTION] [SQL]SELECT t1.river_name FROM highlow AS t2 JOIN river AS t1 ON t1.traverse = t2.state_name WHERE t2.highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow ) ORDER BY t1.length DESC LIMIT 1;[/SQL]
ship_mission
CREATE TABLE mission ( "Mission_ID" INTEGER, "Ship_ID" INTEGER, "Code" TEXT, "Launched_Year" INTEGER, "Location" TEXT, "Speed_knots" INTEGER, "Fate" TEXT, PRIMARY KEY ("Mission_ID"), FOREIGN KEY("Ship_ID") REFERENCES ship ("Ship_ID") ) CREATE TABLE ship ( "Ship_ID" INTEGER, "Name" TEXT, "Type" TEXT, "Nationality" TEXT, "Tonnage" INTEGER, PRIMARY KEY ("Ship_ID") )
CREATE TABLE mission ( "Mission_ID" INTEGER, "Ship_ID" INTEGER, "Code" TEXT, "Launched_Year" INTEGER, "Location" TEXT, "Speed_knots" INTEGER, "Fate" TEXT, PRIMARY KEY ("Mission_ID"), FOREIGN KEY("Ship_ID") REFERENCES ship ("Ship_ID") ) /* 2 rows from mission table: Mission_ID Ship_ID Code Launched_Year Location Speed_knots Fate 1 1 VMV-1 1930 Germany 25 Decommissioned 1950 2 2 VMV-2 1930 Germany 25 Decommissioned 1950 */ CREATE TABLE ship ( "Ship_ID" INTEGER, "Name" TEXT, "Type" TEXT, "Nationality" TEXT, "Tonnage" INTEGER, PRIMARY KEY ("Ship_ID") ) /* 2 rows from ship table: Ship_ID Name Type Nationality Tonnage 1 Corbridge Cargo ship United Kingdom 3687 2 Farringford Battle ship United States 3146 */
What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?
SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000
[{'Type': 'Battle ship'}]
Hard
false
false
false
false
false
false
false
false
false
false
true
false
false
[QUESTION]How many battles did not lose any ship with tonnage '225'?[/QUESTION] [SQL]SELECT count(*) FROM battle WHERE id NOT IN ( SELECT lost_in_battle FROM ship WHERE tonnage = '225' );[/SQL]
[QUESTION]How many battles did not lose any ship with tonnage '225'?[/QUESTION] [SQL]SELECT count(*) FROM battle WHERE id NOT IN ( SELECT lost_in_battle FROM ship WHERE tonnage = '225' );[/SQL]
bike_1
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT, PRIMARY KEY (id) ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT, FOREIGN KEY(station_id) REFERENCES station (id) ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER, PRIMARY KEY (id) ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, "max_wind_Speed_mph" INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER )
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT, PRIMARY KEY (id) ) /* 2 rows from station table: id name lat long dock_count city installation_date 2 San Jose Diridon Caltrain Station 37.3297320000 -121.9017820000 27 San Jose 8/6/2013 3 San Jose Civic Center 37.3306980000 -121.8889790000 15 San Jose 8/5/2013 */ CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT, FOREIGN KEY(station_id) REFERENCES station (id) ) /* 2 rows from status table: station_id bikes_available docks_available time 3 12 3 2015-06-02 12:46:02 3 12 3 2015-06-02 12:47:02 */ CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER, PRIMARY KEY (id) ) /* 2 rows from trip table: id duration start_date start_station_name start_station_id end_date end_station_name end_station_id bike_id subscription_type zip_code 900504 384 8/21/2015 17:03 Howard at 2nd 63 8/21/2015 17:10 San Francisco Caltrain 2 (330 Townsend) 69 454 Subscriber 94041 900505 588 8/21/2015 17:03 South Van Ness at Market 66 8/21/2015 17:13 San Francisco Caltrain 2 (330 Townsend) 69 574 Subscriber 95119 */ CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, "max_wind_Speed_mph" INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER ) /* 2 rows from weather table: date max_temperature_f mean_temperature_f min_temperature_f max_dew_point_f mean_dew_point_f min_dew_point_f max_humidity mean_humidity min_humidity max_sea_level_pressure_inches mean_sea_level_pressure_inches min_sea_level_pressure_inches max_visibility_miles mean_visibility_miles min_visibility_miles max_wind_Speed_mph mean_wind_speed_mph max_gust_speed_mph precipitation_inches cloud_cover events wind_dir_degrees zip_code 8/29/2013 74 68 61 61 58 56 93 75 57 30.0700000000 30.0200000000 29.9700000000 10 10 10 23 11 28 0 4 286 94107 8/30/2013 78 69 60 61 58 56 90 70 50 30.0500000000 30.0000000000 29.9300000000 10 10 7 29 13 35 0 2 291 94107 */
What is the zip code that has the lowest average mean sea level pressure?
SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1
[{'zip_code': 94301}]
Easy
false
false
false
true
true
true
false
false
false
false
false
false
false
[QUESTION]What is the zip code for Port Chelsea?[/QUESTION] [SQL]SELECT zip_postcode FROM Addresses WHERE city = 'Port Chelsea'[/SQL]
csu_1
CREATE TABLE "Campuses" ( "Id" INTEGER, "Campus" TEXT, "Location" TEXT, "County" TEXT, "Year" INTEGER, PRIMARY KEY ("Id") ) CREATE TABLE csu_fees ( "Campus" INTEGER, "Year" INTEGER, "CampusFee" INTEGER, PRIMARY KEY ("Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE degrees ( "Year" INTEGER, "Campus" INTEGER, "Degrees" INTEGER, PRIMARY KEY ("Year", "Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE discipline_enrollments ( "Campus" INTEGER, "Discipline" INTEGER, "Year" INTEGER, "Undergraduate" INTEGER, "Graduate" INTEGER, PRIMARY KEY ("Campus", "Discipline"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE enrollments ( "Campus" INTEGER, "Year" INTEGER, "TotalEnrollment_AY" INTEGER, "FTE_AY" INTEGER, PRIMARY KEY ("Campus", "Year"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE faculty ( "Campus" INTEGER, "Year" INTEGER, "Faculty" REAL, FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") )
CREATE TABLE "Campuses" ( "Id" INTEGER, "Campus" TEXT, "Location" TEXT, "County" TEXT, "Year" INTEGER, PRIMARY KEY ("Id") ) /* 2 rows from Campuses table: Id Campus Location County Year 1 California State University-Bakersfield Bakersfield Kern 1965 2 California State University-Channel Islands Camarillo Ventura 2002 */ CREATE TABLE csu_fees ( "Campus" INTEGER, "Year" INTEGER, "CampusFee" INTEGER, PRIMARY KEY ("Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from csu_fees table: Campus Year CampusFee 1 1996 1951 2 2003 1868 */ CREATE TABLE degrees ( "Year" INTEGER, "Campus" INTEGER, "Degrees" INTEGER, PRIMARY KEY ("Year", "Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from degrees table: Year Campus Degrees 1990 1 701 1991 1 681 */ CREATE TABLE discipline_enrollments ( "Campus" INTEGER, "Discipline" INTEGER, "Year" INTEGER, "Undergraduate" INTEGER, "Graduate" INTEGER, PRIMARY KEY ("Campus", "Discipline"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from discipline_enrollments table: Campus Discipline Year Undergraduate Graduate 1 4 2004 248 0 1 5 2004 811 73 */ CREATE TABLE enrollments ( "Campus" INTEGER, "Year" INTEGER, "TotalEnrollment_AY" INTEGER, "FTE_AY" INTEGER, PRIMARY KEY ("Campus", "Year"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from enrollments table: Campus Year TotalEnrollment_AY FTE_AY 1 1956 384 123 1 1957 432 151 */ CREATE TABLE faculty ( "Campus" INTEGER, "Year" INTEGER, "Faculty" REAL, FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from faculty table: Campus Year Faculty 1 2002 357.1 2 2002 48.4 */
What campuses are located in Los Angeles county and opened after 1950?
SELECT campus FROM campuses WHERE county = "Los Angeles" AND YEAR > 1950
[{'Campus': 'California State University-Dominguez Hills'}, {'Campus': 'California State University-Northridge'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
Where does Peter Mertens publish ?
SELECT DISTINCT t3.journalid , t4.venueid FROM venue AS t4 JOIN paper AS t3 ON t4.venueid = t3.venueid JOIN writes AS t2 ON t2.paperid = t3.paperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = "Peter Mertens";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
true
false
false
false
false
false
false
false
true
false
false
false
false
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
what is the major cities in kansas
SELECT city_name FROM city WHERE population > 150000 AND state_name = "kansas";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
music_4
CREATE TABLE artist ( "Artist_ID" INTEGER, "Artist" TEXT, "Age" INTEGER, "Famous_Title" TEXT, "Famous_Release_date" TEXT, PRIMARY KEY ("Artist_ID") ) CREATE TABLE music_festival ( "ID" INTEGER, "Music_Festival" TEXT, "Date_of_ceremony" TEXT, "Category" TEXT, "Volume" INTEGER, "Result" TEXT, PRIMARY KEY ("ID"), FOREIGN KEY("Volume") REFERENCES volume ("Volume_ID") ) CREATE TABLE volume ( "Volume_ID" INTEGER, "Volume_Issue" TEXT, "Issue_Date" TEXT, "Weeks_on_Top" REAL, "Song" TEXT, "Artist_ID" INTEGER, PRIMARY KEY ("Volume_ID"), FOREIGN KEY("Artist_ID") REFERENCES artist ("Artist_ID") )
CREATE TABLE artist ( "Artist_ID" INTEGER, "Artist" TEXT, "Age" INTEGER, "Famous_Title" TEXT, "Famous_Release_date" TEXT, PRIMARY KEY ("Artist_ID") ) /* 2 rows from artist table: Artist_ID Artist Age Famous_Title Famous_Release_date 1 Gorgoroth 34 Bergen 1996 November 2007 2 Ophiolatry 35 Transmutation January 21, 2008 */ CREATE TABLE music_festival ( "ID" INTEGER, "Music_Festival" TEXT, "Date_of_ceremony" TEXT, "Category" TEXT, "Volume" INTEGER, "Result" TEXT, PRIMARY KEY ("ID"), FOREIGN KEY("Volume") REFERENCES volume ("Volume_ID") ) /* 2 rows from music_festival table: ID Music_Festival Date_of_ceremony Category Volume Result 1 34th England Academy Prize 18 February 2011 Best Song 1 Nominated 2 34th Japan Academy Prize 18 February 2011 Best Lyrics 2 Nominated */ CREATE TABLE volume ( "Volume_ID" INTEGER, "Volume_Issue" TEXT, "Issue_Date" TEXT, "Weeks_on_Top" REAL, "Song" TEXT, "Artist_ID" INTEGER, PRIMARY KEY ("Volume_ID"), FOREIGN KEY("Artist_ID") REFERENCES artist ("Artist_ID") ) /* 2 rows from volume table: Volume_ID Volume_Issue Issue_Date Weeks_on_Top Song Artist_ID 1 45:14 § 27 December 1986 - 10 January 3.0 The Way 1 2 45:15 17 January 1.0 Everybody Have Fun Tonight 2 */
Give the distinct famous release dates for all artists.
SELECT distinct(Famous_Release_date) FROM artist
[{'Famous_Release_date': 'November 2007'}, {'Famous_Release_date': 'January 21, 2008'}, {'Famous_Release_date': '2009'}, {'Famous_Release_date': 'June 23, 2008'}, {'Famous_Release_date': 'June 15, 2009'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]List the name and gender for all artists who released songs in March.[/QUESTION] [SQL]SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%"[/SQL]
[QUESTION]List the name and gender for all artists who released songs in March.[/QUESTION] [SQL]SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%"[/SQL]
[QUESTION]List the name and gender for all artists who released songs in March.[/QUESTION] [SQL]SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%"[/SQL]
[QUESTION]List the name and gender for all artists who released songs in March.[/QUESTION] [SQL]SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%"[/SQL]
flight_4
CREATE TABLE airlines ( alid INTEGER, name TEXT, iata VARCHAR(2), icao VARCHAR(3), callsign TEXT, country TEXT, active VARCHAR(2), PRIMARY KEY (alid) ) CREATE TABLE airports ( apid INTEGER, name TEXT NOT NULL, city TEXT, country TEXT, x REAL, y REAL, elevation BIGINT, iata TEXT(3), icao TEXT(4), PRIMARY KEY (apid) ) CREATE TABLE routes ( rid INTEGER, dst_apid INTEGER, dst_ap VARCHAR(4), src_apid BIGINT, src_ap VARCHAR(4), alid BIGINT, airline VARCHAR(4), codeshare TEXT, PRIMARY KEY (rid), FOREIGN KEY(dst_apid) REFERENCES airports (apid), FOREIGN KEY(src_apid) REFERENCES airports (apid), FOREIGN KEY(alid) REFERENCES airlines (alid) )
CREATE TABLE airlines ( alid INTEGER, name TEXT, iata VARCHAR(2), icao VARCHAR(3), callsign TEXT, country TEXT, active VARCHAR(2), PRIMARY KEY (alid) ) /* 2 rows from airlines table: alid name iata icao callsign country active -1 Unknown - N/A None None Y 1 Private flight - N/A Y */ CREATE TABLE airports ( apid INTEGER, name TEXT NOT NULL, city TEXT, country TEXT, x REAL, y REAL, elevation BIGINT, iata TEXT(3), icao TEXT(4), PRIMARY KEY (apid) ) /* 2 rows from airports table: apid name city country x y elevation iata icao 1 Goroka Airport Goroka Papua New Guinea 145.391998291 -6.081689834590001 5282 GKA AYGA 2 Madang Airport Madang Papua New Guinea 145.789001465 -5.20707988739 20 MAG AYMD */ CREATE TABLE routes ( rid INTEGER, dst_apid INTEGER, dst_ap VARCHAR(4), src_apid BIGINT, src_ap VARCHAR(4), alid BIGINT, airline VARCHAR(4), codeshare TEXT, PRIMARY KEY (rid), FOREIGN KEY(dst_apid) REFERENCES airports (apid), FOREIGN KEY(src_apid) REFERENCES airports (apid), FOREIGN KEY(alid) REFERENCES airlines (alid) ) /* 2 rows from routes table: rid dst_apid dst_ap src_apid src_ap alid airline codeshare 37 2990 KZ 2965 AER 410 2B None 38 2990 KZ 2966 ASF 410 2B None */
Which countries has the most number of airlines?
SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1
[{'country': 'United States'}]
Easy
false
false
false
true
true
true
false
false
false
false
false
false
false
[QUESTION]What is the total number of airlines?[/QUESTION] [SQL]SELECT count(*) FROM AIRLINES[/SQL]
[QUESTION]What is the total number of airlines?[/QUESTION] [SQL]SELECT count(*) FROM AIRLINES[/SQL]
[QUESTION]What is the total number of airlines?[/QUESTION] [SQL]SELECT count(*) FROM AIRLINES[/SQL]
[QUESTION]What is the total number of airlines?[/QUESTION] [SQL]SELECT count(*) FROM AIRLINES[/SQL]
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
which states have points that are higher than the highest point in colorado
SELECT state_name FROM highlow WHERE highest_elevation > ( SELECT highest_elevation FROM highlow WHERE state_name = "colorado" );
[{'Nenhum': 'Nenhum resultado encontrado'}]
Extra Hard
false
false
false
false
false
false
false
false
false
true
false
false
false
[QUESTION]how high is the highest point in the largest state[/QUESTION] [SQL]SELECT t2.highest_elevation FROM highlow AS t2 JOIN state AS t1 ON t1.state_name = t2.state_name WHERE t1.area = ( SELECT MAX ( area ) FROM state );[/SQL]
[QUESTION]how high is the highest point in the largest state[/QUESTION] [SQL]SELECT t2.highest_elevation FROM highlow AS t2 JOIN state AS t1 ON t1.state_name = t2.state_name WHERE t1.area = ( SELECT MAX ( area ) FROM state );[/SQL]
[QUESTION]how high is the highest point in the largest state[/QUESTION] [SQL]SELECT t2.highest_elevation FROM highlow AS t2 JOIN state AS t1 ON t1.state_name = t2.state_name WHERE t1.area = ( SELECT MAX ( area ) FROM state );[/SQL]
[QUESTION]how high is the highest point in the largest state[/QUESTION] [SQL]SELECT t2.highest_elevation FROM highlow AS t2 JOIN state AS t1 ON t1.state_name = t2.state_name WHERE t1.area = ( SELECT MAX ( area ) FROM state );[/SQL]
election
CREATE TABLE county ( "County_Id" INTEGER, "County_name" TEXT, "Population" REAL, "Zip_code" TEXT, PRIMARY KEY ("County_Id") ) CREATE TABLE election ( "Election_ID" INTEGER, "Counties_Represented" TEXT, "District" INTEGER, "Delegate" TEXT, "Party" INTEGER, "First_Elected" REAL, "Committee" TEXT, PRIMARY KEY ("Election_ID"), FOREIGN KEY("District") REFERENCES county ("County_Id"), FOREIGN KEY("Party") REFERENCES party ("Party_ID") ) CREATE TABLE party ( "Party_ID" INTEGER, "Year" REAL, "Party" TEXT, "Governor" TEXT, "Lieutenant_Governor" TEXT, "Comptroller" TEXT, "Attorney_General" TEXT, "US_Senate" TEXT, PRIMARY KEY ("Party_ID") )
CREATE TABLE county ( "County_Id" INTEGER, "County_name" TEXT, "Population" REAL, "Zip_code" TEXT, PRIMARY KEY ("County_Id") ) /* 2 rows from county table: County_Id County_name Population Zip_code 1 Howard 21000.0 D21 2 Baltimore County 90000.0 D08 */ CREATE TABLE election ( "Election_ID" INTEGER, "Counties_Represented" TEXT, "District" INTEGER, "Delegate" TEXT, "Party" INTEGER, "First_Elected" REAL, "Committee" TEXT, PRIMARY KEY ("Election_ID"), FOREIGN KEY("District") REFERENCES county ("County_Id"), FOREIGN KEY("Party") REFERENCES party ("Party_ID") ) /* 2 rows from election table: Election_ID Counties_Represented District Delegate Party First_Elected Committee 1 09.1 9A 1 Bates, Gail H. Gail H. Bates 1 2002.0 Appropriations 2 09.1 9A 1 Miller, Warren E. Warren E. Miller 1 2003.0 Economic Matters */ CREATE TABLE party ( "Party_ID" INTEGER, "Year" REAL, "Party" TEXT, "Governor" TEXT, "Lieutenant_Governor" TEXT, "Comptroller" TEXT, "Attorney_General" TEXT, "US_Senate" TEXT, PRIMARY KEY ("Party_ID") ) /* 2 rows from party table: Party_ID Year Party Governor Lieutenant_Governor Comptroller Attorney_General US_Senate 1 1998.0 Democratic Peter Vallone Sandra Frankel Carl McCall Eliot Spitzer Charles Schumer 2 1998.0 Liberal Betsy McCaughey Ross Jonathan Reiter Carl McCall Eliot Spitzer Charles Schumer */
What are the distinct districts for elections?
SELECT DISTINCT District FROM election
[{'District': 1}, {'District': 2}, {'District': 3}, {'District': 4}]
Easy
true
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What is the total number of residents for the districts with the 3 largest areas?[/QUESTION] [SQL]SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3[/SQL]
[QUESTION]What is the total number of residents for the districts with the 3 largest areas?[/QUESTION] [SQL]SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3[/SQL]
[QUESTION]What is the total number of residents for the districts with the 3 largest areas?[/QUESTION] [SQL]SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3[/SQL]
[QUESTION]What is the total number of residents for the districts with the 3 largest areas?[/QUESTION] [SQL]SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3[/SQL]
game_1
CREATE TABLE "Plays_Games" ( "StuID" INTEGER, "GameID" INTEGER, "Hours_Played" INTEGER, FOREIGN KEY("GameID") REFERENCES "Video_Games" ("GameID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "SportsInfo" ( "StuID" INTEGER, "SportName" VARCHAR(32), "HoursPerWeek" INTEGER, "GamesPlayed" INTEGER, "OnScholarship" VARCHAR(1), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) CREATE TABLE "Video_Games" ( "GameID" INTEGER, "GName" VARCHAR(40), "GType" VARCHAR(40), PRIMARY KEY ("GameID") )
CREATE TABLE "Plays_Games" ( "StuID" INTEGER, "GameID" INTEGER, "Hours_Played" INTEGER, FOREIGN KEY("GameID") REFERENCES "Video_Games" ("GameID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from Plays_Games table: StuID GameID Hours_Played 1001 1 35 1001 2 15 */ CREATE TABLE "SportsInfo" ( "StuID" INTEGER, "SportName" VARCHAR(32), "HoursPerWeek" INTEGER, "GamesPlayed" INTEGER, "OnScholarship" VARCHAR(1), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from SportsInfo table: StuID SportName HoursPerWeek GamesPlayed OnScholarship 1001 Athletics 2 5 N 1002 Football 7 20 Y */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */ CREATE TABLE "Video_Games" ( "GameID" INTEGER, "GName" VARCHAR(40), "GType" VARCHAR(40), PRIMARY KEY ("GameID") ) /* 2 rows from Video_Games table: GameID GName GType 1 RNG Stone Collectible card game 2 The Vanishing of Eric Calder Walking Simulator */
What are the names of all the games that have been played for at least 1000 hours?
SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING sum(hours_played) >= 1000
[{'GName': 'Europe is the Universe'}, {'GName': 'Works of Widenius'}]
Medium
false
false
false
false
false
true
true
true
false
false
false
false
false
[QUESTION]What are the first name, last name and id of the player with the most all star game experiences? Also list the count.[/QUESTION] [SQL]SELECT T1.name_first , T1.name_last , T1.player_id , count(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 1;[/SQL]
sakila_1
CREATE TABLE actor ( actor_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id) ) CREATE TABLE address ( address_id INTEGER NOT NULL, address VARCHAR(50) NOT NULL, address2 VARCHAR(50) DEFAULT NULL, district VARCHAR(20) NOT NULL, city_id INTEGER NOT NULL, postal_code VARCHAR(10) DEFAULT NULL, phone VARCHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (address_id), FOREIGN KEY(city_id) REFERENCES city (city_id) ) CREATE TABLE category ( category_id INTEGER NOT NULL, name VARCHAR(25) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (category_id) ) CREATE TABLE city ( city_id INTEGER NOT NULL, city VARCHAR(50) NOT NULL, country_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (city_id), FOREIGN KEY(country_id) REFERENCES country (country_id) ) CREATE TABLE country ( country_id INTEGER NOT NULL, country VARCHAR(50) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (country_id) ) CREATE TABLE customer ( customer_id INTEGER NOT NULL, store_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, email VARCHAR(50) DEFAULT NULL, address_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, create_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (customer_id), FOREIGN KEY(address_id) REFERENCES address (address_id), FOREIGN KEY(store_id) REFERENCES store (store_id) ) CREATE TABLE film ( film_id INTEGER NOT NULL, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, release_year NUMERIC DEFAULT NULL, language_id INTEGER NOT NULL, original_language_id INTEGER DEFAULT NULL, rental_duration INTEGER DEFAULT 3 NOT NULL, rental_rate DECIMAL(4, 2) DEFAULT 4.99 NOT NULL, length INTEGER DEFAULT NULL, replacement_cost DECIMAL(5, 2) DEFAULT 19.99 NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id), FOREIGN KEY(language_id) REFERENCES language (language_id), FOREIGN KEY(original_language_id) REFERENCES language (language_id) ) CREATE TABLE film_actor ( actor_id INTEGER NOT NULL, film_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id, film_id), FOREIGN KEY(actor_id) REFERENCES actor (actor_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) CREATE TABLE film_category ( film_id INTEGER NOT NULL, category_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id, category_id), FOREIGN KEY(film_id) REFERENCES film (film_id), FOREIGN KEY(category_id) REFERENCES category (category_id) ) CREATE TABLE film_text ( film_id SMALLINT NOT NULL, title VARCHAR(255) NOT NULL, description TEXT, PRIMARY KEY (film_id) ) CREATE TABLE inventory ( inventory_id INTEGER NOT NULL, film_id INTEGER NOT NULL, store_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (inventory_id), FOREIGN KEY(store_id) REFERENCES store (store_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) CREATE TABLE language ( language_id INTEGER NOT NULL, name CHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (language_id) ) CREATE TABLE payment ( payment_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, staff_id INTEGER NOT NULL, rental_id INTEGER DEFAULT NULL, amount DECIMAL(5, 2) NOT NULL, payment_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (payment_id), FOREIGN KEY(rental_id) REFERENCES rental (rental_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id) ) CREATE TABLE rental ( rental_id INTEGER NOT NULL, rental_date DATETIME NOT NULL, inventory_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, return_date DATETIME DEFAULT NULL, staff_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (rental_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory (inventory_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id) ) CREATE TABLE staff ( staff_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, address_id INTEGER NOT NULL, picture BLOB DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, store_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, username VARCHAR(16) NOT NULL, password VARCHAR(40) DEFAULT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) ) CREATE TABLE store ( store_id INTEGER NOT NULL, manager_staff_id INTEGER NOT NULL, address_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (store_id), FOREIGN KEY(manager_staff_id) REFERENCES staff (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) )
CREATE TABLE actor ( actor_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id) ) /* 2 rows from actor table: actor_id first_name last_name last_update 1 PENELOPE GUINESS 2006-02-15 04:34:33 2 NICK WAHLBERG 2006-02-15 04:34:33 */ CREATE TABLE address ( address_id INTEGER NOT NULL, address VARCHAR(50) NOT NULL, address2 VARCHAR(50) DEFAULT NULL, district VARCHAR(20) NOT NULL, city_id INTEGER NOT NULL, postal_code VARCHAR(10) DEFAULT NULL, phone VARCHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (address_id), FOREIGN KEY(city_id) REFERENCES city (city_id) ) /* 2 rows from address table: address_id address address2 district city_id postal_code phone last_update 1 47 MySakila Drive None Alberta 300 2006-02-15 04:45:30 2 28 MySQL Boulevard None QLD 576 2006-02-15 04:45:30 */ CREATE TABLE category ( category_id INTEGER NOT NULL, name VARCHAR(25) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (category_id) ) /* 2 rows from category table: category_id name last_update 1 Action 2006-02-15 04:46:27 2 Animation 2006-02-15 04:46:27 */ CREATE TABLE city ( city_id INTEGER NOT NULL, city VARCHAR(50) NOT NULL, country_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (city_id), FOREIGN KEY(country_id) REFERENCES country (country_id) ) /* 2 rows from city table: city_id city country_id last_update 1 A Corua (La Corua) 87 2006-02-15 04:45:25 2 Abha 82 2006-02-15 04:45:25 */ CREATE TABLE country ( country_id INTEGER NOT NULL, country VARCHAR(50) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (country_id) ) /* 2 rows from country table: country_id country last_update 1 Afghanistan 2006-02-15 04:44:00 2 Algeria 2006-02-15 04:44:00 */ CREATE TABLE customer ( customer_id INTEGER NOT NULL, store_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, email VARCHAR(50) DEFAULT NULL, address_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, create_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (customer_id), FOREIGN KEY(address_id) REFERENCES address (address_id), FOREIGN KEY(store_id) REFERENCES store (store_id) ) /* 2 rows from customer table: customer_id store_id first_name last_name email address_id active create_date last_update 1 1 MARY SMITH [email protected] 5 True 2006-02-14 22:04:36 2006-02-15 04:57:20 2 1 PATRICIA JOHNSON [email protected] 6 True 2006-02-14 22:04:36 2006-02-15 04:57:20 */ CREATE TABLE film ( film_id INTEGER NOT NULL, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, release_year NUMERIC DEFAULT NULL, language_id INTEGER NOT NULL, original_language_id INTEGER DEFAULT NULL, rental_duration INTEGER DEFAULT 3 NOT NULL, rental_rate DECIMAL(4, 2) DEFAULT 4.99 NOT NULL, length INTEGER DEFAULT NULL, replacement_cost DECIMAL(5, 2) DEFAULT 19.99 NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id), FOREIGN KEY(language_id) REFERENCES language (language_id), FOREIGN KEY(original_language_id) REFERENCES language (language_id) ) /* 2 rows from film table: film_id title description release_year language_id original_language_id rental_duration rental_rate length replacement_cost last_update 1 ACADEMY DINOSAUR A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies 2006.0000000000 1 None 6 0.99 86 20.99 2006-02-15 05:03:42 2 ACE GOLDFINGER A Astounding Epistle of a Database Administrator And a Explorer who must Find a Car in Ancient China 2006.0000000000 1 None 3 4.99 48 12.99 2006-02-15 05:03:42 */ CREATE TABLE film_actor ( actor_id INTEGER NOT NULL, film_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id, film_id), FOREIGN KEY(actor_id) REFERENCES actor (actor_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) /* 2 rows from film_actor table: actor_id film_id last_update 1 1 2006-02-15 05:05:03 1 23 2006-02-15 05:05:03 */ CREATE TABLE film_category ( film_id INTEGER NOT NULL, category_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id, category_id), FOREIGN KEY(film_id) REFERENCES film (film_id), FOREIGN KEY(category_id) REFERENCES category (category_id) ) /* 2 rows from film_category table: film_id category_id last_update 1 6 2006-02-15 05:07:09 2 11 2006-02-15 05:07:09 */ CREATE TABLE film_text ( film_id SMALLINT NOT NULL, title VARCHAR(255) NOT NULL, description TEXT, PRIMARY KEY (film_id) ) /* 2 rows from film_text table: film_id title description */ CREATE TABLE inventory ( inventory_id INTEGER NOT NULL, film_id INTEGER NOT NULL, store_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (inventory_id), FOREIGN KEY(store_id) REFERENCES store (store_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) /* 2 rows from inventory table: inventory_id film_id store_id last_update 1 1 1 2006-02-15 05:09:17 2 1 1 2006-02-15 05:09:17 */ CREATE TABLE language ( language_id INTEGER NOT NULL, name CHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (language_id) ) /* 2 rows from language table: language_id name last_update */ CREATE TABLE payment ( payment_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, staff_id INTEGER NOT NULL, rental_id INTEGER DEFAULT NULL, amount DECIMAL(5, 2) NOT NULL, payment_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (payment_id), FOREIGN KEY(rental_id) REFERENCES rental (rental_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id) ) /* 2 rows from payment table: payment_id customer_id staff_id rental_id amount payment_date last_update 1 1 1 76 2.99 2005-05-25 11:30:37 2006-02-15 22:12:30 2 1 1 573 0.99 2005-05-28 10:35:23 2006-02-15 22:12:30 */ CREATE TABLE rental ( rental_id INTEGER NOT NULL, rental_date DATETIME NOT NULL, inventory_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, return_date DATETIME DEFAULT NULL, staff_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (rental_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory (inventory_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id) ) /* 2 rows from rental table: rental_id rental_date inventory_id customer_id return_date staff_id last_update 1 2005-05-24 22:53:30 367 130 2005-05-26 22:04:30 1 2006-02-15 21:30:53 2 2005-05-24 22:54:33 1525 459 2005-05-28 19:40:33 1 2006-02-15 21:30:53 */ CREATE TABLE staff ( staff_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, address_id INTEGER NOT NULL, picture BLOB DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, store_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, username VARCHAR(16) NOT NULL, password VARCHAR(40) DEFAULT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) ) /* 2 rows from staff table: staff_id first_name last_name address_id picture email store_id active username password last_update */ CREATE TABLE store ( store_id INTEGER NOT NULL, manager_staff_id INTEGER NOT NULL, address_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (store_id), FOREIGN KEY(manager_staff_id) REFERENCES staff (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) ) /* 2 rows from store table: store_id manager_staff_id address_id last_update */
Which language does the film AIRPORT POLLOCK use? List the language name.
SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK'
[{'Nenhum': 'Nenhum resultado encontrado'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
csu_1
CREATE TABLE "Campuses" ( "Id" INTEGER, "Campus" TEXT, "Location" TEXT, "County" TEXT, "Year" INTEGER, PRIMARY KEY ("Id") ) CREATE TABLE csu_fees ( "Campus" INTEGER, "Year" INTEGER, "CampusFee" INTEGER, PRIMARY KEY ("Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE degrees ( "Year" INTEGER, "Campus" INTEGER, "Degrees" INTEGER, PRIMARY KEY ("Year", "Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE discipline_enrollments ( "Campus" INTEGER, "Discipline" INTEGER, "Year" INTEGER, "Undergraduate" INTEGER, "Graduate" INTEGER, PRIMARY KEY ("Campus", "Discipline"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE enrollments ( "Campus" INTEGER, "Year" INTEGER, "TotalEnrollment_AY" INTEGER, "FTE_AY" INTEGER, PRIMARY KEY ("Campus", "Year"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) CREATE TABLE faculty ( "Campus" INTEGER, "Year" INTEGER, "Faculty" REAL, FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") )
CREATE TABLE "Campuses" ( "Id" INTEGER, "Campus" TEXT, "Location" TEXT, "County" TEXT, "Year" INTEGER, PRIMARY KEY ("Id") ) /* 2 rows from Campuses table: Id Campus Location County Year 1 California State University-Bakersfield Bakersfield Kern 1965 2 California State University-Channel Islands Camarillo Ventura 2002 */ CREATE TABLE csu_fees ( "Campus" INTEGER, "Year" INTEGER, "CampusFee" INTEGER, PRIMARY KEY ("Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from csu_fees table: Campus Year CampusFee 1 1996 1951 2 2003 1868 */ CREATE TABLE degrees ( "Year" INTEGER, "Campus" INTEGER, "Degrees" INTEGER, PRIMARY KEY ("Year", "Campus"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from degrees table: Year Campus Degrees 1990 1 701 1991 1 681 */ CREATE TABLE discipline_enrollments ( "Campus" INTEGER, "Discipline" INTEGER, "Year" INTEGER, "Undergraduate" INTEGER, "Graduate" INTEGER, PRIMARY KEY ("Campus", "Discipline"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from discipline_enrollments table: Campus Discipline Year Undergraduate Graduate 1 4 2004 248 0 1 5 2004 811 73 */ CREATE TABLE enrollments ( "Campus" INTEGER, "Year" INTEGER, "TotalEnrollment_AY" INTEGER, "FTE_AY" INTEGER, PRIMARY KEY ("Campus", "Year"), FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from enrollments table: Campus Year TotalEnrollment_AY FTE_AY 1 1956 384 123 1 1957 432 151 */ CREATE TABLE faculty ( "Campus" INTEGER, "Year" INTEGER, "Faculty" REAL, FOREIGN KEY("Campus") REFERENCES "Campuses" ("Id") ) /* 2 rows from faculty table: Campus Year Faculty 1 2002 357.1 2 2002 48.4 */
For each Orange county campus, report the number of degrees granted after 2000.
SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus
[{'Campus': 'California State University-Fullerton', 'sum(T2.degrees)': 26211}]
Medium
false
false
false
false
false
true
false
true
false
false
false
false
false
entrepreneur
CREATE TABLE entrepreneur ( "Entrepreneur_ID" INTEGER, "People_ID" INTEGER, "Company" TEXT, "Money_Requested" REAL, "Investor" TEXT, PRIMARY KEY ("Entrepreneur_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) CREATE TABLE people ( "People_ID" INTEGER, "Name" TEXT, "Height" REAL, "Weight" REAL, "Date_of_Birth" TEXT, PRIMARY KEY ("People_ID") )
CREATE TABLE entrepreneur ( "Entrepreneur_ID" INTEGER, "People_ID" INTEGER, "Company" TEXT, "Money_Requested" REAL, "Investor" TEXT, PRIMARY KEY ("Entrepreneur_ID"), FOREIGN KEY("People_ID") REFERENCES people ("People_ID") ) /* 2 rows from entrepreneur table: Entrepreneur_ID People_ID Company Money_Requested Investor 1 1 Umbrolly 150000.0 Duncan Bannatyne 2 2 Grails Ltd 120000.0 Doug Richard */ CREATE TABLE people ( "People_ID" INTEGER, "Name" TEXT, "Height" REAL, "Weight" REAL, "Date_of_Birth" TEXT, PRIMARY KEY ("People_ID") ) /* 2 rows from people table: People_ID Name Height Weight Date_of_Birth 1 Francesco Postiglione 1.9 80.0 1972-04-29 2 Leonardo Binchi 1.86 57.0 1975-08-27 */
List the companies and the investors of entrepreneurs.
SELECT Company , Investor FROM entrepreneur
[{'Company': 'Umbrolly', 'Investor': 'Duncan Bannatyne'}, {'Company': 'Grails Ltd', 'Investor': 'Doug Richard'}, {'Company': 'Le Beanock', 'Investor': 'Rachel Elnaugh'}, {'Company': 'IV Cam', 'Investor': 'Peter Jones'}, {'Company': 'Mycorrhizal Systems', 'Investor': 'Simon Woodroffe'}, {'Company': 'Elizabeth Galton Ltd', 'Investor': 'Duncan Bannatyne'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
storm_record
CREATE TABLE affected_region ( "Region_id" INTEGER, "Storm_ID" INTEGER, "Number_city_affected" REAL, PRIMARY KEY ("Region_id", "Storm_ID"), FOREIGN KEY("Storm_ID") REFERENCES storm ("Storm_ID"), FOREIGN KEY("Region_id") REFERENCES region ("Region_id") ) CREATE TABLE region ( "Region_id" INTEGER, "Region_code" TEXT, "Region_name" TEXT, PRIMARY KEY ("Region_id") ) CREATE TABLE storm ( "Storm_ID" INTEGER, "Name" TEXT, "Dates_active" TEXT, "Max_speed" INTEGER, "Damage_millions_USD" REAL, "Number_Deaths" INTEGER, PRIMARY KEY ("Storm_ID") )
CREATE TABLE affected_region ( "Region_id" INTEGER, "Storm_ID" INTEGER, "Number_city_affected" REAL, PRIMARY KEY ("Region_id", "Storm_ID"), FOREIGN KEY("Storm_ID") REFERENCES storm ("Storm_ID"), FOREIGN KEY("Region_id") REFERENCES region ("Region_id") ) /* 2 rows from affected_region table: Region_id Storm_ID Number_city_affected 1 1 10.0 2 1 15.0 */ CREATE TABLE region ( "Region_id" INTEGER, "Region_code" TEXT, "Region_name" TEXT, PRIMARY KEY ("Region_id") ) /* 2 rows from region table: Region_id Region_code Region_name 1 AF Afghanistan 2 AL Albania */ CREATE TABLE storm ( "Storm_ID" INTEGER, "Name" TEXT, "Dates_active" TEXT, "Max_speed" INTEGER, "Damage_millions_USD" REAL, "Number_Deaths" INTEGER, PRIMARY KEY ("Storm_ID") ) /* 2 rows from storm table: Storm_ID Name Dates_active Max_speed Damage_millions_USD Number_Deaths 1 One May19–May25 995 13.0 0 2 Two August3–August10 972 10.75 7 */
What are the names of storms that did not affect any regions?
SELECT name FROM storm WHERE storm_id NOT IN (SELECT storm_id FROM affected_region)
[{'Name': 'Two'}, {'Name': 'Six'}, {'Name': 'Seven'}, {'Name': 'Eight'}, {'Name': 'Nine'}, {'Name': '9 cyclones'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
college_2
CREATE TABLE advisor ( "s_ID" VARCHAR(5), "i_ID" VARCHAR(5), PRIMARY KEY ("s_ID"), FOREIGN KEY("i_ID") REFERENCES instructor ("ID"), FOREIGN KEY("s_ID") REFERENCES student ("ID") ) CREATE TABLE classroom ( building VARCHAR(15), room_number VARCHAR(7), capacity NUMERIC(4, 0), PRIMARY KEY (building, room_number) ) CREATE TABLE course ( course_id VARCHAR(8), title VARCHAR(50), dept_name VARCHAR(20), credits NUMERIC(2, 0), PRIMARY KEY (course_id), FOREIGN KEY(dept_name) REFERENCES department (dept_name), CHECK (credits > 0) ) CREATE TABLE department ( dept_name VARCHAR(20), building VARCHAR(15), budget NUMERIC(12, 2), PRIMARY KEY (dept_name), CHECK (budget > 0) ) CREATE TABLE instructor ( "ID" VARCHAR(5), name VARCHAR(20) NOT NULL, dept_name VARCHAR(20), salary NUMERIC(8, 2), PRIMARY KEY ("ID"), FOREIGN KEY(dept_name) REFERENCES department (dept_name), CHECK (salary > 29000) ) CREATE TABLE prereq ( course_id VARCHAR(8), prereq_id VARCHAR(8), PRIMARY KEY (course_id, prereq_id), FOREIGN KEY(course_id) REFERENCES course (course_id), FOREIGN KEY(prereq_id) REFERENCES course (course_id) ) CREATE TABLE section ( course_id VARCHAR(8), sec_id VARCHAR(8), semester VARCHAR(6), year NUMERIC(4, 0), building VARCHAR(15), room_number VARCHAR(7), time_slot_id VARCHAR(4), PRIMARY KEY (course_id, sec_id, semester, year), FOREIGN KEY(course_id) REFERENCES course (course_id), FOREIGN KEY(building, room_number) REFERENCES classroom (building, room_number), CHECK (semester in ('Fall', 'Winter', 'Spring', 'Summer')), CHECK (year > 1701 and year < 2100) ) CREATE TABLE student ( "ID" VARCHAR(5), name VARCHAR(20) NOT NULL, dept_name VARCHAR(20), tot_cred NUMERIC(3, 0), PRIMARY KEY ("ID"), FOREIGN KEY(dept_name) REFERENCES department (dept_name), CHECK (tot_cred >= 0) ) CREATE TABLE takes ( "ID" VARCHAR(5), course_id VARCHAR(8), sec_id VARCHAR(8), semester VARCHAR(6), year NUMERIC(4, 0), grade VARCHAR(2), PRIMARY KEY ("ID", course_id, sec_id, semester, year), FOREIGN KEY(course_id, sec_id, semester, year) REFERENCES section (course_id, sec_id, semester, year), FOREIGN KEY("ID") REFERENCES student ("ID") ) CREATE TABLE teaches ( "ID" VARCHAR(5), course_id VARCHAR(8), sec_id VARCHAR(8), semester VARCHAR(6), year NUMERIC(4, 0), PRIMARY KEY ("ID", course_id, sec_id, semester, year), FOREIGN KEY(course_id, sec_id, semester, year) REFERENCES section (course_id, sec_id, semester, year), FOREIGN KEY("ID") REFERENCES instructor ("ID") ) CREATE TABLE time_slot ( time_slot_id VARCHAR(4), day VARCHAR(1), start_hr NUMERIC(2), start_min NUMERIC(2), end_hr NUMERIC(2), end_min NUMERIC(2), PRIMARY KEY (time_slot_id, day, start_hr, start_min), CHECK (start_hr >= 0 and start_hr < 24), CHECK (start_min >= 0 and start_min < 60), CHECK (end_hr >= 0 and end_hr < 24), CHECK (end_min >= 0 and end_min < 60) )
CREATE TABLE advisor ( "s_ID" VARCHAR(5), "i_ID" VARCHAR(5), PRIMARY KEY ("s_ID"), FOREIGN KEY("i_ID") REFERENCES instructor ("ID"), FOREIGN KEY("s_ID") REFERENCES student ("ID") ) /* 2 rows from advisor table: s_ID i_ID 24746 19368 79352 95030 */ CREATE TABLE classroom ( building VARCHAR(15), room_number VARCHAR(7), capacity NUMERIC(4, 0), PRIMARY KEY (building, room_number) ) /* 2 rows from classroom table: building room_number capacity Lamberton 134 10 Chandler 375 10 */ CREATE TABLE course ( course_id VARCHAR(8), title VARCHAR(50), dept_name VARCHAR(20), credits NUMERIC(2, 0), PRIMARY KEY (course_id), FOREIGN KEY(dept_name) REFERENCES department (dept_name), CHECK (credits > 0) ) /* 2 rows from course table: course_id title dept_name credits 787 C Programming Mech. Eng. 4 238 The Music of Donovan Mech. Eng. 3 */ CREATE TABLE department ( dept_name VARCHAR(20), building VARCHAR(15), budget NUMERIC(12, 2), PRIMARY KEY (dept_name), CHECK (budget > 0) ) /* 2 rows from department table: dept_name building budget Civil Eng. Chandler 255041.46 Biology Candlestick 647610.55 */ CREATE TABLE instructor ( "ID" VARCHAR(5), name VARCHAR(20) NOT NULL, dept_name VARCHAR(20), salary NUMERIC(8, 2), PRIMARY KEY ("ID"), FOREIGN KEY(dept_name) REFERENCES department (dept_name), CHECK (salary > 29000) ) /* 2 rows from instructor table: ID name dept_name salary 63395 McKinnon Cybernetics 94333.99 78699 Pingr Statistics 59303.62 */ CREATE TABLE prereq ( course_id VARCHAR(8), prereq_id VARCHAR(8), PRIMARY KEY (course_id, prereq_id), FOREIGN KEY(course_id) REFERENCES course (course_id), FOREIGN KEY(prereq_id) REFERENCES course (course_id) ) /* 2 rows from prereq table: course_id prereq_id 376 130 760 169 */ CREATE TABLE section ( course_id VARCHAR(8), sec_id VARCHAR(8), semester VARCHAR(6), year NUMERIC(4, 0), building VARCHAR(15), room_number VARCHAR(7), time_slot_id VARCHAR(4), PRIMARY KEY (course_id, sec_id, semester, year), FOREIGN KEY(course_id) REFERENCES course (course_id), FOREIGN KEY(building, room_number) REFERENCES classroom (building, room_number), CHECK (semester in ('Fall', 'Winter', 'Spring', 'Summer')), CHECK (year > 1701 and year < 2100) ) /* 2 rows from section table: course_id sec_id semester year building room_number time_slot_id 313 1 Fall 2010 Chandler 804 N 747 1 Spring 2004 Gates 314 K */ CREATE TABLE student ( "ID" VARCHAR(5), name VARCHAR(20) NOT NULL, dept_name VARCHAR(20), tot_cred NUMERIC(3, 0), PRIMARY KEY ("ID"), FOREIGN KEY(dept_name) REFERENCES department (dept_name), CHECK (tot_cred >= 0) ) /* 2 rows from student table: ID name dept_name tot_cred 24746 Schrefl History 4 79352 Rumat Finance 100 */ CREATE TABLE takes ( "ID" VARCHAR(5), course_id VARCHAR(8), sec_id VARCHAR(8), semester VARCHAR(6), year NUMERIC(4, 0), grade VARCHAR(2), PRIMARY KEY ("ID", course_id, sec_id, semester, year), FOREIGN KEY(course_id, sec_id, semester, year) REFERENCES section (course_id, sec_id, semester, year), FOREIGN KEY("ID") REFERENCES student ("ID") ) /* 2 rows from takes table: ID course_id sec_id semester year grade 65901 401 1 Fall 2003 C- 24932 802 1 Spring 2003 B- */ CREATE TABLE teaches ( "ID" VARCHAR(5), course_id VARCHAR(8), sec_id VARCHAR(8), semester VARCHAR(6), year NUMERIC(4, 0), PRIMARY KEY ("ID", course_id, sec_id, semester, year), FOREIGN KEY(course_id, sec_id, semester, year) REFERENCES section (course_id, sec_id, semester, year), FOREIGN KEY("ID") REFERENCES instructor ("ID") ) /* 2 rows from teaches table: ID course_id sec_id semester year 34175 747 1 Spring 2004 3199 169 1 Spring 2007 */ CREATE TABLE time_slot ( time_slot_id VARCHAR(4), day VARCHAR(1), start_hr NUMERIC(2), start_min NUMERIC(2), end_hr NUMERIC(2), end_min NUMERIC(2), PRIMARY KEY (time_slot_id, day, start_hr, start_min), CHECK (start_hr >= 0 and start_hr < 24), CHECK (start_min >= 0 and start_min < 60), CHECK (end_hr >= 0 and end_hr < 24), CHECK (end_min >= 0 and end_min < 60) ) /* 2 rows from time_slot table: time_slot_id day start_hr start_min end_hr end_min A M 8.0000000000 0E-10 8.0000000000 50.0000000000 A W 8.0000000000 0E-10 8.0000000000 50.0000000000 */
Find the number of rooms with more than 50 capacity for each building.
SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building
[{'count(*)': 1, 'building': 'Garfield'}, {'count(*)': 1, 'building': 'Gates'}, {'count(*)': 1, 'building': 'Lambeau'}, {'count(*)': 1, 'building': 'Nassau'}, {'count(*)': 1, 'building': 'Painter'}, {'count(*)': 1, 'building': 'Rathbone'}, {'count(*)': 1, 'building': 'Saucon'}, {'count(*)': 1, 'building': 'Stabler'}, {'count(*)': 2, 'building': 'Taylor'}, {'count(*)': 1, 'building': 'Whitman'}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
[QUESTION]Find the number of classes offered for all class rooms that held at least 2 classes.[/QUESTION] [SQL]SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2[/SQL]
[QUESTION]Find the number of classes offered for all class rooms that held at least 2 classes.[/QUESTION] [SQL]SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2[/SQL]
[QUESTION]Find the number of classes offered for all class rooms that held at least 2 classes.[/QUESTION] [SQL]SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2[/SQL]
small_bank_1
CREATE TABLE "ACCOUNTS" ( custid BIGINT NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY (custid) ) CREATE TABLE "CHECKING" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) ) CREATE TABLE "SAVINGS" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) )
CREATE TABLE "ACCOUNTS" ( custid BIGINT NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY (custid) ) /* 2 rows from ACCOUNTS table: custid name 1 Brown 2 Wang */ CREATE TABLE "CHECKING" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) ) /* 2 rows from CHECKING table: custid balance 1 10000.0 2 2000.0 */ CREATE TABLE "SAVINGS" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) ) /* 2 rows from SAVINGS table: custid balance 1 200000.0 2 999999999.0 */
Find the name and checking balance of the account with the lowest savings balance.
SELECT T1.name , T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1
[{'name': 'Weeks', 'balance': 7000.0}]
Hard
false
false
false
true
true
false
false
false
true
false
false
false
false
[QUESTION]Find the name, account type, and account balance of the customer who has the highest credit score.[/QUESTION] [SQL]SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1[/SQL]
[QUESTION]Find the name, account type, and account balance of the customer who has the highest credit score.[/QUESTION] [SQL]SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1[/SQL]
[QUESTION]Find the name, account type, and account balance of the customer who has the highest credit score.[/QUESTION] [SQL]SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1[/SQL]
[QUESTION]Find the name, account type, and account balance of the customer who has the highest credit score.[/QUESTION] [SQL]SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1[/SQL]
music_2
CREATE TABLE "Albums" ( "AId" INTEGER, "Title" TEXT, "Year" INTEGER, "Label" TEXT, "Type" TEXT, PRIMARY KEY ("AId") ) CREATE TABLE "Band" ( "Id" INTEGER, "Firstname" TEXT, "Lastname" TEXT, PRIMARY KEY ("Id") ) CREATE TABLE "Instruments" ( "SongId" INTEGER, "BandmateId" INTEGER, "Instrument" TEXT, PRIMARY KEY ("SongId", "BandmateId", "Instrument"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("BandmateId") REFERENCES "Band" ("Id") ) CREATE TABLE "Performance" ( "SongId" INTEGER, "Bandmate" INTEGER, "StagePosition" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") ) CREATE TABLE "Songs" ( "SongId" INTEGER, "Title" TEXT, PRIMARY KEY ("SongId") ) CREATE TABLE "Tracklists" ( "AlbumId" INTEGER, "Position" INTEGER, "SongId" INTEGER, PRIMARY KEY ("AlbumId", "Position"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("AlbumId") REFERENCES "Albums" ("AId") ) CREATE TABLE "Vocals" ( "SongId" INTEGER, "Bandmate" INTEGER, "Type" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") )
CREATE TABLE "Albums" ( "AId" INTEGER, "Title" TEXT, "Year" INTEGER, "Label" TEXT, "Type" TEXT, PRIMARY KEY ("AId") ) /* 2 rows from Albums table: AId Title Year Label Type */ CREATE TABLE "Band" ( "Id" INTEGER, "Firstname" TEXT, "Lastname" TEXT, PRIMARY KEY ("Id") ) /* 2 rows from Band table: Id Firstname Lastname */ CREATE TABLE "Instruments" ( "SongId" INTEGER, "BandmateId" INTEGER, "Instrument" TEXT, PRIMARY KEY ("SongId", "BandmateId", "Instrument"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("BandmateId") REFERENCES "Band" ("Id") ) /* 2 rows from Instruments table: SongId BandmateId Instrument */ CREATE TABLE "Performance" ( "SongId" INTEGER, "Bandmate" INTEGER, "StagePosition" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") ) /* 2 rows from Performance table: SongId Bandmate StagePosition */ CREATE TABLE "Songs" ( "SongId" INTEGER, "Title" TEXT, PRIMARY KEY ("SongId") ) /* 2 rows from Songs table: SongId Title */ CREATE TABLE "Tracklists" ( "AlbumId" INTEGER, "Position" INTEGER, "SongId" INTEGER, PRIMARY KEY ("AlbumId", "Position"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("AlbumId") REFERENCES "Albums" ("AId") ) /* 2 rows from Tracklists table: AlbumId Position SongId */ CREATE TABLE "Vocals" ( "SongId" INTEGER, "Bandmate" INTEGER, "Type" TEXT, PRIMARY KEY ("SongId", "Bandmate"), FOREIGN KEY("SongId") REFERENCES "Songs" ("SongId"), FOREIGN KEY("Bandmate") REFERENCES "Band" ("Id") ) /* 2 rows from Vocals table: SongId Bandmate Type */
What is the type of vocals that the band member with the last name "Heilo" played the most?
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = "Heilo" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
[{'Nenhum': 'Nenhum resultado encontrado'}]
Medium
false
false
false
true
true
true
false
true
false
false
false
false
false
college_3
CREATE TABLE "Course" ( "CID" VARCHAR(7), "CName" VARCHAR(40), "Credits" INTEGER, "Instructor" INTEGER, "Days" VARCHAR(5), "Hours" VARCHAR(11), "DNO" INTEGER, PRIMARY KEY ("CID"), FOREIGN KEY("Instructor") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) CREATE TABLE "Department" ( "DNO" INTEGER, "Division" VARCHAR(2), "DName" VARCHAR(25), "Room" VARCHAR(5), "Building" VARCHAR(13), "DPhone" INTEGER, PRIMARY KEY ("DNO") ) CREATE TABLE "Enrolled_in" ( "StuID" INTEGER, "CID" VARCHAR(7), "Grade" VARCHAR(2), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("CID") REFERENCES "Course" ("CID"), FOREIGN KEY("Grade") REFERENCES "Gradeconversion" (lettergrade) ) CREATE TABLE "Faculty" ( "FacID" INTEGER, "Lname" VARCHAR(15), "Fname" VARCHAR(15), "Rank" VARCHAR(15), "Sex" VARCHAR(1), "Phone" INTEGER, "Room" VARCHAR(5), "Building" VARCHAR(13), PRIMARY KEY ("FacID") ) CREATE TABLE "Gradeconversion" ( lettergrade VARCHAR(2), gradepoint FLOAT, PRIMARY KEY (lettergrade) ) CREATE TABLE "Member_of" ( "FacID" INTEGER, "DNO" INTEGER, "Appt_Type" VARCHAR(15), FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) CREATE TABLE "Minor_in" ( "StuID" INTEGER, "DNO" INTEGER, FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Course" ( "CID" VARCHAR(7), "CName" VARCHAR(40), "Credits" INTEGER, "Instructor" INTEGER, "Days" VARCHAR(5), "Hours" VARCHAR(11), "DNO" INTEGER, PRIMARY KEY ("CID"), FOREIGN KEY("Instructor") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) /* 2 rows from Course table: CID CName Credits Instructor Days Hours DNO 600.101 COMPUTER LITERACY 3 6112 MTW 3 600 600.103 INTRODUCTION TO COMPUTER SCIENCE 1 4230 Th 4 600 */ CREATE TABLE "Department" ( "DNO" INTEGER, "Division" VARCHAR(2), "DName" VARCHAR(25), "Room" VARCHAR(5), "Building" VARCHAR(13), "DPhone" INTEGER, PRIMARY KEY ("DNO") ) /* 2 rows from Department table: DNO Division DName Room Building DPhone 10 AS History of Art 268 Mergenthaler 7117 20 AS Biology 144 Mudd 7330 */ CREATE TABLE "Enrolled_in" ( "StuID" INTEGER, "CID" VARCHAR(7), "Grade" VARCHAR(2), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("CID") REFERENCES "Course" ("CID"), FOREIGN KEY("Grade") REFERENCES "Gradeconversion" (lettergrade) ) /* 2 rows from Enrolled_in table: StuID CID Grade 1001 550.681 A- 1001 600.303 B */ CREATE TABLE "Faculty" ( "FacID" INTEGER, "Lname" VARCHAR(15), "Fname" VARCHAR(15), "Rank" VARCHAR(15), "Sex" VARCHAR(1), "Phone" INTEGER, "Room" VARCHAR(5), "Building" VARCHAR(13), PRIMARY KEY ("FacID") ) /* 2 rows from Faculty table: FacID Lname Fname Rank Sex Phone Room Building 1082 Giuliano Mark Instructor M 2424 224 NEB 1121 Goodrich Michael Professor M 3593 219 NEB */ CREATE TABLE "Gradeconversion" ( lettergrade VARCHAR(2), gradepoint FLOAT, PRIMARY KEY (lettergrade) ) /* 2 rows from Gradeconversion table: lettergrade gradepoint A+ 4.0 A 4.0 */ CREATE TABLE "Member_of" ( "FacID" INTEGER, "DNO" INTEGER, "Appt_Type" VARCHAR(15), FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) /* 2 rows from Member_of table: FacID DNO Appt_Type 7792 600 Primary 9210 520 Primary */ CREATE TABLE "Minor_in" ( "StuID" INTEGER, "DNO" INTEGER, FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) /* 2 rows from Minor_in table: StuID DNO 1004 520 1005 550 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
Count the number of courses with more than 2 credits.
SELECT count(*) FROM COURSE WHERE Credits > 2
[{'count(*)': 71}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]How many courses in total are listed?[/QUESTION] [SQL]SELECT count(*) FROM Courses[/SQL]
[QUESTION]How many courses in total are listed?[/QUESTION] [SQL]SELECT count(*) FROM Courses[/SQL]
[QUESTION]How many courses in total are listed?[/QUESTION] [SQL]SELECT count(*) FROM Courses[/SQL]
[QUESTION]How many courses in total are listed?[/QUESTION] [SQL]SELECT count(*) FROM Courses[/SQL]
hr_1
CREATE TABLE countries ( "COUNTRY_ID" VARCHAR(2) NOT NULL, "COUNTRY_NAME" VARCHAR(40) DEFAULT NULL, "REGION_ID" DECIMAL(10, 0) DEFAULT NULL, PRIMARY KEY ("COUNTRY_ID"), FOREIGN KEY("REGION_ID") REFERENCES regions ("REGION_ID") ) CREATE TABLE departments ( "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "DEPARTMENT_NAME" VARCHAR(30) NOT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "LOCATION_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("DEPARTMENT_ID") ) CREATE TABLE employees ( "EMPLOYEE_ID" DECIMAL(6, 0) DEFAULT '0' NOT NULL, "FIRST_NAME" VARCHAR(20) DEFAULT NULL, "LAST_NAME" VARCHAR(25) NOT NULL, "EMAIL" VARCHAR(25) NOT NULL, "PHONE_NUMBER" VARCHAR(20) DEFAULT NULL, "HIRE_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "SALARY" DECIMAL(8, 2) DEFAULT NULL, "COMMISSION_PCT" DECIMAL(2, 2) DEFAULT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID") ) CREATE TABLE job_history ( "EMPLOYEE_ID" DECIMAL(6, 0) NOT NULL, "START_DATE" DATE NOT NULL, "END_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID", "START_DATE"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID"), FOREIGN KEY("EMPLOYEE_ID") REFERENCES employees ("EMPLOYEE_ID") ) CREATE TABLE jobs ( "JOB_ID" VARCHAR(10) DEFAULT '' NOT NULL, "JOB_TITLE" VARCHAR(35) NOT NULL, "MIN_SALARY" DECIMAL(6, 0) DEFAULT NULL, "MAX_SALARY" DECIMAL(6, 0) DEFAULT NULL, PRIMARY KEY ("JOB_ID") ) CREATE TABLE locations ( "LOCATION_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "STREET_ADDRESS" VARCHAR(40) DEFAULT NULL, "POSTAL_CODE" VARCHAR(12) DEFAULT NULL, "CITY" VARCHAR(30) NOT NULL, "STATE_PROVINCE" VARCHAR(25) DEFAULT NULL, "COUNTRY_ID" VARCHAR(2) DEFAULT NULL, PRIMARY KEY ("LOCATION_ID"), FOREIGN KEY("COUNTRY_ID") REFERENCES countries ("COUNTRY_ID") ) CREATE TABLE regions ( "REGION_ID" DECIMAL(5, 0) NOT NULL, "REGION_NAME" VARCHAR(25) DEFAULT NULL, PRIMARY KEY ("REGION_ID") )
CREATE TABLE countries ( "COUNTRY_ID" VARCHAR(2) NOT NULL, "COUNTRY_NAME" VARCHAR(40) DEFAULT NULL, "REGION_ID" DECIMAL(10, 0) DEFAULT NULL, PRIMARY KEY ("COUNTRY_ID"), FOREIGN KEY("REGION_ID") REFERENCES regions ("REGION_ID") ) /* 2 rows from countries table: COUNTRY_ID COUNTRY_NAME REGION_ID AR Argentina 2 AU Australia 3 */ CREATE TABLE departments ( "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "DEPARTMENT_NAME" VARCHAR(30) NOT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "LOCATION_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("DEPARTMENT_ID") ) /* 2 rows from departments table: DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID 10 Administration 200 1700 20 Marketing 201 1800 */ CREATE TABLE employees ( "EMPLOYEE_ID" DECIMAL(6, 0) DEFAULT '0' NOT NULL, "FIRST_NAME" VARCHAR(20) DEFAULT NULL, "LAST_NAME" VARCHAR(25) NOT NULL, "EMAIL" VARCHAR(25) NOT NULL, "PHONE_NUMBER" VARCHAR(20) DEFAULT NULL, "HIRE_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "SALARY" DECIMAL(8, 2) DEFAULT NULL, "COMMISSION_PCT" DECIMAL(2, 2) DEFAULT NULL, "MANAGER_ID" DECIMAL(6, 0) DEFAULT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID") ) /* 2 rows from employees table: EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID 100 Steven King SKING 515.123.4567 1987-06-17 AD_PRES 24000.00 0.00 0 90 101 Neena Kochhar NKOCHHAR 515.123.4568 1987-06-18 AD_VP 17000.00 0.00 100 90 */ CREATE TABLE job_history ( "EMPLOYEE_ID" DECIMAL(6, 0) NOT NULL, "START_DATE" DATE NOT NULL, "END_DATE" DATE NOT NULL, "JOB_ID" VARCHAR(10) NOT NULL, "DEPARTMENT_ID" DECIMAL(4, 0) DEFAULT NULL, PRIMARY KEY ("EMPLOYEE_ID", "START_DATE"), FOREIGN KEY("JOB_ID") REFERENCES jobs ("JOB_ID"), FOREIGN KEY("DEPARTMENT_ID") REFERENCES departments ("DEPARTMENT_ID"), FOREIGN KEY("EMPLOYEE_ID") REFERENCES employees ("EMPLOYEE_ID") ) /* 2 rows from job_history table: EMPLOYEE_ID START_DATE END_DATE JOB_ID DEPARTMENT_ID 102 1993-01-13 1998-07-24 IT_PROG 60 101 1989-09-21 1993-10-27 AC_ACCOUNT 110 */ CREATE TABLE jobs ( "JOB_ID" VARCHAR(10) DEFAULT '' NOT NULL, "JOB_TITLE" VARCHAR(35) NOT NULL, "MIN_SALARY" DECIMAL(6, 0) DEFAULT NULL, "MAX_SALARY" DECIMAL(6, 0) DEFAULT NULL, PRIMARY KEY ("JOB_ID") ) /* 2 rows from jobs table: JOB_ID JOB_TITLE MIN_SALARY MAX_SALARY AD_PRES President 20000 40000 AD_VP Administration Vice President 15000 30000 */ CREATE TABLE locations ( "LOCATION_ID" DECIMAL(4, 0) DEFAULT '0' NOT NULL, "STREET_ADDRESS" VARCHAR(40) DEFAULT NULL, "POSTAL_CODE" VARCHAR(12) DEFAULT NULL, "CITY" VARCHAR(30) NOT NULL, "STATE_PROVINCE" VARCHAR(25) DEFAULT NULL, "COUNTRY_ID" VARCHAR(2) DEFAULT NULL, PRIMARY KEY ("LOCATION_ID"), FOREIGN KEY("COUNTRY_ID") REFERENCES countries ("COUNTRY_ID") ) /* 2 rows from locations table: LOCATION_ID STREET_ADDRESS POSTAL_CODE CITY STATE_PROVINCE COUNTRY_ID 1000 1297 Via Cola di Rie 989 Roma IT 1100 93091 Calle della Testa 10934 Venice IT */ CREATE TABLE regions ( "REGION_ID" DECIMAL(5, 0) NOT NULL, "REGION_NAME" VARCHAR(25) DEFAULT NULL, PRIMARY KEY ("REGION_ID") ) /* 2 rows from regions table: REGION_ID REGION_NAME 1 Europe\r 2 Americas\r */
Give the first name and job id for all employees in the Finance department.
SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'
[{'FIRST_NAME': 'Nancy', 'JOB_ID': 'FI_MGR'}, {'FIRST_NAME': 'Daniel', 'JOB_ID': 'FI_ACCOUNT'}, {'FIRST_NAME': 'John', 'JOB_ID': 'FI_ACCOUNT'}, {'FIRST_NAME': 'Ismael', 'JOB_ID': 'FI_ACCOUNT'}, {'FIRST_NAME': 'Jose Manuel', 'JOB_ID': 'FI_ACCOUNT'}, {'FIRST_NAME': 'Luis', 'JOB_ID': 'FI_ACCOUNT'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
[QUESTION]List the first name of all employees with job code PROF ordered by their date of birth.[/QUESTION] [SQL]SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob[/SQL]
[QUESTION]List the first name of all employees with job code PROF ordered by their date of birth.[/QUESTION] [SQL]SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob[/SQL]
[QUESTION]List the first name of all employees with job code PROF ordered by their date of birth.[/QUESTION] [SQL]SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob[/SQL]
[QUESTION]List the first name of all employees with job code PROF ordered by their date of birth.[/QUESTION] [SQL]SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob[/SQL]
soccer_2
CREATE TABLE "College" ( "cName" VARCHAR(20) NOT NULL, state VARCHAR(2), enr NUMERIC(5, 0), PRIMARY KEY ("cName") ) CREATE TABLE "Player" ( "pID" NUMERIC(5, 0) NOT NULL, "pName" VARCHAR(20), "yCard" VARCHAR(3), "HS" NUMERIC(5, 0), PRIMARY KEY ("pID") ) CREATE TABLE "Tryout" ( "pID" NUMERIC(5, 0), "cName" VARCHAR(20), "pPos" VARCHAR(8), decision VARCHAR(3), PRIMARY KEY ("pID", "cName"), FOREIGN KEY("pID") REFERENCES "Player" ("pID"), FOREIGN KEY("cName") REFERENCES "College" ("cName") )
CREATE TABLE "College" ( "cName" VARCHAR(20) NOT NULL, state VARCHAR(2), enr NUMERIC(5, 0), PRIMARY KEY ("cName") ) /* 2 rows from College table: cName state enr LSU LA 18000 ASU AZ 12000 */ CREATE TABLE "Player" ( "pID" NUMERIC(5, 0) NOT NULL, "pName" VARCHAR(20), "yCard" VARCHAR(3), "HS" NUMERIC(5, 0), PRIMARY KEY ("pID") ) /* 2 rows from Player table: pID pName yCard HS 10001 Andrew no 1200 20002 Blake no 1600 */ CREATE TABLE "Tryout" ( "pID" NUMERIC(5, 0), "cName" VARCHAR(20), "pPos" VARCHAR(8), decision VARCHAR(3), PRIMARY KEY ("pID", "cName"), FOREIGN KEY("pID") REFERENCES "Player" ("pID"), FOREIGN KEY("cName") REFERENCES "College" ("cName") ) /* 2 rows from Tryout table: pID cName pPos decision 10001 LSU goalie no 10001 ASU goalie yes */
What is the name of school that has the smallest enrollment in each state?
SELECT cName , state , min(enr) FROM college GROUP BY state
[{'cName': 'ASU', 'state': 'AZ', 'min(enr)': 12000}, {'cName': 'FSU', 'state': 'FL', 'min(enr)': 19000}, {'cName': 'LSU', 'state': 'LA', 'min(enr)': 18000}, {'cName': 'OU', 'state': 'OK', 'min(enr)': 22000}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
[QUESTION]Which school has the smallest amount of professors?[/QUESTION] [SQL]SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1[/SQL]
[QUESTION]Which school has the smallest amount of professors?[/QUESTION] [SQL]SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1[/SQL]
[QUESTION]Which school has the smallest amount of professors?[/QUESTION] [SQL]SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1[/SQL]
[QUESTION]Which school has the smallest amount of professors?[/QUESTION] [SQL]SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1[/SQL]
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
name the 50 capitals in the usa
SELECT DISTINCT capital FROM state;
[{'Nenhum': 'Nenhum resultado encontrado'}]
Easy
true
false
false
false
false
false
false
false
false
false
false
false
false
manufactory_1
CREATE TABLE "Manufacturers" ( "Code" INTEGER, "Name" VARCHAR(255) NOT NULL, "Headquarter" VARCHAR(255) NOT NULL, "Founder" VARCHAR(255) NOT NULL, "Revenue" REAL, PRIMARY KEY ("Code") ) CREATE TABLE "Products" ( "Code" INTEGER, "Name" VARCHAR(255) NOT NULL, "Price" DECIMAL NOT NULL, "Manufacturer" INTEGER NOT NULL, PRIMARY KEY ("Code"), FOREIGN KEY("Manufacturer") REFERENCES "Manufacturers" ("Code") )
CREATE TABLE "Manufacturers" ( "Code" INTEGER, "Name" VARCHAR(255) NOT NULL, "Headquarter" VARCHAR(255) NOT NULL, "Founder" VARCHAR(255) NOT NULL, "Revenue" REAL, PRIMARY KEY ("Code") ) /* 2 rows from Manufacturers table: Code Name Headquarter Founder Revenue 1 Sony Tokyo Andy 120.0 2 Creative Labs Austin Owen 100.0 */ CREATE TABLE "Products" ( "Code" INTEGER, "Name" VARCHAR(255) NOT NULL, "Price" DECIMAL NOT NULL, "Manufacturer" INTEGER NOT NULL, PRIMARY KEY ("Code"), FOREIGN KEY("Manufacturer") REFERENCES "Manufacturers" ("Code") ) /* 2 rows from Products table: Code Name Price Manufacturer 1 Hard drive 240.0000000000 5 2 Memory 120.0000000000 6 */
Find the total revenue of companies of each founder.
SELECT sum(revenue) , founder FROM manufacturers GROUP BY founder
[{'sum(revenue)': 120.0, 'Founder': 'Andy'}, {'sum(revenue)': 50.0, 'Founder': 'James'}, {'sum(revenue)': 130.0, 'Founder': 'John'}, {'sum(revenue)': 200.0, 'Founder': 'Mary'}, {'sum(revenue)': 100.0, 'Founder': 'Owen'}, {'sum(revenue)': 30.0, 'Founder': 'Robert'}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
wine_1
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") )
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) /* 2 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No */ CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) /* 2 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red */ CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") ) /* 2 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now */
What are the names of wines whose production year are before the year of all wines by Brander winery?
SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = "Brander")
[{'Name': 'Old Kraft Vineyard'}, {'Name': 'Giana'}, {'Name': 'Black Chicken'}, {'Name': 'Napa Ranches'}, {'Name': 'Varozza Vineyard'}, {'Name': 'Mother Clone'}, {'Name': 'Zinfandel'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'LApres-Midi'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Asatsuyu'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Handley Vineyard'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Pritchard Hill'}, {'Name': 'Reserve'}, {'Name': 'Neyers Ranch - Conn Valley'}, {'Name': 'Annum'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Beckstoffer To Kalon Vineyard'}, {'Name': 'Coliseum Block'}, {'Name': '1886'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Beckstoffer To Kalon Vineyard'}, {'Name': 'Couer de Valee'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Amber Ridge Vineyard'}, {'Name': 'Keefer Ranch'}, {'Name': 'Koplen Vineyard'}, {'Name': 'Freestone Hill'}, {'Name': 'Julias Vineyard'}, {'Name': 'Carneros Hyde Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Garys Vineyard'}, {'Name': 'Kanzler Vineyard'}, {'Name': 'Five Sisters'}, {'Name': 'Pisoni Vineyard'}, {'Name': 'Rosellas Vineyard'}, {'Name': 'Kanzler Vineyard'}, {'Name': 'Valley Bliss Block'}, {'Name': 'Pinot Noir'}, {'Name': 'Lancel Creek Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': '4-Barrel'}, {'Name': 'Gaps Crown Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Reserve'}, {'Name': 'A by Acacia'}, {'Name': 'La Encantada Vineyard'}, {'Name': 'La Encantada Vineyard Clone 667'}, {'Name': 'Estate Reserve'}, {'Name': 'Carneros'}, {'Name': 'Pinot Noir'}, {'Name': 'Garys Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Sarmento Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Henry Ranch'}, {'Name': 'Pinot Noir'}, {'Name': 'Kali Hart'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Sleepy Hollow Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Syrah'}, {'Name': 'Eddies Patch'}, {'Name': 'Merlot'}, {'Name': 'Reserve'}, {'Name': 'Darius II'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Hillstone Vineyard'}, {'Name': 'Tomahawk Vineyard'}, {'Name': 'Elevage'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Neruda Brix Vineyard'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'In the Crosshairs Eleven Confessions Vineyard'}, {'Name': 'On the Road'}, {'Name': 'Garnacha Denner Vineyard'}, {'Name': 'Purisma Mountain Vineyard'}, {'Name': 'Romeo'}, {'Name': 'Foggy Knoll Vineyard'}, {'Name': 'Anns Block'}, {'Name': 'Kick Ranch'}, {'Name': 'Hayne Vineyard'}, {'Name': 'Sweetwater Springs Vineyard'}, {'Name': 'Petite Sirah'}, {'Name': 'Pinot Noir'}, {'Name': 'Limited Release'}, {'Name': 'Pinot Noir'}, {'Name': 'A Shot in the Dark Eleven Confessions Vineyard'}, {'Name': 'Quarzo'}, {'Name': 'Rosellas Vineyard'}, {'Name': 'Cardiac Hill'}, {'Name': 'Larner Vinyard'}, {'Name': 'White Hawk Vineyard'}, {'Name': 'Mesa Reserve'}, {'Name': 'Twist of Fate'}, {'Name': 'Syrah'}, {'Name': 'Garys Vineyard'}, {'Name': 'Kemp Vineyard'}, {'Name': 'Christensen Family Vineyard'}, {'Name': 'Melville Vineyards'}, {'Name': 'Syrah'}, {'Name': 'The Flight'}, {'Name': 'Syrah'}, {'Name': 'England-Shaw'}, {'Name': 'La Cruz Vineyard'}, {'Name': 'Syrah'}, {'Name': 'Syrah'}, {'Name': 'Syrah'}, {'Name': 'Snows Lake Vineyard'}, {'Name': 'Abba Vineyard'}, {'Name': 'Originals'}, {'Name': 'Que Syrah Vineyard'}, {'Name': 'Gesture Limited Release'}, {'Name': 'Star Angel '}, {'Name': 'Kick Ranch Reserve'}, {'Name': 'Syrah'}, {'Name': 'Syrah'}, {'Name': 'Les Cotes De LOuest'}, {'Name': 'Shiraz'}, {'Name': 'Carlisle Vineyard'}, {'Name': 'Cedarman'}, {'Name': 'Tofanelli Vineyard'}, {'Name': 'Private Reserve'}, {'Name': 'Fredericks Vineyard'}, {'Name': 'Rossi Ranch'}, {'Name': 'Treborce Vineyard'}, {'Name': 'Wild Oak Old Vines'}, {'Name': 'Old Vine'}, {'Name': 'Wheelhouse'}, {'Name': 'Zinfandel'}, {'Name': 'SHR Field Blend'}, {'Name': 'Lot 154'}, {'Name': 'Edizione Pennino'}, {'Name': 'La Cruz Vineyard'}, {'Name': 'Signature'}, {'Name': 'Loco'}, {'Name': 'Bailey Vineyard'}, {'Name': 'Twenty Two'}, {'Name': 'Larner Vinyard'}, {'Name': 'Black Bart Stagecoach Vineyard'}, {'Name': 'Polomita Hamilton Vineyard'}, {'Name': 'Rominger Vineyard'}, {'Name': 'Maverick'}, {'Name': 'VGS'}, {'Name': 'Amber Ridge Vineyard'}, {'Name': 'Roll Ranch Vineyard'}, {'Name': 'Guidici Famili Vineyard'}, {'Name': 'Savoy Vineyard'}, {'Name': 'The Backbone'}, {'Name': 'Laurels Estate Vineyard'}, {'Name': 'Bynum & Moshin Vineyards'}, {'Name': 'Jensen Vineyard'}, {'Name': 'Rockpile Road Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Thirtieth Anniverasry Vintage Mt. Harlan Cuvee'}, {'Name': 'Green River Isobel'}, {'Name': 'Sengiacomo Vineyard'}, {'Name': 'Lorenzo'}, {'Name': 'Chloe'}, {'Name': 'Chardonnay'}, {'Name': 'Signature'}, {'Name': 'Stagecoach Vineyard Black Bart'}, {'Name': 'Home Ranch'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Reserve'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Stagecoach Vineyard'}, {'Name': 'Ten-Goal Happy Canyon Vineyards'}, {'Name': 'The Ranch'}, {'Name': 'Napa Cuvee'}, {'Name': 'Monte Rosso Vineyard'}, {'Name': 'Beckstoffer To Kalon Vineyard'}, {'Name': 'Reserve'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Dr. Crane Vineyard'}, {'Name': 'Boonflys Hill'}, {'Name': 'McCrea Vineyard'}, {'Name': 'Ma Belle-Fille'}, {'Name': 'Durell Vineyard'}, {'Name': 'Durell Vineyard Wente Clone'}, {'Name': 'Estate Vineyard'}, {'Name': 'Wine Hill Vineyard'}, {'Name': 'Belle Cote'}, {'Name': 'Mon Plaisir'}, {'Name': 'Untilited #3'}, {'Name': 'Reserve'}, {'Name': 'Los Alamos Vineyard Historic Vineyards Collection'}, {'Name': 'Hyde Vineyards'}, {'Name': 'Hudson Vineyard'}, {'Name': 'Damaris Reserve '}, {'Name': 'Chardonnay'}, {'Name': 'Cahrles Heintz Vineyard'}, {'Name': 'Santa Cruz Mountains Estate'}, {'Name': 'Red Shoulder Ranch'}, {'Name': 'Winmakers Reserve'}, {'Name': 'Sangiacomo Vineyard'}, {'Name': 'Sbraglia Limited-Release'}, {'Name': 'Chardonnay'}, {'Name': 'Reserve'}, {'Name': 'Chardonnay'}, {'Name': 'Ryo-fu'}, {'Name': 'Chardonnay'}, {'Name': 'Carneros'}, {'Name': 'Dutton Ranch'}, {'Name': 'Chardonnay'}, {'Name': 'Los Olivos Vineyard'}, {'Name': 'La Carrlere'}, {'Name': 'Chardonnay'}, {'Name': 'Home Ranch'}, {'Name': 'Chardonnay'}, {'Name': 'Carneros'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Keefer Ranch'}, {'Name': 'Chardonnay'}, {'Name': 'Private Reserve'}, {'Name': 'Carneros Reserve'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Dutton Ranch'}, {'Name': 'Chardonnay'}, {'Name': 'Emelias Cuvee'}, {'Name': 'Chardonnay'}, {'Name': 'Ovation'}, {'Name': 'Laughlin Family Vineyard'}, {'Name': 'Don Miguel Vineyard Lia Torres Family Vineyards'}, {'Name': 'Chardonnay'}, {'Name': 'B. Theriot Vineyard'}, {'Name': 'Ceja Vineyard'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Proprietary Reserve'}, {'Name': 'Los Carneros'}, {'Name': 'Chardonnay'}, {'Name': 'Carneros'}, {'Name': 'Chardonnay'}, {'Name': 'Signature'}, {'Name': 'Valley Dominique'}, {'Name': 'Chardonnay'}, {'Name': 'Founders'}, {'Name': 'Kistler Vineyard'}, {'Name': 'Gold Creek Ranch'}, {'Name': 'Chardonnay'}, {'Name': 'Cuvee Natalie'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'De La Guerra'}, {'Name': 'Parr Vineyard'}, {'Name': 'Chardonnay'}, {'Name': 'Carneros'}, {'Name': 'Reserve'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Finest Selection Reserve'}, {'Name': 'Valley Savoy'}, {'Name': 'Coster Vineyard'}, {'Name': 'Lambda'}, {'Name': 'Pinot Noir'}, {'Name': 'Hurst Vineyard'}, {'Name': 'Keefer Ranch'}, {'Name': 'Pinot Noir'}, {'Name': 'McDougal Ranch'}, {'Name': 'Clos Pepe Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Kanzler Vineyard'}, {'Name': 'Wildcat Mountain Vineyard'}, {'Name': 'Ramondo Vineyard'}, {'Name': 'Grand Detour'}, {'Name': 'Valley Dutton Ranch'}, {'Name': 'Pinot Noir'}, {'Name': 'Pinot Noir'}, {'Name': 'Papas Block'}, {'Name': 'Rosellas Vineyard'}, {'Name': 'Glorias Gem'}, {'Name': 'Cuvee Trouvee'}, {'Name': 'Grand Master'}, {'Name': 'Zio Tony Ranch Gianna Marie'}, {'Name': 'Les Galets'}, {'Name': 'Gamma'}, {'Name': 'Unti Vineyard'}, {'Name': 'Zinfandel'}, {'Name': 'Problem Child'}, {'Name': 'Rossi Ranch'}, {'Name': 'Zinfandel'}, {'Name': 'Montafi Ranch'}, {'Name': 'Old vine Della Costa Family Vineyard'}, {'Name': 'Giuseppe & Luisa'}, {'Name': 'Zinfandel'}, {'Name': 'Zinfandel'}, {'Name': 'Backroads'}, {'Name': 'Appelation Series'}, {'Name': '50 Year Old Vines'}, {'Name': 'Heritage'}, {'Name': 'Old Vine'}, {'Name': 'Vieux-Os Hell Hole Cuvee Old Vine'}, {'Name': 'Planchon Vineyard'}, {'Name': 'Knotty Vines'}, {'Name': 'Beastly Old Vines'}, {'Name': 'Ancient Vines'}, {'Name': 'Incredible Red'}, {'Name': 'Zinfandel'}, {'Name': 'Zinfandel'}, {'Name': 'Cabernet Franc'}, {'Name': 'Primitivo'}, {'Name': 'Merlot'}, {'Name': 'Special Selection'}, {'Name': 'Date Night'}, {'Name': 'Black Label'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Artistry'}, {'Name': 'Napa Angel Aurelios Selection'}, {'Name': 'Chardonnay'}, {'Name': 'Reserve'}, {'Name': 'Russian River Selection'}, {'Name': 'Numbers'}, {'Name': 'Pinot Noir'}, {'Name': 'Merlot'}, {'Name': 'Zinfandel'}, {'Name': 'Merlot'}, {'Name': 'Zinfandel'}, {'Name': 'Beckstoffer Dr. Crane Vineyard'}, {'Name': 'DAdamo Vineyard'}, {'Name': 'InSpire'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Spare Me'}, {'Name': 'Jersey Boy'}, {'Name': 'Choreography'}, {'Name': 'Artistry'}, {'Name': 'Tephra Ridge Vineyard'}, {'Name': 'Peter Newton Vineyard'}, {'Name': 'State Lane Ranch'}, {'Name': 'District 4'}, {'Name': 'Elevation 1147'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Stagecoach Vineyard'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Elements'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'La Capilla Collection'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'Cabernet Sauvignon'}, {'Name': 'To the Rescue'}, {'Name': 'Pictures'}, {'Name': 'Mailbox Vineyard Drive'}, {'Name': 'Tephra Ridge Vineyard'}, {'Name': 'Merlot'}, {'Name': 'Chelsea Goldschmidt'}, {'Name': 'Merlot'}, {'Name': 'Ryan'}, {'Name': 'Pinot Noir'}, {'Name': 'Finn'}, {'Name': 'Aidan'}, {'Name': 'Eoin'}, {'Name': 'Ulises Valdez Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'La Cruz Vineyard'}, {'Name': 'Grand Firepeak Cuvee Firepeak Vineyard'}, {'Name': 'Sleepy Hollow Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Fume Blanc'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Lillie Vineyard'}, {'Name': 'Sauvignon Blanc'}, {'Name': 'Papas Block'}, {'Name': 'Labels'}, {'Name': 'Madden Ranch'}, {'Name': 'Rosellas Vineyard'}, {'Name': 'Syrah'}, {'Name': 'Grist Vineyard'}, {'Name': 'Highwire Vineyard'}, {'Name': 'Rocky Terrace Los Chamizal Vineyards'}, {'Name': 'Century Vines Reserve'}, {'Name': 'Casa Santinamaria Vineyards'}, {'Name': 'Boticelli Vineyards'}, {'Name': 'Todd Brothers Ranch Old Vines'}, {'Name': 'Old Vine Teldeschi Vineyard Home Ranch'}, {'Name': 'Old Vine'}, {'Name': 'Somers Ranch'}, {'Name': 'Reserve'}, {'Name': 'Morning Sun Los Chamizal Vineyards'}, {'Name': 'Jesses Vineyard'}, {'Name': 'Carlas Reserve'}, {'Name': 'Ginos Vineyard'}, {'Name': 'Zinfandel'}, {'Name': 'Zinfandel'}, {'Name': 'Bridgehead'}, {'Name': 'Old vine Della Costa Family Vineyard'}, {'Name': 'Zinfandel'}, {'Name': 'Pato Vineyard'}, {'Name': 'Zinfandel'}, {'Name': 'Cullinane Reserve'}, {'Name': 'Edizione Pennino'}, {'Name': 'Zinfandel'}, {'Name': 'Bushnell Vineyard'}, {'Name': 'Old Vines'}, {'Name': 'Zinfandel'}, {'Name': 'To the Rescue'}, {'Name': 'Sangiovese'}, {'Name': 'Barbera'}, {'Name': 'Primitivo Block #4'}, {'Name': 'A by Acacia'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
activity_1
CREATE TABLE "Activity" ( actid INTEGER, activity_name VARCHAR(25), PRIMARY KEY (actid) ) CREATE TABLE "Faculty" ( "FacID" INTEGER, "Lname" VARCHAR(15), "Fname" VARCHAR(15), "Rank" VARCHAR(15), "Sex" VARCHAR(1), "Phone" INTEGER, "Room" VARCHAR(5), "Building" VARCHAR(13), PRIMARY KEY ("FacID") ) CREATE TABLE "Faculty_Participates_in" ( "FacID" INTEGER, actid INTEGER, FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), FOREIGN KEY(actid) REFERENCES "Activity" (actid) ) CREATE TABLE "Participates_in" ( stuid INTEGER, actid INTEGER, FOREIGN KEY(stuid) REFERENCES "Student" ("StuID"), FOREIGN KEY(actid) REFERENCES "Activity" (actid) ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Activity" ( actid INTEGER, activity_name VARCHAR(25), PRIMARY KEY (actid) ) /* 2 rows from Activity table: actid activity_name 770 Mountain Climbing 771 Canoeing */ CREATE TABLE "Faculty" ( "FacID" INTEGER, "Lname" VARCHAR(15), "Fname" VARCHAR(15), "Rank" VARCHAR(15), "Sex" VARCHAR(1), "Phone" INTEGER, "Room" VARCHAR(5), "Building" VARCHAR(13), PRIMARY KEY ("FacID") ) /* 2 rows from Faculty table: FacID Lname Fname Rank Sex Phone Room Building 1082 Giuliano Mark Instructor M 2424 224 NEB 1121 Goodrich Michael Professor M 3593 219 NEB */ CREATE TABLE "Faculty_Participates_in" ( "FacID" INTEGER, actid INTEGER, FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), FOREIGN KEY(actid) REFERENCES "Activity" (actid) ) /* 2 rows from Faculty_Participates_in table: FacID actid 1082 784 1082 785 */ CREATE TABLE "Participates_in" ( stuid INTEGER, actid INTEGER, FOREIGN KEY(stuid) REFERENCES "Student" ("StuID"), FOREIGN KEY(actid) REFERENCES "Activity" (actid) ) /* 2 rows from Participates_in table: stuid actid 1001 770 1001 771 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
How many faculty members does each building have? List the result with the name of the building.
SELECT building , count(*) FROM Faculty GROUP BY building
[{'Building': 'Barton', 'count(*)': 20}, {'Building': 'Krieger', 'count(*)': 20}, {'Building': 'NEB', 'count(*)': 18}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
[QUESTION]What is the name, address, and number of students in the departments that have the 3 most students?[/QUESTION] [SQL]SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3[/SQL]
[QUESTION]What is the name, address, and number of students in the departments that have the 3 most students?[/QUESTION] [SQL]SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3[/SQL]
[QUESTION]What is the name, address, and number of students in the departments that have the 3 most students?[/QUESTION] [SQL]SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3[/SQL]
entertainment_awards
CREATE TABLE artwork ( "Artwork_ID" INTEGER, "Type" TEXT, "Name" TEXT, PRIMARY KEY ("Artwork_ID") ) CREATE TABLE festival_detail ( "Festival_ID" INTEGER, "Festival_Name" TEXT, "Chair_Name" TEXT, "Location" TEXT, "Year" INTEGER, "Num_of_Audience" INTEGER, PRIMARY KEY ("Festival_ID") ) CREATE TABLE nomination ( "Artwork_ID" INTEGER, "Festival_ID" INTEGER, "Result" TEXT, PRIMARY KEY ("Artwork_ID", "Festival_ID"), FOREIGN KEY("Festival_ID") REFERENCES festival_detail ("Festival_ID"), FOREIGN KEY("Artwork_ID") REFERENCES artwork ("Artwork_ID") )
CREATE TABLE artwork ( "Artwork_ID" INTEGER, "Type" TEXT, "Name" TEXT, PRIMARY KEY ("Artwork_ID") ) /* 2 rows from artwork table: Artwork_ID Type Name 1 Program Music/Variety Show Indonesian Idol 2 Program Music/Variety Show I Know */ CREATE TABLE festival_detail ( "Festival_ID" INTEGER, "Festival_Name" TEXT, "Chair_Name" TEXT, "Location" TEXT, "Year" INTEGER, "Num_of_Audience" INTEGER, PRIMARY KEY ("Festival_ID") ) /* 2 rows from festival_detail table: Festival_ID Festival_Name Chair_Name Location Year Num_of_Audience 1 Panasonic Awards Raymond Floyd United States 2006 152 2 Flower Awards Charles Coody United States 2007 155 */ CREATE TABLE nomination ( "Artwork_ID" INTEGER, "Festival_ID" INTEGER, "Result" TEXT, PRIMARY KEY ("Artwork_ID", "Festival_ID"), FOREIGN KEY("Festival_ID") REFERENCES festival_detail ("Festival_ID"), FOREIGN KEY("Artwork_ID") REFERENCES artwork ("Artwork_ID") ) /* 2 rows from nomination table: Artwork_ID Festival_ID Result 1 2 Nominated 2 2 Won */
What are the names of festivals held in year 2007?
SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007
[{'Festival_Name': 'Flower Awards'}, {'Festival_Name': 'Cherry Awards'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?[/QUESTION] [SQL]SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015[/SQL]
[QUESTION]What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?[/QUESTION] [SQL]SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015[/SQL]
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
papers by brian curless in convolution topic
SELECT DISTINCT t1.authorid , t3.paperid FROM paperkeyphrase AS t2 JOIN keyphrase AS t5 ON t2.keyphraseid = t5.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN writes AS t4 ON t4.paperid = t3.paperid JOIN author AS t1 ON t4.authorid = t1.authorid WHERE t1.authorname = "brian curless" AND t5.keyphrasename = "convolution";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
true
false
false
false
false
false
false
false
true
false
false
false
false
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
Which papers are about about Question Answering ?
SELECT DISTINCT t3.paperid FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid WHERE t1.keyphrasename = "Question Answering";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
true
false
false
false
false
false
false
false
true
false
false
false
false
yelp
CREATE TABLE business ( bid INTEGER, business_id TEXT, name TEXT, full_address TEXT, city TEXT, latitude TEXT, longitude TEXT, review_count INTEGER, is_open INTEGER, rating REAL, state TEXT, PRIMARY KEY (bid) ) CREATE TABLE category ( id INTEGER, business_id TEXT, category_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE checkin ( cid INTEGER, business_id TEXT, count INTEGER, day TEXT, PRIMARY KEY (cid), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE neighbourhood ( id INTEGER, business_id TEXT, neighbourhood_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE review ( rid INTEGER, business_id TEXT, user_id TEXT, rating REAL, text TEXT, year INTEGER, month TEXT, PRIMARY KEY (rid), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE tip ( tip_id INTEGER, business_id TEXT, text TEXT, user_id TEXT, likes INTEGER, year INTEGER, month TEXT, PRIMARY KEY (tip_id), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE user ( uid INTEGER, user_id TEXT, name TEXT, PRIMARY KEY (uid) )
CREATE TABLE business ( bid INTEGER, business_id TEXT, name TEXT, full_address TEXT, city TEXT, latitude TEXT, longitude TEXT, review_count INTEGER, is_open INTEGER, rating REAL, state TEXT, PRIMARY KEY (bid) ) /* 2 rows from business table: bid business_id name full_address city latitude longitude review_count is_open rating state */ CREATE TABLE category ( id INTEGER, business_id TEXT, category_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from category table: id business_id category_name */ CREATE TABLE checkin ( cid INTEGER, business_id TEXT, count INTEGER, day TEXT, PRIMARY KEY (cid), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from checkin table: cid business_id count day */ CREATE TABLE neighbourhood ( id INTEGER, business_id TEXT, neighbourhood_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from neighbourhood table: id business_id neighbourhood_name */ CREATE TABLE review ( rid INTEGER, business_id TEXT, user_id TEXT, rating REAL, text TEXT, year INTEGER, month TEXT, PRIMARY KEY (rid), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from review table: rid business_id user_id rating text year month */ CREATE TABLE tip ( tip_id INTEGER, business_id TEXT, text TEXT, user_id TEXT, likes INTEGER, year INTEGER, month TEXT, PRIMARY KEY (tip_id), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from tip table: tip_id business_id text user_id likes year month */ CREATE TABLE user ( uid INTEGER, user_id TEXT, name TEXT, PRIMARY KEY (uid) ) /* 2 rows from user table: uid user_id name */
Find all users who have written tips about businesses in Dallas
SELECT t3.name FROM tip AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN USER AS t3 ON t3.user_id = t2.user_id WHERE t1.city = "Dallas";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
false
false
false
false
false
false
false
false
true
false
false
false
false
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
How many citations does noah a smith has ?
SELECT DISTINCT COUNT ( t4.citedpaperid ) FROM paper AS t3 JOIN cite AS t4 ON t3.paperid = t4.citedpaperid JOIN writes AS t2 ON t2.paperid = t3.paperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = "noah a smith";
[{'COUNT ( t4.citedpaperid )': 0}]
Hard
true
false
false
false
false
false
false
false
true
false
false
false
false
[QUESTION]How many papers has Noah Smith co-authored since 2009 ?[/QUESTION] [SQL]SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname != "Noah Smith" AND t3.year > 2009 AND t2.paperid IN ( SELECT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname LIKE "Noah Smith" );[/SQL]
[QUESTION]How many papers has Noah Smith co-authored since 2009 ?[/QUESTION] [SQL]SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname != "Noah Smith" AND t3.year > 2009 AND t2.paperid IN ( SELECT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname LIKE "Noah Smith" );[/SQL]
[QUESTION]How many papers has Noah Smith co-authored since 2009 ?[/QUESTION] [SQL]SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname != "Noah Smith" AND t3.year > 2009 AND t2.paperid IN ( SELECT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname LIKE "Noah Smith" );[/SQL]
[QUESTION]How many papers has Noah Smith co-authored since 2009 ?[/QUESTION] [SQL]SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname != "Noah Smith" AND t3.year > 2009 AND t2.paperid IN ( SELECT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname LIKE "Noah Smith" );[/SQL]
yelp
CREATE TABLE business ( bid INTEGER, business_id TEXT, name TEXT, full_address TEXT, city TEXT, latitude TEXT, longitude TEXT, review_count INTEGER, is_open INTEGER, rating REAL, state TEXT, PRIMARY KEY (bid) ) CREATE TABLE category ( id INTEGER, business_id TEXT, category_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE checkin ( cid INTEGER, business_id TEXT, count INTEGER, day TEXT, PRIMARY KEY (cid), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE neighbourhood ( id INTEGER, business_id TEXT, neighbourhood_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE review ( rid INTEGER, business_id TEXT, user_id TEXT, rating REAL, text TEXT, year INTEGER, month TEXT, PRIMARY KEY (rid), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE tip ( tip_id INTEGER, business_id TEXT, text TEXT, user_id TEXT, likes INTEGER, year INTEGER, month TEXT, PRIMARY KEY (tip_id), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE user ( uid INTEGER, user_id TEXT, name TEXT, PRIMARY KEY (uid) )
CREATE TABLE business ( bid INTEGER, business_id TEXT, name TEXT, full_address TEXT, city TEXT, latitude TEXT, longitude TEXT, review_count INTEGER, is_open INTEGER, rating REAL, state TEXT, PRIMARY KEY (bid) ) /* 2 rows from business table: bid business_id name full_address city latitude longitude review_count is_open rating state */ CREATE TABLE category ( id INTEGER, business_id TEXT, category_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from category table: id business_id category_name */ CREATE TABLE checkin ( cid INTEGER, business_id TEXT, count INTEGER, day TEXT, PRIMARY KEY (cid), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from checkin table: cid business_id count day */ CREATE TABLE neighbourhood ( id INTEGER, business_id TEXT, neighbourhood_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from neighbourhood table: id business_id neighbourhood_name */ CREATE TABLE review ( rid INTEGER, business_id TEXT, user_id TEXT, rating REAL, text TEXT, year INTEGER, month TEXT, PRIMARY KEY (rid), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from review table: rid business_id user_id rating text year month */ CREATE TABLE tip ( tip_id INTEGER, business_id TEXT, text TEXT, user_id TEXT, likes INTEGER, year INTEGER, month TEXT, PRIMARY KEY (tip_id), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from tip table: tip_id business_id text user_id likes year month */ CREATE TABLE user ( uid INTEGER, user_id TEXT, name TEXT, PRIMARY KEY (uid) ) /* 2 rows from user table: uid user_id name */
find the total checkins in Moroccan restaurant in " Los Angeles "
SELECT SUM ( t4.count ) FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id JOIN category AS t3 ON t3.business_id = t1.business_id JOIN checkin AS t4 ON t4.business_id = t1.business_id WHERE t1.city = "Los Angeles" AND t2.category_name = "restaurant" AND t3.category_name = "Moroccan";
[{'SUM ( t4.count )': None}]
Hard
false
false
false
false
false
false
false
false
true
false
false
false
false
wine_1
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") )
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) /* 2 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No */ CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) /* 2 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red */ CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") ) /* 2 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now */
What are the wines that have prices lower than 50 and have appelations in Monterey county?
SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50
[{'Name': 'Sarmento Vineyard'}, {'Name': 'Kali Hart'}, {'Name': 'Pinot Noir'}, {'Name': 'Sleepy Hollow Vineyard'}, {'Name': 'Rosellas Vineyard'}, {'Name': 'Garys Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Garys Vineyard'}, {'Name': 'Pinot Noir'}, {'Name': 'Rosellas Vineyard'}, {'Name': 'Garys Vineyard'}, {'Name': 'Chardonnay'}, {'Name': 'Chardonnay'}, {'Name': 'Pinot Noir'}, {'Name': 'Rosellas Vineyard'}, {'Name': 'Metallico Un-Oaked'}, {'Name': 'Rosellas Vineyard'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
small_bank_1
CREATE TABLE "ACCOUNTS" ( custid BIGINT NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY (custid) ) CREATE TABLE "CHECKING" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) ) CREATE TABLE "SAVINGS" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) )
CREATE TABLE "ACCOUNTS" ( custid BIGINT NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY (custid) ) /* 2 rows from ACCOUNTS table: custid name 1 Brown 2 Wang */ CREATE TABLE "CHECKING" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) ) /* 2 rows from CHECKING table: custid balance 1 10000.0 2 2000.0 */ CREATE TABLE "SAVINGS" ( custid BIGINT NOT NULL, balance FLOAT NOT NULL, PRIMARY KEY (custid), FOREIGN KEY(custid) REFERENCES "ACCOUNTS" (custid) ) /* 2 rows from SAVINGS table: custid balance 1 200000.0 2 999999999.0 */
What are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance?
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM savings)
[{'name': 'Brown'}, {'name': 'Granger'}, {'name': 'Weeks'}]
Hard
false
false
false
false
false
false
false
false
true
false
true
false
false
[QUESTION]What are the names of customers who have both savings and checking accounts?[/QUESTION] [SQL]SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'[/SQL]
[QUESTION]What are the names of customers who have both savings and checking accounts?[/QUESTION] [SQL]SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'[/SQL]
[QUESTION]What are the names of customers who have both savings and checking accounts?[/QUESTION] [SQL]SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'[/SQL]
[QUESTION]What are the names of customers who have both savings and checking accounts?[/QUESTION] [SQL]SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'[/SQL]
party_people
CREATE TABLE member ( "Member_ID" INTEGER, "Member_Name" TEXT, "Party_ID" TEXT, "In_office" TEXT, PRIMARY KEY ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) CREATE TABLE party ( "Party_ID" INTEGER, "Minister" TEXT, "Took_office" TEXT, "Left_office" TEXT, "Region_ID" INTEGER, "Party_name" TEXT, PRIMARY KEY ("Party_ID"), FOREIGN KEY("Region_ID") REFERENCES region ("Region_ID") ) CREATE TABLE party_events ( "Event_ID" INTEGER, "Event_Name" TEXT, "Party_ID" INTEGER, "Member_in_charge_ID" INTEGER, PRIMARY KEY ("Event_ID"), FOREIGN KEY("Member_in_charge_ID") REFERENCES member ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) CREATE TABLE region ( "Region_ID" INTEGER, "Region_name" TEXT, "Date" TEXT, "Label" TEXT, "Format" TEXT, "Catalogue" TEXT, PRIMARY KEY ("Region_ID") )
CREATE TABLE member ( "Member_ID" INTEGER, "Member_Name" TEXT, "Party_ID" TEXT, "In_office" TEXT, PRIMARY KEY ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) /* 2 rows from member table: Member_ID Member_Name Party_ID In_office 1 Hon Tony Abbott 3 1994–present 2 Hon Dick Adams 2 1993–2013 */ CREATE TABLE party ( "Party_ID" INTEGER, "Minister" TEXT, "Took_office" TEXT, "Left_office" TEXT, "Region_ID" INTEGER, "Party_name" TEXT, PRIMARY KEY ("Party_ID"), FOREIGN KEY("Region_ID") REFERENCES region ("Region_ID") ) /* 2 rows from party table: Party_ID Minister Took_office Left_office Region_ID Party_name 1 Dr. Kwame Nkrumah (MP) 1957 1958 1 Convention Peoples Party 2 Kojo Botsio (MP) 1958 1959 2 Progress Party */ CREATE TABLE party_events ( "Event_ID" INTEGER, "Event_Name" TEXT, "Party_ID" INTEGER, "Member_in_charge_ID" INTEGER, PRIMARY KEY ("Event_ID"), FOREIGN KEY("Member_in_charge_ID") REFERENCES member ("Member_ID"), FOREIGN KEY("Party_ID") REFERENCES party ("Party_ID") ) /* 2 rows from party_events table: Event_ID Event_Name Party_ID Member_in_charge_ID 1 Annaual Meeting 1 4 2 Conference 1 12 */ CREATE TABLE region ( "Region_ID" INTEGER, "Region_name" TEXT, "Date" TEXT, "Label" TEXT, "Format" TEXT, "Catalogue" TEXT, PRIMARY KEY ("Region_ID") ) /* 2 rows from region table: Region_ID Region_name Date Label Format Catalogue 1 United Kingdom 1 July 2002 Parlophone CD 540 3622 2 United Kingdom 1 July 2002 Parlophone 2× LP 539 9821 */
Which event names were used more than twice for party events?
SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2
[{'Event_Name': 'Annaual Meeting'}]
Easy
false
false
false
false
false
true
true
false
false
false
false
false
false
cre_Drama_Workshop_Groups
CREATE TABLE "Addresses" ( "Address_ID" VARCHAR(100) NOT NULL, "Line_1" VARCHAR(255), "Line_2" VARCHAR(255), "City_Town" VARCHAR(255), "State_County" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Address_ID"), UNIQUE ("Address_ID") ) CREATE TABLE "Bookings" ( "Booking_ID" INTEGER NOT NULL, "Customer_ID" INTEGER NOT NULL, "Workshop_Group_ID" VARCHAR(100) NOT NULL, "Status_Code" CHAR(15) NOT NULL, "Store_ID" INTEGER NOT NULL, "Order_Date" DATETIME NOT NULL, "Planned_Delivery_Date" DATETIME NOT NULL, "Actual_Delivery_Date" DATETIME NOT NULL, "Other_Order_Details" VARCHAR(255), PRIMARY KEY ("Booking_ID"), FOREIGN KEY("Customer_ID") REFERENCES "Clients" ("Client_ID"), FOREIGN KEY("Workshop_Group_ID") REFERENCES "Drama_Workshop_Groups" ("Workshop_Group_ID"), UNIQUE ("Booking_ID") ) CREATE TABLE "Bookings_Services" ( "Order_ID" INTEGER NOT NULL, "Product_ID" INTEGER NOT NULL, PRIMARY KEY ("Order_ID", "Product_ID"), FOREIGN KEY("Order_ID") REFERENCES "Bookings" ("Booking_ID"), FOREIGN KEY("Product_ID") REFERENCES "Services" ("Service_ID") ) CREATE TABLE "Clients" ( "Client_ID" INTEGER NOT NULL, "Address_ID" INTEGER NOT NULL, "Customer_Email_Address" VARCHAR(255), "Customer_Name" VARCHAR(255), "Customer_Phone" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Client_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Client_ID") ) CREATE TABLE "Customer_Orders" ( "Order_ID" INTEGER NOT NULL, "Customer_ID" INTEGER NOT NULL, "Store_ID" INTEGER NOT NULL, "Order_Date" DATETIME NOT NULL, "Planned_Delivery_Date" DATETIME NOT NULL, "Actual_Delivery_Date" DATETIME NOT NULL, "Other_Order_Details" VARCHAR(255), PRIMARY KEY ("Order_ID"), FOREIGN KEY("Customer_ID") REFERENCES "Customers" ("Customer_ID"), FOREIGN KEY("Store_ID") REFERENCES "Stores" ("Store_ID"), UNIQUE ("Order_ID") ) CREATE TABLE "Customers" ( "Customer_ID" VARCHAR(100) NOT NULL, "Address_ID" INTEGER NOT NULL, "Customer_Name" VARCHAR(255), "Customer_Phone" VARCHAR(255), "Customer_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Customer_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Customer_ID") ) CREATE TABLE "Drama_Workshop_Groups" ( "Workshop_Group_ID" INTEGER NOT NULL, "Address_ID" INTEGER NOT NULL, "Currency_Code" CHAR(15) NOT NULL, "Marketing_Region_Code" CHAR(15) NOT NULL, "Store_Name" VARCHAR(255), "Store_Phone" VARCHAR(255), "Store_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Workshop_Group_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Workshop_Group_ID") ) CREATE TABLE "Invoice_Items" ( "Invoice_Item_ID" INTEGER NOT NULL, "Invoice_ID" INTEGER NOT NULL, "Order_ID" INTEGER NOT NULL, "Order_Item_ID" INTEGER NOT NULL, "Product_ID" INTEGER NOT NULL, "Order_Quantity" INTEGER, "Other_Item_Details" VARCHAR(255), PRIMARY KEY ("Invoice_Item_ID"), FOREIGN KEY("Order_Item_ID") REFERENCES "Order_Items" ("Order_Item_ID"), FOREIGN KEY("Invoice_ID") REFERENCES "Invoices" ("Invoice_ID"), FOREIGN KEY("Order_ID", "Product_ID") REFERENCES "Bookings_Services" ("Order_ID", "Product_ID") ) CREATE TABLE "Invoices" ( "Invoice_ID" INTEGER NOT NULL, "Order_ID" INTEGER NOT NULL, payment_method_code CHAR(15), "Product_ID" INTEGER NOT NULL, "Order_Quantity" VARCHAR(288), "Other_Item_Details" VARCHAR(255), "Order_Item_ID" INTEGER NOT NULL, PRIMARY KEY ("Invoice_ID"), FOREIGN KEY("Order_ID") REFERENCES "Customer_Orders" ("Order_ID"), FOREIGN KEY("Order_ID") REFERENCES "Bookings" ("Booking_ID"), FOREIGN KEY(payment_method_code) REFERENCES "Ref_Payment_Methods" (payment_method_code) ) CREATE TABLE "Marketing_Regions" ( "Marketing_Region_Code" CHAR(15) NOT NULL, "Marketing_Region_Name" VARCHAR(255) NOT NULL, "Marketing_Region_Descriptrion" VARCHAR(255) NOT NULL, "Other_Details" VARCHAR(255), PRIMARY KEY ("Marketing_Region_Code"), UNIQUE ("Marketing_Region_Code") ) CREATE TABLE "Order_Items" ( "Order_Item_ID" INTEGER NOT NULL, "Order_ID" INTEGER NOT NULL, "Product_ID" INTEGER NOT NULL, "Order_Quantity" VARCHAR(288), "Other_Item_Details" VARCHAR(255), PRIMARY KEY ("Order_Item_ID"), FOREIGN KEY("Order_ID") REFERENCES "Customer_Orders" ("Order_ID"), FOREIGN KEY("Product_ID") REFERENCES "Products" ("Product_ID") ) CREATE TABLE "Performers" ( "Performer_ID" INTEGER NOT NULL, "Address_ID" INTEGER NOT NULL, "Customer_Name" VARCHAR(255), "Customer_Phone" VARCHAR(255), "Customer_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Performer_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Performer_ID") ) CREATE TABLE "Performers_in_Bookings" ( "Order_ID" INTEGER NOT NULL, "Performer_ID" INTEGER NOT NULL, PRIMARY KEY ("Order_ID", "Performer_ID"), FOREIGN KEY("Performer_ID") REFERENCES "Performers" ("Performer_ID"), FOREIGN KEY("Order_ID") REFERENCES "Bookings" ("Booking_ID") ) CREATE TABLE "Products" ( "Product_ID" VARCHAR(100) NOT NULL, "Product_Name" VARCHAR(255), "Product_Price" DECIMAL(20, 4), "Product_Description" VARCHAR(255), "Other_Product_Service_Details" VARCHAR(255), PRIMARY KEY ("Product_ID"), UNIQUE ("Product_ID") ) CREATE TABLE "Ref_Payment_Methods" ( payment_method_code CHAR(10) NOT NULL, payment_method_description VARCHAR(80), PRIMARY KEY (payment_method_code), UNIQUE (payment_method_code) ) CREATE TABLE "Ref_Service_Types" ( "Service_Type_Code" CHAR(15) NOT NULL, "Parent_Service_Type_Code" CHAR(15), "Service_Type_Description" VARCHAR(255), PRIMARY KEY ("Service_Type_Code"), UNIQUE ("Service_Type_Code") ) CREATE TABLE "Services" ( "Service_ID" INTEGER NOT NULL, "Service_Type_Code" CHAR(15), "Workshop_Group_ID" INTEGER NOT NULL, "Product_Description" VARCHAR(255), "Product_Name" VARCHAR(255), "Product_Price" DECIMAL(20, 4), "Other_Product_Service_Details" VARCHAR(255), PRIMARY KEY ("Service_ID"), FOREIGN KEY("Workshop_Group_ID") REFERENCES "Drama_Workshop_Groups" ("Workshop_Group_ID"), FOREIGN KEY("Service_Type_Code") REFERENCES "Ref_Service_Types" ("Service_Type_Code"), UNIQUE ("Service_ID") ) CREATE TABLE "Stores" ( "Store_ID" VARCHAR(100) NOT NULL, "Address_ID" INTEGER NOT NULL, "Marketing_Region_Code" CHAR(15) NOT NULL, "Store_Name" VARCHAR(255), "Store_Phone" VARCHAR(255), "Store_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Store_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), FOREIGN KEY("Marketing_Region_Code") REFERENCES "Marketing_Regions" ("Marketing_Region_Code"), UNIQUE ("Store_ID") )
CREATE TABLE "Addresses" ( "Address_ID" VARCHAR(100) NOT NULL, "Line_1" VARCHAR(255), "Line_2" VARCHAR(255), "City_Town" VARCHAR(255), "State_County" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Address_ID"), UNIQUE ("Address_ID") ) /* 2 rows from Addresses table: Address_ID Line_1 Line_2 City_Town State_County Other_Details 110 4753 Dach Highway Suite 846 Feliciaberg Florida None 124 391 Vandervort Fall Apt. 446 Apt. 107 West Sherwoodstad Indiana None */ CREATE TABLE "Bookings" ( "Booking_ID" INTEGER NOT NULL, "Customer_ID" INTEGER NOT NULL, "Workshop_Group_ID" VARCHAR(100) NOT NULL, "Status_Code" CHAR(15) NOT NULL, "Store_ID" INTEGER NOT NULL, "Order_Date" DATETIME NOT NULL, "Planned_Delivery_Date" DATETIME NOT NULL, "Actual_Delivery_Date" DATETIME NOT NULL, "Other_Order_Details" VARCHAR(255), PRIMARY KEY ("Booking_ID"), FOREIGN KEY("Customer_ID") REFERENCES "Clients" ("Client_ID"), FOREIGN KEY("Workshop_Group_ID") REFERENCES "Drama_Workshop_Groups" ("Workshop_Group_ID"), UNIQUE ("Booking_ID") ) /* 2 rows from Bookings table: Booking_ID Customer_ID Workshop_Group_ID Status_Code Store_ID Order_Date Planned_Delivery_Date Actual_Delivery_Date Other_Order_Details 1 938 140 good 8 2016-12-12 10:43:01 2013-03-10 18:47:05 1997-11-21 10:07:40 None 2 868 838 stop 7 1976-08-20 00:33:08 2009-07-09 09:18:38 1976-01-08 07:19:23 None */ CREATE TABLE "Bookings_Services" ( "Order_ID" INTEGER NOT NULL, "Product_ID" INTEGER NOT NULL, PRIMARY KEY ("Order_ID", "Product_ID"), FOREIGN KEY("Order_ID") REFERENCES "Bookings" ("Booking_ID"), FOREIGN KEY("Product_ID") REFERENCES "Services" ("Service_ID") ) /* 2 rows from Bookings_Services table: Order_ID Product_ID 1 396 1 779 */ CREATE TABLE "Clients" ( "Client_ID" INTEGER NOT NULL, "Address_ID" INTEGER NOT NULL, "Customer_Email_Address" VARCHAR(255), "Customer_Name" VARCHAR(255), "Customer_Phone" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Client_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Client_ID") ) /* 2 rows from Clients table: Client_ID Address_ID Customer_Email_Address Customer_Name Customer_Phone Other_Details 423 201 [email protected] Clifford (042)912-3404x5135 VIP 426 383 [email protected] Bettye (604)849-0214 None */ CREATE TABLE "Customer_Orders" ( "Order_ID" INTEGER NOT NULL, "Customer_ID" INTEGER NOT NULL, "Store_ID" INTEGER NOT NULL, "Order_Date" DATETIME NOT NULL, "Planned_Delivery_Date" DATETIME NOT NULL, "Actual_Delivery_Date" DATETIME NOT NULL, "Other_Order_Details" VARCHAR(255), PRIMARY KEY ("Order_ID"), FOREIGN KEY("Customer_ID") REFERENCES "Customers" ("Customer_ID"), FOREIGN KEY("Store_ID") REFERENCES "Stores" ("Store_ID"), UNIQUE ("Order_ID") ) /* 2 rows from Customer_Orders table: Order_ID Customer_ID Store_ID Order_Date Planned_Delivery_Date Actual_Delivery_Date Other_Order_Details 1 516 231 1994-08-03 12:34:58 1977-03-11 03:58:19 1992-07-21 22:11:11 None 2 418 229 2014-07-10 10:56:01 1996-08-26 19:19:59 1998-08-22 17:57:32 None */ CREATE TABLE "Customers" ( "Customer_ID" VARCHAR(100) NOT NULL, "Address_ID" INTEGER NOT NULL, "Customer_Name" VARCHAR(255), "Customer_Phone" VARCHAR(255), "Customer_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Customer_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Customer_ID") ) /* 2 rows from Customers table: Customer_ID Address_ID Customer_Name Customer_Phone Customer_Email_Address Other_Details 240 286 Harold 624-096-7791 [email protected] None 267 98 Federico 914-915-7483 [email protected] None */ CREATE TABLE "Drama_Workshop_Groups" ( "Workshop_Group_ID" INTEGER NOT NULL, "Address_ID" INTEGER NOT NULL, "Currency_Code" CHAR(15) NOT NULL, "Marketing_Region_Code" CHAR(15) NOT NULL, "Store_Name" VARCHAR(255), "Store_Phone" VARCHAR(255), "Store_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Workshop_Group_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Workshop_Group_ID") ) /* 2 rows from Drama_Workshop_Groups table: Workshop_Group_ID Address_ID Currency_Code Marketing_Region_Code Store_Name Store_Phone Store_Email_Address Other_Details 136 383 EU FR Amely Cafe 122-084-8029 [email protected] None 140 180 EU DE Veda Film 793-966-9311x5303 [email protected] None */ CREATE TABLE "Invoice_Items" ( "Invoice_Item_ID" INTEGER NOT NULL, "Invoice_ID" INTEGER NOT NULL, "Order_ID" INTEGER NOT NULL, "Order_Item_ID" INTEGER NOT NULL, "Product_ID" INTEGER NOT NULL, "Order_Quantity" INTEGER, "Other_Item_Details" VARCHAR(255), PRIMARY KEY ("Invoice_Item_ID"), FOREIGN KEY("Order_Item_ID") REFERENCES "Order_Items" ("Order_Item_ID"), FOREIGN KEY("Invoice_ID") REFERENCES "Invoices" ("Invoice_ID"), FOREIGN KEY("Order_ID", "Product_ID") REFERENCES "Bookings_Services" ("Order_ID", "Product_ID") ) /* 2 rows from Invoice_Items table: Invoice_Item_ID Invoice_ID Order_ID Order_Item_ID Product_ID Order_Quantity Other_Item_Details 1 128 1 5 396 2 None 2 162 4 6 191 6 Good quality */ CREATE TABLE "Invoices" ( "Invoice_ID" INTEGER NOT NULL, "Order_ID" INTEGER NOT NULL, payment_method_code CHAR(15), "Product_ID" INTEGER NOT NULL, "Order_Quantity" VARCHAR(288), "Other_Item_Details" VARCHAR(255), "Order_Item_ID" INTEGER NOT NULL, PRIMARY KEY ("Invoice_ID"), FOREIGN KEY("Order_ID") REFERENCES "Customer_Orders" ("Order_ID"), FOREIGN KEY("Order_ID") REFERENCES "Bookings" ("Booking_ID"), FOREIGN KEY(payment_method_code) REFERENCES "Ref_Payment_Methods" (payment_method_code) ) /* 2 rows from Invoices table: Invoice_ID Order_ID payment_method_code Product_ID Order_Quantity Other_Item_Details Order_Item_ID 128 14 MasterCard 4 2 None 1 162 13 MasterCard 9 2 None 9 */ CREATE TABLE "Marketing_Regions" ( "Marketing_Region_Code" CHAR(15) NOT NULL, "Marketing_Region_Name" VARCHAR(255) NOT NULL, "Marketing_Region_Descriptrion" VARCHAR(255) NOT NULL, "Other_Details" VARCHAR(255), PRIMARY KEY ("Marketing_Region_Code"), UNIQUE ("Marketing_Region_Code") ) /* 2 rows from Marketing_Regions table: Marketing_Region_Code Marketing_Region_Name Marketing_Region_Descriptrion Other_Details CA Canada Our target market None CN China Our largest market None */ CREATE TABLE "Order_Items" ( "Order_Item_ID" INTEGER NOT NULL, "Order_ID" INTEGER NOT NULL, "Product_ID" INTEGER NOT NULL, "Order_Quantity" VARCHAR(288), "Other_Item_Details" VARCHAR(255), PRIMARY KEY ("Order_Item_ID"), FOREIGN KEY("Order_ID") REFERENCES "Customer_Orders" ("Order_ID"), FOREIGN KEY("Product_ID") REFERENCES "Products" ("Product_ID") ) /* 2 rows from Order_Items table: Order_Item_ID Order_ID Product_ID Order_Quantity Other_Item_Details 1 3 233 1 None 2 15 300 2 None */ CREATE TABLE "Performers" ( "Performer_ID" INTEGER NOT NULL, "Address_ID" INTEGER NOT NULL, "Customer_Name" VARCHAR(255), "Customer_Phone" VARCHAR(255), "Customer_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Performer_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), UNIQUE ("Performer_ID") ) /* 2 rows from Performers table: Performer_ID Address_ID Customer_Name Customer_Phone Customer_Email_Address Other_Details 153 124 Shawna 664.495.1939 [email protected] None 211 124 Ashley 893-536-8857 [email protected] None */ CREATE TABLE "Performers_in_Bookings" ( "Order_ID" INTEGER NOT NULL, "Performer_ID" INTEGER NOT NULL, PRIMARY KEY ("Order_ID", "Performer_ID"), FOREIGN KEY("Performer_ID") REFERENCES "Performers" ("Performer_ID"), FOREIGN KEY("Order_ID") REFERENCES "Bookings" ("Booking_ID") ) /* 2 rows from Performers_in_Bookings table: Order_ID Performer_ID 1 153 1 341 */ CREATE TABLE "Products" ( "Product_ID" VARCHAR(100) NOT NULL, "Product_Name" VARCHAR(255), "Product_Price" DECIMAL(20, 4), "Product_Description" VARCHAR(255), "Other_Product_Service_Details" VARCHAR(255), PRIMARY KEY ("Product_ID"), UNIQUE ("Product_ID") ) /* 2 rows from Products table: Product_ID Product_Name Product_Price Product_Description Other_Product_Service_Details 11 photo 4448536.0000 None None 154 film 2302.0000 None None */ CREATE TABLE "Ref_Payment_Methods" ( payment_method_code CHAR(10) NOT NULL, payment_method_description VARCHAR(80), PRIMARY KEY (payment_method_code), UNIQUE (payment_method_code) ) /* 2 rows from Ref_Payment_Methods table: payment_method_code payment_method_description American E credit MasterCard debit */ CREATE TABLE "Ref_Service_Types" ( "Service_Type_Code" CHAR(15) NOT NULL, "Parent_Service_Type_Code" CHAR(15), "Service_Type_Description" VARCHAR(255), PRIMARY KEY ("Service_Type_Code"), UNIQUE ("Service_Type_Code") ) /* 2 rows from Ref_Service_Types table: Service_Type_Code Parent_Service_Type_Code Service_Type_Description 1 1 provide photo service 2 1 provide dinning service */ CREATE TABLE "Services" ( "Service_ID" INTEGER NOT NULL, "Service_Type_Code" CHAR(15), "Workshop_Group_ID" INTEGER NOT NULL, "Product_Description" VARCHAR(255), "Product_Name" VARCHAR(255), "Product_Price" DECIMAL(20, 4), "Other_Product_Service_Details" VARCHAR(255), PRIMARY KEY ("Service_ID"), FOREIGN KEY("Workshop_Group_ID") REFERENCES "Drama_Workshop_Groups" ("Workshop_Group_ID"), FOREIGN KEY("Service_Type_Code") REFERENCES "Ref_Service_Types" ("Service_Type_Code"), UNIQUE ("Service_ID") ) /* 2 rows from Services table: Service_ID Service_Type_Code Workshop_Group_ID Product_Description Product_Name Product_Price Other_Product_Service_Details 191 1 415 None film 58932775.8822 None 219 2 838 None film 2704.4719 None */ CREATE TABLE "Stores" ( "Store_ID" VARCHAR(100) NOT NULL, "Address_ID" INTEGER NOT NULL, "Marketing_Region_Code" CHAR(15) NOT NULL, "Store_Name" VARCHAR(255), "Store_Phone" VARCHAR(255), "Store_Email_Address" VARCHAR(255), "Other_Details" VARCHAR(255), PRIMARY KEY ("Store_ID"), FOREIGN KEY("Address_ID") REFERENCES "Addresses" ("Address_ID"), FOREIGN KEY("Marketing_Region_Code") REFERENCES "Marketing_Regions" ("Marketing_Region_Code"), UNIQUE ("Store_ID") ) /* 2 rows from Stores table: Store_ID Address_ID Marketing_Region_Code Store_Name Store_Phone Store_Email_Address Other_Details 150 286 IN FJA Filming +65(1)3590790358 [email protected] None 229 266 CA Rob Dinning 1-327-185-9368 [email protected] 5 stars */
Tell me the name of the most pricy product.
SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1
[{'Product_Name': 'film'}]
Easy
false
false
false
true
true
false
false
false
false
false
false
false
false
sakila_1
CREATE TABLE actor ( actor_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id) ) CREATE TABLE address ( address_id INTEGER NOT NULL, address VARCHAR(50) NOT NULL, address2 VARCHAR(50) DEFAULT NULL, district VARCHAR(20) NOT NULL, city_id INTEGER NOT NULL, postal_code VARCHAR(10) DEFAULT NULL, phone VARCHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (address_id), FOREIGN KEY(city_id) REFERENCES city (city_id) ) CREATE TABLE category ( category_id INTEGER NOT NULL, name VARCHAR(25) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (category_id) ) CREATE TABLE city ( city_id INTEGER NOT NULL, city VARCHAR(50) NOT NULL, country_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (city_id), FOREIGN KEY(country_id) REFERENCES country (country_id) ) CREATE TABLE country ( country_id INTEGER NOT NULL, country VARCHAR(50) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (country_id) ) CREATE TABLE customer ( customer_id INTEGER NOT NULL, store_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, email VARCHAR(50) DEFAULT NULL, address_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, create_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (customer_id), FOREIGN KEY(address_id) REFERENCES address (address_id), FOREIGN KEY(store_id) REFERENCES store (store_id) ) CREATE TABLE film ( film_id INTEGER NOT NULL, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, release_year NUMERIC DEFAULT NULL, language_id INTEGER NOT NULL, original_language_id INTEGER DEFAULT NULL, rental_duration INTEGER DEFAULT 3 NOT NULL, rental_rate DECIMAL(4, 2) DEFAULT 4.99 NOT NULL, length INTEGER DEFAULT NULL, replacement_cost DECIMAL(5, 2) DEFAULT 19.99 NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id), FOREIGN KEY(language_id) REFERENCES language (language_id), FOREIGN KEY(original_language_id) REFERENCES language (language_id) ) CREATE TABLE film_actor ( actor_id INTEGER NOT NULL, film_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id, film_id), FOREIGN KEY(actor_id) REFERENCES actor (actor_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) CREATE TABLE film_category ( film_id INTEGER NOT NULL, category_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id, category_id), FOREIGN KEY(film_id) REFERENCES film (film_id), FOREIGN KEY(category_id) REFERENCES category (category_id) ) CREATE TABLE film_text ( film_id SMALLINT NOT NULL, title VARCHAR(255) NOT NULL, description TEXT, PRIMARY KEY (film_id) ) CREATE TABLE inventory ( inventory_id INTEGER NOT NULL, film_id INTEGER NOT NULL, store_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (inventory_id), FOREIGN KEY(store_id) REFERENCES store (store_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) CREATE TABLE language ( language_id INTEGER NOT NULL, name CHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (language_id) ) CREATE TABLE payment ( payment_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, staff_id INTEGER NOT NULL, rental_id INTEGER DEFAULT NULL, amount DECIMAL(5, 2) NOT NULL, payment_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (payment_id), FOREIGN KEY(rental_id) REFERENCES rental (rental_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id) ) CREATE TABLE rental ( rental_id INTEGER NOT NULL, rental_date DATETIME NOT NULL, inventory_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, return_date DATETIME DEFAULT NULL, staff_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (rental_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory (inventory_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id) ) CREATE TABLE staff ( staff_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, address_id INTEGER NOT NULL, picture BLOB DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, store_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, username VARCHAR(16) NOT NULL, password VARCHAR(40) DEFAULT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) ) CREATE TABLE store ( store_id INTEGER NOT NULL, manager_staff_id INTEGER NOT NULL, address_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (store_id), FOREIGN KEY(manager_staff_id) REFERENCES staff (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) )
CREATE TABLE actor ( actor_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id) ) /* 2 rows from actor table: actor_id first_name last_name last_update 1 PENELOPE GUINESS 2006-02-15 04:34:33 2 NICK WAHLBERG 2006-02-15 04:34:33 */ CREATE TABLE address ( address_id INTEGER NOT NULL, address VARCHAR(50) NOT NULL, address2 VARCHAR(50) DEFAULT NULL, district VARCHAR(20) NOT NULL, city_id INTEGER NOT NULL, postal_code VARCHAR(10) DEFAULT NULL, phone VARCHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (address_id), FOREIGN KEY(city_id) REFERENCES city (city_id) ) /* 2 rows from address table: address_id address address2 district city_id postal_code phone last_update 1 47 MySakila Drive None Alberta 300 2006-02-15 04:45:30 2 28 MySQL Boulevard None QLD 576 2006-02-15 04:45:30 */ CREATE TABLE category ( category_id INTEGER NOT NULL, name VARCHAR(25) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (category_id) ) /* 2 rows from category table: category_id name last_update 1 Action 2006-02-15 04:46:27 2 Animation 2006-02-15 04:46:27 */ CREATE TABLE city ( city_id INTEGER NOT NULL, city VARCHAR(50) NOT NULL, country_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (city_id), FOREIGN KEY(country_id) REFERENCES country (country_id) ) /* 2 rows from city table: city_id city country_id last_update 1 A Corua (La Corua) 87 2006-02-15 04:45:25 2 Abha 82 2006-02-15 04:45:25 */ CREATE TABLE country ( country_id INTEGER NOT NULL, country VARCHAR(50) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (country_id) ) /* 2 rows from country table: country_id country last_update 1 Afghanistan 2006-02-15 04:44:00 2 Algeria 2006-02-15 04:44:00 */ CREATE TABLE customer ( customer_id INTEGER NOT NULL, store_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, email VARCHAR(50) DEFAULT NULL, address_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, create_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (customer_id), FOREIGN KEY(address_id) REFERENCES address (address_id), FOREIGN KEY(store_id) REFERENCES store (store_id) ) /* 2 rows from customer table: customer_id store_id first_name last_name email address_id active create_date last_update 1 1 MARY SMITH [email protected] 5 True 2006-02-14 22:04:36 2006-02-15 04:57:20 2 1 PATRICIA JOHNSON [email protected] 6 True 2006-02-14 22:04:36 2006-02-15 04:57:20 */ CREATE TABLE film ( film_id INTEGER NOT NULL, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, release_year NUMERIC DEFAULT NULL, language_id INTEGER NOT NULL, original_language_id INTEGER DEFAULT NULL, rental_duration INTEGER DEFAULT 3 NOT NULL, rental_rate DECIMAL(4, 2) DEFAULT 4.99 NOT NULL, length INTEGER DEFAULT NULL, replacement_cost DECIMAL(5, 2) DEFAULT 19.99 NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id), FOREIGN KEY(language_id) REFERENCES language (language_id), FOREIGN KEY(original_language_id) REFERENCES language (language_id) ) /* 2 rows from film table: film_id title description release_year language_id original_language_id rental_duration rental_rate length replacement_cost last_update 1 ACADEMY DINOSAUR A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies 2006.0000000000 1 None 6 0.99 86 20.99 2006-02-15 05:03:42 2 ACE GOLDFINGER A Astounding Epistle of a Database Administrator And a Explorer who must Find a Car in Ancient China 2006.0000000000 1 None 3 4.99 48 12.99 2006-02-15 05:03:42 */ CREATE TABLE film_actor ( actor_id INTEGER NOT NULL, film_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (actor_id, film_id), FOREIGN KEY(actor_id) REFERENCES actor (actor_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) /* 2 rows from film_actor table: actor_id film_id last_update 1 1 2006-02-15 05:05:03 1 23 2006-02-15 05:05:03 */ CREATE TABLE film_category ( film_id INTEGER NOT NULL, category_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (film_id, category_id), FOREIGN KEY(film_id) REFERENCES film (film_id), FOREIGN KEY(category_id) REFERENCES category (category_id) ) /* 2 rows from film_category table: film_id category_id last_update 1 6 2006-02-15 05:07:09 2 11 2006-02-15 05:07:09 */ CREATE TABLE film_text ( film_id SMALLINT NOT NULL, title VARCHAR(255) NOT NULL, description TEXT, PRIMARY KEY (film_id) ) /* 2 rows from film_text table: film_id title description */ CREATE TABLE inventory ( inventory_id INTEGER NOT NULL, film_id INTEGER NOT NULL, store_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (inventory_id), FOREIGN KEY(store_id) REFERENCES store (store_id), FOREIGN KEY(film_id) REFERENCES film (film_id) ) /* 2 rows from inventory table: inventory_id film_id store_id last_update 1 1 1 2006-02-15 05:09:17 2 1 1 2006-02-15 05:09:17 */ CREATE TABLE language ( language_id INTEGER NOT NULL, name CHAR(20) NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (language_id) ) /* 2 rows from language table: language_id name last_update */ CREATE TABLE payment ( payment_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, staff_id INTEGER NOT NULL, rental_id INTEGER DEFAULT NULL, amount DECIMAL(5, 2) NOT NULL, payment_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (payment_id), FOREIGN KEY(rental_id) REFERENCES rental (rental_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id) ) /* 2 rows from payment table: payment_id customer_id staff_id rental_id amount payment_date last_update 1 1 1 76 2.99 2005-05-25 11:30:37 2006-02-15 22:12:30 2 1 1 573 0.99 2005-05-28 10:35:23 2006-02-15 22:12:30 */ CREATE TABLE rental ( rental_id INTEGER NOT NULL, rental_date DATETIME NOT NULL, inventory_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, return_date DATETIME DEFAULT NULL, staff_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (rental_id), FOREIGN KEY(staff_id) REFERENCES staff (staff_id), FOREIGN KEY(inventory_id) REFERENCES inventory (inventory_id), FOREIGN KEY(customer_id) REFERENCES customer (customer_id) ) /* 2 rows from rental table: rental_id rental_date inventory_id customer_id return_date staff_id last_update 1 2005-05-24 22:53:30 367 130 2005-05-26 22:04:30 1 2006-02-15 21:30:53 2 2005-05-24 22:54:33 1525 459 2005-05-28 19:40:33 1 2006-02-15 21:30:53 */ CREATE TABLE staff ( staff_id INTEGER NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, address_id INTEGER NOT NULL, picture BLOB DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, store_id INTEGER NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, username VARCHAR(16) NOT NULL, password VARCHAR(40) DEFAULT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) ) /* 2 rows from staff table: staff_id first_name last_name address_id picture email store_id active username password last_update */ CREATE TABLE store ( store_id INTEGER NOT NULL, manager_staff_id INTEGER NOT NULL, address_id INTEGER NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (store_id), FOREIGN KEY(manager_staff_id) REFERENCES staff (staff_id), FOREIGN KEY(address_id) REFERENCES address (address_id) ) /* 2 rows from store table: store_id manager_staff_id address_id last_update */
Which film has the most copies in the inventory? List both title and id.
SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1
[{'title': 'ZORRO ARK', 'film_id': 1000}]
Medium
false
false
false
true
true
true
false
true
false
false
false
false
false
[QUESTION]Find the movie which is classified in the most number of genres[/QUESTION] [SQL]SELECT t3.title FROM genre AS t2 JOIN classification AS t1 ON t2.gid = t1.gid JOIN movie AS t3 ON t3.mid = t1.msid GROUP BY t3.title ORDER BY COUNT ( DISTINCT t2.genre ) DESC LIMIT 1;[/SQL]
inn_1
CREATE TABLE "Reservations" ( "Code" INTEGER, "Room" TEXT, "CheckIn" TEXT, "CheckOut" TEXT, "Rate" REAL, "LastName" TEXT, "FirstName" TEXT, "Adults" INTEGER, "Kids" INTEGER, PRIMARY KEY ("Code"), FOREIGN KEY("Room") REFERENCES "Rooms" ("RoomId") ) CREATE TABLE "Rooms" ( "RoomId" TEXT, "roomName" TEXT, beds INTEGER, "bedType" TEXT, "maxOccupancy" INTEGER, "basePrice" INTEGER, decor TEXT, PRIMARY KEY ("RoomId") )
CREATE TABLE "Reservations" ( "Code" INTEGER, "Room" TEXT, "CheckIn" TEXT, "CheckOut" TEXT, "Rate" REAL, "LastName" TEXT, "FirstName" TEXT, "Adults" INTEGER, "Kids" INTEGER, PRIMARY KEY ("Code"), FOREIGN KEY("Room") REFERENCES "Rooms" ("RoomId") ) /* 2 rows from Reservations table: Code Room CheckIn CheckOut Rate LastName FirstName Adults Kids 10105 HBB 23-OCT-10 25-OCT-10 100.0 SELBIG CONRAD 1 0 10183 IBD 19-SEP-10 20-SEP-10 150.0 GABLER DOLLIE 2 0 */ CREATE TABLE "Rooms" ( "RoomId" TEXT, "roomName" TEXT, beds INTEGER, "bedType" TEXT, "maxOccupancy" INTEGER, "basePrice" INTEGER, decor TEXT, PRIMARY KEY ("RoomId") ) /* 2 rows from Rooms table: RoomId roomName beds bedType maxOccupancy basePrice decor RND Recluse and defiance 1 King 2 150 modern IBS Interim but salutary 1 King 2 150 traditional */
What are the names of rooms that have either king or queen bed?
SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen";
[{'roomName': 'Recluse and defiance'}, {'roomName': 'Interim but salutary'}, {'roomName': 'Abscond or bolster'}, {'roomName': 'Harbinger but bequest'}, {'roomName': 'Immutable before decorum'}, {'roomName': 'Convoke and sanguine'}, {'roomName': 'Riddle to exculpate'}, {'roomName': 'Frugal not apropos'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What are the names of properties that are either houses or apartments with more than 1 room?[/QUESTION] [SQL]SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1[/SQL]
[QUESTION]What are the names of properties that are either houses or apartments with more than 1 room?[/QUESTION] [SQL]SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1[/SQL]
[QUESTION]What are the names of properties that are either houses or apartments with more than 1 room?[/QUESTION] [SQL]SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1[/SQL]
[QUESTION]What are the names of properties that are either houses or apartments with more than 1 room?[/QUESTION] [SQL]SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1[/SQL]
tracking_software_problems
CREATE TABLE "Problem_Category_Codes" ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80), PRIMARY KEY (problem_category_code) ) CREATE TABLE "Problem_Log" ( problem_log_id INTEGER, assigned_to_staff_id INTEGER NOT NULL, problem_id INTEGER NOT NULL, problem_category_code VARCHAR(20) NOT NULL, problem_status_code VARCHAR(20) NOT NULL, log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(255), PRIMARY KEY (problem_log_id), FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code) ) CREATE TABLE "Problem_Status_Codes" ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80), PRIMARY KEY (problem_status_code) ) CREATE TABLE "Problems" ( problem_id INTEGER, product_id INTEGER NOT NULL, closure_authorised_by_staff_id INTEGER NOT NULL, reported_by_staff_id INTEGER NOT NULL, date_problem_reported DATETIME NOT NULL, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255), PRIMARY KEY (problem_id), FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(product_id) REFERENCES "Product" (product_id), FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id) ) CREATE TABLE "Product" ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255), PRIMARY KEY (product_id) ) CREATE TABLE "Staff" ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255), PRIMARY KEY (staff_id) )
CREATE TABLE "Problem_Category_Codes" ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80), PRIMARY KEY (problem_category_code) ) /* 2 rows from Problem_Category_Codes table: problem_category_code problem_category_description Datatabase Database design or contents. GUI User Interface. */ CREATE TABLE "Problem_Log" ( problem_log_id INTEGER, assigned_to_staff_id INTEGER NOT NULL, problem_id INTEGER NOT NULL, problem_category_code VARCHAR(20) NOT NULL, problem_status_code VARCHAR(20) NOT NULL, log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(255), PRIMARY KEY (problem_log_id), FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code) ) /* 2 rows from Problem_Log table: problem_log_id assigned_to_staff_id problem_id problem_category_code problem_status_code log_entry_date log_entry_description log_entry_fix other_log_details 1 11 11 Middleware Solved 2011-03-13 13:11:57 t k p 2 11 8 GUI Solved 1976-03-31 14:03:02 a k s */ CREATE TABLE "Problem_Status_Codes" ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80), PRIMARY KEY (problem_status_code) ) /* 2 rows from Problem_Status_Codes table: problem_status_code problem_status_description Reported Reported Solved Solved */ CREATE TABLE "Problems" ( problem_id INTEGER, product_id INTEGER NOT NULL, closure_authorised_by_staff_id INTEGER NOT NULL, reported_by_staff_id INTEGER NOT NULL, date_problem_reported DATETIME NOT NULL, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255), PRIMARY KEY (problem_id), FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(product_id) REFERENCES "Product" (product_id), FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id) ) /* 2 rows from Problems table: problem_id product_id closure_authorised_by_staff_id reported_by_staff_id date_problem_reported date_problem_closed problem_description other_problem_details 1 4 4 2 1978-06-26 19:10:17 2012-07-22 19:24:26 x p 2 8 3 10 1988-11-07 16:09:31 1973-06-07 04:13:51 w p */ CREATE TABLE "Product" ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255), PRIMARY KEY (product_id) ) /* 2 rows from Product table: product_id product_name product_details 1 rose k 2 yellow q */ CREATE TABLE "Staff" ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255), PRIMARY KEY (staff_id) ) /* 2 rows from Staff table: staff_id staff_first_name staff_last_name other_staff_details 1 Lacey Bosco m 2 Dameon Frami x */
How many problems did the product called "voluptatem" have in record?
SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem"
[{'count(*)': 0}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
who has papers at NIPS ?
SELECT DISTINCT t1.authorid FROM venue AS t3 JOIN paper AS t2 ON t3.venueid = t2.venueid JOIN writes AS t1 ON t1.paperid = t2.paperid WHERE t3.venuename = "NIPS";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
true
false
false
false
false
false
false
false
true
false
false
false
false
wine_1
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") )
CREATE TABLE appellations ( "No" INTEGER, "Appelation" TEXT, "County" TEXT, "State" TEXT, "Area" TEXT, "isAVA" TEXT, PRIMARY KEY ("No"), UNIQUE ("Appelation") ) /* 2 rows from appellations table: No Appelation County State Area isAVA 1 Alexander Valley Sonoma California North Coast Yes 2 Amador County Amador California Sierra Foothills No */ CREATE TABLE grapes ( "ID" INTEGER, "Grape" TEXT, "Color" TEXT, PRIMARY KEY ("ID"), UNIQUE ("Grape") ) /* 2 rows from grapes table: ID Grape Color 1 Barbera Red 2 Cabernet Franc Red */ CREATE TABLE wine ( "No" INTEGER, "Grape" TEXT, "Winery" TEXT, "Appelation" TEXT, "State" TEXT, "Name" TEXT, "Year" INTEGER, "Price" INTEGER, "Score" INTEGER, "Cases" INTEGER, "Drink" TEXT, FOREIGN KEY("Grape") REFERENCES grapes ("Grape"), FOREIGN KEY("Appelation") REFERENCES appellations ("Appelation") ) /* 2 rows from wine table: No Grape Winery Appelation State Name Year Price Score Cases Drink 1 Zinfandel Robert Biale St. Helena California Old Kraft Vineyard 2008 44 93 275 now 2 Zinfandel Chiarello Family Napa Valley California Giana 2008 35 93 480 now */
What are the average price and score of wines for each appelation?
SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation
[{'avg(Price)': 29.142857142857142, 'avg(Score)': 88.14285714285714, 'Appelation': 'Alexander Valley'}, {'avg(Price)': 31.5, 'avg(Score)': 90.0, 'Appelation': 'Amador County'}, {'avg(Price)': 18.0, 'avg(Score)': 87.0, 'Appelation': 'Amador-Mendocino-Sonoma Counties'}, {'avg(Price)': 53.333333333333336, 'avg(Score)': 92.33333333333333, 'Appelation': 'Anderson Valley'}, {'avg(Price)': 31.0, 'avg(Score)': 92.0, 'Appelation': 'Arroyo Grande Valley'}, {'avg(Price)': 125.0, 'avg(Score)': 88.0, 'Appelation': 'Atlas Peak'}, {'avg(Price)': 46.5, 'avg(Score)': 91.0, 'Appelation': 'Bennett Valley'}, {'avg(Price)': 20.0, 'avg(Score)': 84.0, 'Appelation': 'Calaveras County'}, {'avg(Price)': 39.48275862068966, 'avg(Score)': 87.82758620689656, 'Appelation': 'California'}, {'avg(Price)': 36.166666666666664, 'avg(Score)': 90.0, 'Appelation': 'Carneros'}, {'avg(Price)': 13.0, 'avg(Score)': 87.0, 'Appelation': 'Central Coast'}, {'avg(Price)': 52.5, 'avg(Score)': 92.0, 'Appelation': 'Chalk Hill'}, {'avg(Price)': 25.0, 'avg(Score)': 92.0, 'Appelation': 'Chalone'}, {'avg(Price)': 27.8, 'avg(Score)': 87.2, 'Appelation': 'Contra Costa County'}, {'avg(Price)': 27.653846153846153, 'avg(Score)': 89.3076923076923, 'Appelation': 'Dry Creek Valley'}, {'avg(Price)': 29.5, 'avg(Score)': 89.0, 'Appelation': 'Edna Valley'}, {'avg(Price)': 25.0, 'avg(Score)': 78.0, 'Appelation': 'Fiddletown'}, {'avg(Price)': 40.0, 'avg(Score)': 91.0, 'Appelation': 'Green Valley of Russian River Valley'}, {'avg(Price)': 20.0, 'avg(Score)': 87.0, 'Appelation': 'Guenoc Valley'}, {'avg(Price)': 21.0, 'avg(Score)': 88.0, 'Appelation': 'Happy Canyon of Santa Barbara'}, {'avg(Price)': 29.0, 'avg(Score)': 93.0, 'Appelation': 'Howell Mountain'}, {'avg(Price)': 37.5, 'avg(Score)': 89.5, 'Appelation': 'Knights Valley'}, {'avg(Price)': 26.0, 'avg(Score)': 87.0, 'Appelation': 'Lake County'}, {'avg(Price)': 40.0, 'avg(Score)': 89.0, 'Appelation': 'Livermore Valley'}, {'avg(Price)': 21.5, 'avg(Score)': 87.5, 'Appelation': 'Lodi'}, {'avg(Price)': 15.333333333333334, 'avg(Score)': 86.33333333333333, 'Appelation': 'Mendocino County'}, {'avg(Price)': 22.5, 'avg(Score)': 89.0, 'Appelation': 'Monterey County'}, {'avg(Price)': 38.333333333333336, 'avg(Score)': 90.66666666666667, 'Appelation': 'Mount Harlan'}, {'avg(Price)': 53.333333333333336, 'avg(Score)': 90.66666666666667, 'Appelation': 'Mount Vedeer'}, {'avg(Price)': 59.135416666666664, 'avg(Score)': 90.47916666666667, 'Appelation': 'Napa Valley'}, {'avg(Price)': 18.0, 'avg(Score)': 86.0, 'Appelation': 'Napa-Sonoma counties'}, {'avg(Price)': 12.0, 'avg(Score)': 85.0, 'Appelation': 'North Coast'}, {'avg(Price)': 95.0, 'avg(Score)': 90.5, 'Appelation': 'Oakville'}, {'avg(Price)': 32.285714285714285, 'avg(Score)': 88.42857142857143, 'Appelation': 'Paso Robles'}, {'avg(Price)': 49.0, 'avg(Score)': 90.5, 'Appelation': 'Red Hills Lake County'}, {'avg(Price)': 38.0, 'avg(Score)': 90.0, 'Appelation': 'Rockpile'}, {'avg(Price)': 49.60377358490566, 'avg(Score)': 91.79245283018868, 'Appelation': 'Russian River Valley'}, {'avg(Price)': 45.714285714285715, 'avg(Score)': 89.42857142857143, 'Appelation': 'Rutherford'}, {'avg(Price)': 31.5, 'avg(Score)': 89.5, 'Appelation': 'San Luis Obispo County'}, {'avg(Price)': 28.0, 'avg(Score)': 89.41666666666667, 'Appelation': 'Santa Barbara County'}, {'avg(Price)': 40.0, 'avg(Score)': 93.0, 'Appelation': 'Santa Cruz Mountains'}, {'avg(Price)': 46.285714285714285, 'avg(Score)': 91.23809523809524, 'Appelation': 'Santa Lucia Highlands'}, {'avg(Price)': 41.5, 'avg(Score)': 91.25, 'Appelation': 'Santa Maria Valley'}, {'avg(Price)': 29.333333333333332, 'avg(Score)': 88.73333333333333, 'Appelation': 'Santa Ynez Valley'}, {'avg(Price)': 25.0, 'avg(Score)': 86.0, 'Appelation': 'Shenandoah Valley'}, {'avg(Price)': 10.0, 'avg(Score)': 82.0, 'Appelation': 'Sierra Foothills'}, {'avg(Price)': 35.0, 'avg(Score)': 89.0, 'Appelation': 'Solano County'}, {'avg(Price)': 49.02564102564103, 'avg(Score)': 90.82051282051282, 'Appelation': 'Sonoma Coast'}, {'avg(Price)': 43.48148148148148, 'avg(Score)': 90.4074074074074, 'Appelation': 'Sonoma County'}, {'avg(Price)': 42.68421052631579, 'avg(Score)': 89.78947368421052, 'Appelation': 'Sonoma Valley'}, {'avg(Price)': 15.0, 'avg(Score)': 86.0, 'Appelation': 'Sonoma-Lake Counties'}, {'avg(Price)': 70.66666666666667, 'avg(Score)': 89.33333333333333, 'Appelation': 'Spring Mountain District'}, {'avg(Price)': 77.5, 'avg(Score)': 91.5, 'Appelation': 'St. Helena'}, {'avg(Price)': 60.35294117647059, 'avg(Score)': 90.88235294117646, 'Appelation': 'Sta. Rita Hills'}, {'avg(Price)': 84.5, 'avg(Score)': 92.25, 'Appelation': 'Stags Leap District'}, {'avg(Price)': 25.0, 'avg(Score)': 91.0, 'Appelation': 'Yolo County'}, {'avg(Price)': 90.0, 'avg(Score)': 90.0, 'Appelation': 'Yountville'}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
products_gen_characteristics
CREATE TABLE "Characteristics" ( characteristic_id INTEGER, characteristic_type_code VARCHAR(15) NOT NULL, characteristic_data_type VARCHAR(10), characteristic_name VARCHAR(80), other_characteristic_details VARCHAR(255), PRIMARY KEY (characteristic_id), FOREIGN KEY(characteristic_type_code) REFERENCES "Ref_Characteristic_Types" (characteristic_type_code) ) CREATE TABLE "Product_Characteristics" ( product_id INTEGER NOT NULL, characteristic_id INTEGER NOT NULL, product_characteristic_value VARCHAR(50), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(characteristic_id) REFERENCES "Characteristics" (characteristic_id) ) CREATE TABLE "Products" ( product_id INTEGER, color_code VARCHAR(15) NOT NULL, product_category_code VARCHAR(15) NOT NULL, product_name VARCHAR(80), typical_buying_price VARCHAR(20), typical_selling_price VARCHAR(20), product_description VARCHAR(255), other_product_details VARCHAR(255), PRIMARY KEY (product_id), FOREIGN KEY(color_code) REFERENCES "Ref_Colors" (color_code), FOREIGN KEY(product_category_code) REFERENCES "Ref_Product_Categories" (product_category_code) ) CREATE TABLE "Ref_Characteristic_Types" ( characteristic_type_code VARCHAR(15), characteristic_type_description VARCHAR(80), PRIMARY KEY (characteristic_type_code) ) CREATE TABLE "Ref_Colors" ( color_code VARCHAR(15), color_description VARCHAR(80), PRIMARY KEY (color_code) ) CREATE TABLE "Ref_Product_Categories" ( product_category_code VARCHAR(15), product_category_description VARCHAR(80), unit_of_measure VARCHAR(20), PRIMARY KEY (product_category_code) )
CREATE TABLE "Characteristics" ( characteristic_id INTEGER, characteristic_type_code VARCHAR(15) NOT NULL, characteristic_data_type VARCHAR(10), characteristic_name VARCHAR(80), other_characteristic_details VARCHAR(255), PRIMARY KEY (characteristic_id), FOREIGN KEY(characteristic_type_code) REFERENCES "Ref_Characteristic_Types" (characteristic_type_code) ) /* 2 rows from Characteristics table: characteristic_id characteristic_type_code characteristic_data_type characteristic_name other_characteristic_details 1 Grade numquam slow None 2 Grade doloribus fast None */ CREATE TABLE "Product_Characteristics" ( product_id INTEGER NOT NULL, characteristic_id INTEGER NOT NULL, product_characteristic_value VARCHAR(50), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(characteristic_id) REFERENCES "Characteristics" (characteristic_id) ) /* 2 rows from Product_Characteristics table: product_id characteristic_id product_characteristic_value 13 13 low 11 2 low */ CREATE TABLE "Products" ( product_id INTEGER, color_code VARCHAR(15) NOT NULL, product_category_code VARCHAR(15) NOT NULL, product_name VARCHAR(80), typical_buying_price VARCHAR(20), typical_selling_price VARCHAR(20), product_description VARCHAR(255), other_product_details VARCHAR(255), PRIMARY KEY (product_id), FOREIGN KEY(color_code) REFERENCES "Ref_Colors" (color_code), FOREIGN KEY(product_category_code) REFERENCES "Ref_Product_Categories" (product_category_code) ) /* 2 rows from Products table: product_id color_code product_category_code product_name typical_buying_price typical_selling_price product_description other_product_details 1 4 Spices cumin 2878.3 et None 2 2 Spices peper 352447.2874677 1892070.2803543 rerum None */ CREATE TABLE "Ref_Characteristic_Types" ( characteristic_type_code VARCHAR(15), characteristic_type_description VARCHAR(80), PRIMARY KEY (characteristic_type_code) ) /* 2 rows from Ref_Characteristic_Types table: characteristic_type_code characteristic_type_description Grade Grade Purity Purity */ CREATE TABLE "Ref_Colors" ( color_code VARCHAR(15), color_description VARCHAR(80), PRIMARY KEY (color_code) ) /* 2 rows from Ref_Colors table: color_code color_description 9 red 5 green */ CREATE TABLE "Ref_Product_Categories" ( product_category_code VARCHAR(15), product_category_description VARCHAR(80), unit_of_measure VARCHAR(20), PRIMARY KEY (product_category_code) ) /* 2 rows from Ref_Product_Categories table: product_category_code product_category_description unit_of_measure Herbs Herbs Handful Seeds Seeds Weight - pound,kilo. */
What is the unit of measurement of product named "cumin"?
SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "cumin"
[{'unit_of_measure': 'Weight - pound,kilo.'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
customers_card_transactions
CREATE TABLE "Accounts" ( account_id INTEGER, customer_id INTEGER NOT NULL, account_name VARCHAR(50), other_account_details VARCHAR(255), PRIMARY KEY (account_id) ) CREATE TABLE "Customers" ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255), PRIMARY KEY (customer_id) ) CREATE TABLE "Customers_Cards" ( card_id INTEGER, customer_id INTEGER NOT NULL, card_type_code VARCHAR(15) NOT NULL, card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255), PRIMARY KEY (card_id) ) CREATE TABLE "Financial_Transactions" ( transaction_id INTEGER NOT NULL, previous_transaction_id INTEGER, account_id INTEGER NOT NULL, card_id INTEGER NOT NULL, transaction_type VARCHAR(15) NOT NULL, transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255), FOREIGN KEY(account_id) REFERENCES "Accounts" (account_id), FOREIGN KEY(card_id) REFERENCES "Customers_Cards" (card_id) )
CREATE TABLE "Accounts" ( account_id INTEGER, customer_id INTEGER NOT NULL, account_name VARCHAR(50), other_account_details VARCHAR(255), PRIMARY KEY (account_id) ) /* 2 rows from Accounts table: account_id customer_id account_name other_account_details 1 6 338 Regular 2 14 562 VIP */ CREATE TABLE "Customers" ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255), PRIMARY KEY (customer_id) ) /* 2 rows from Customers table: customer_id customer_first_name customer_last_name customer_address customer_phone customer_email other_customer_details 1 Aniyah Feest 55975 Theodore Estates Lake Brody, VT 57078 (673)872-5338 [email protected] None 2 Susie Wiza 6478 Moen Isle Suite 910 Schimmelmouth, VT 96364-4898 679-845-8645x94312 [email protected] None */ CREATE TABLE "Customers_Cards" ( card_id INTEGER, customer_id INTEGER NOT NULL, card_type_code VARCHAR(15) NOT NULL, card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255), PRIMARY KEY (card_id) ) /* 2 rows from Customers_Cards table: card_id customer_id card_type_code card_number date_valid_from date_valid_to other_card_details 1 14 Credit 4560596484842 2011-04-17 09:05:28 2018-03-07 17:06:19 5567915676420343 2 9 Credit 4859448397570735 2012-05-22 02:05:41 2018-02-25 15:43:32 4539333582760 */ CREATE TABLE "Financial_Transactions" ( transaction_id INTEGER NOT NULL, previous_transaction_id INTEGER, account_id INTEGER NOT NULL, card_id INTEGER NOT NULL, transaction_type VARCHAR(15) NOT NULL, transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255), FOREIGN KEY(account_id) REFERENCES "Accounts" (account_id), FOREIGN KEY(card_id) REFERENCES "Customers_Cards" (card_id) ) /* 2 rows from Financial_Transactions table: transaction_id previous_transaction_id account_id card_id transaction_type transaction_date transaction_amount transaction_comment other_transaction_details 1 925 15 1 Payment 2018-03-24 06:41:41 1701.23 None None 2 494 3 2 Refund 2018-03-24 12:08:55 1931.76 None None */
What are the ids, full names, and phones of each customer?
SELECT customer_id , customer_first_name , customer_last_name , customer_phone FROM Customers
[{'customer_id': 1, 'customer_first_name': 'Aniyah', 'customer_last_name': 'Feest', 'customer_phone': '(673)872-5338'}, {'customer_id': 2, 'customer_first_name': 'Susie', 'customer_last_name': 'Wiza', 'customer_phone': '679-845-8645x94312'}, {'customer_id': 3, 'customer_first_name': 'Marcel', 'customer_last_name': 'Brekke', 'customer_phone': '1-511-656-6664'}, {'customer_id': 4, 'customer_first_name': 'Art', 'customer_last_name': 'Turcotte', 'customer_phone': '941-213-6716x675'}, {'customer_id': 5, 'customer_first_name': 'Armani', 'customer_last_name': 'Farrell', 'customer_phone': '224-123-1012'}, {'customer_id': 6, 'customer_first_name': 'Kiel', 'customer_last_name': 'Schinner', 'customer_phone': '1-564-044-3909'}, {'customer_id': 7, 'customer_first_name': 'Izabella', 'customer_last_name': 'Erdman', 'customer_phone': '751.049.9948'}, {'customer_id': 8, 'customer_first_name': 'Elyssa', 'customer_last_name': 'Lind', 'customer_phone': '+12(6)9024410984'}, {'customer_id': 9, 'customer_first_name': 'Faustino', 'customer_last_name': 'Langworth', 'customer_phone': '284.749.0453'}, {'customer_id': 10, 'customer_first_name': 'Axel', 'customer_last_name': 'Effertz', 'customer_phone': '+90(8)1290735932'}, {'customer_id': 11, 'customer_first_name': 'Frederic', 'customer_last_name': 'Swift', 'customer_phone': '1-207-977-5182'}, {'customer_id': 12, 'customer_first_name': 'Bryce', 'customer_last_name': 'Rath', 'customer_phone': '(415)237-0701x3115'}, {'customer_id': 13, 'customer_first_name': 'Serenity', 'customer_last_name': 'Effertz', 'customer_phone': '1-894-567-2283'}, {'customer_id': 14, 'customer_first_name': 'Blanche', 'customer_last_name': 'Huels', 'customer_phone': '(703)950-4708x8972'}, {'customer_id': 15, 'customer_first_name': 'Nat', 'customer_last_name': 'Davis', 'customer_phone': '246-469-4472x359'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What are the email, cell phone and home phone of each professional?[/QUESTION] [SQL]SELECT email_address , cell_number , home_phone FROM professionals[/SQL]
[QUESTION]What are the email, cell phone and home phone of each professional?[/QUESTION] [SQL]SELECT email_address , cell_number , home_phone FROM professionals[/SQL]
[QUESTION]What are the email, cell phone and home phone of each professional?[/QUESTION] [SQL]SELECT email_address , cell_number , home_phone FROM professionals[/SQL]
[QUESTION]What are the email, cell phone and home phone of each professional?[/QUESTION] [SQL]SELECT email_address , cell_number , home_phone FROM professionals[/SQL]
county_public_safety
CREATE TABLE city ( "City_ID" INTEGER, "County_ID" INTEGER, "Name" TEXT, "White" REAL, "Black" REAL, "Amerindian" REAL, "Asian" REAL, "Multiracial" REAL, "Hispanic" REAL, PRIMARY KEY ("City_ID"), FOREIGN KEY("County_ID") REFERENCES county_public_safety ("County_ID") ) CREATE TABLE county_public_safety ( "County_ID" INTEGER, "Name" TEXT, "Population" INTEGER, "Police_officers" INTEGER, "Residents_per_officer" INTEGER, "Case_burden" INTEGER, "Crime_rate" REAL, "Police_force" TEXT, "Location" TEXT, PRIMARY KEY ("County_ID") )
CREATE TABLE city ( "City_ID" INTEGER, "County_ID" INTEGER, "Name" TEXT, "White" REAL, "Black" REAL, "Amerindian" REAL, "Asian" REAL, "Multiracial" REAL, "Hispanic" REAL, PRIMARY KEY ("City_ID"), FOREIGN KEY("County_ID") REFERENCES county_public_safety ("County_ID") ) /* 2 rows from city table: City_ID County_ID Name White Black Amerindian Asian Multiracial Hispanic 1 1 Adjuntas 93.1 3.1 0.3 0.0 3.4 99.6 2 1 Aguada 86.6 5.3 0.3 0.1 7.7 99.4 */ CREATE TABLE county_public_safety ( "County_ID" INTEGER, "Name" TEXT, "Population" INTEGER, "Police_officers" INTEGER, "Residents_per_officer" INTEGER, "Case_burden" INTEGER, "Crime_rate" REAL, "Police_force" TEXT, "Location" TEXT, PRIMARY KEY ("County_ID") ) /* 2 rows from county_public_safety table: County_ID Name Population Police_officers Residents_per_officer Case_burden Crime_rate Police_force Location 1 Abbotsford 128165 187 685 81 118.0 Abbotsford Police Department East 2 Burnaby 204320 253 808 100 123.0 RCMP East */
What are the names of cities, as well as the names of the counties they correspond to?
SELECT T1.Name , T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID
[{'Name': 'Abbotsford'}, {'Name': 'Abbotsford'}, {'Name': 'Abbotsford'}, {'Name': 'Burnaby'}, {'Name': 'Burnaby'}, {'Name': 'Campbell River'}, {'Name': 'Campbell River'}, {'Name': 'Campbell River'}, {'Name': 'Campbell River'}, {'Name': 'Campbell River'}, {'Name': 'Campbell River'}, {'Name': 'Castlegar'}, {'Name': 'Castlegar'}, {'Name': 'Central Saanich'}, {'Name': 'Central Saanich'}, {'Name': 'Chilliwack'}, {'Name': 'Chilliwack'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
[QUESTION]What are the different district names in order of descending city area?[/QUESTION] [SQL]SELECT DISTINCT District_name FROM district ORDER BY city_area DESC[/SQL]
[QUESTION]What are the different district names in order of descending city area?[/QUESTION] [SQL]SELECT DISTINCT District_name FROM district ORDER BY city_area DESC[/SQL]
[QUESTION]What are the different district names in order of descending city area?[/QUESTION] [SQL]SELECT DISTINCT District_name FROM district ORDER BY city_area DESC[/SQL]
[QUESTION]What are the different district names in order of descending city area?[/QUESTION] [SQL]SELECT DISTINCT District_name FROM district ORDER BY city_area DESC[/SQL]
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
List papers that has a keyword Question Answering
SELECT DISTINCT t3.paperid FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid WHERE t1.keyphrasename = "Question Answering";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
true
false
false
false
false
false
false
false
true
false
false
false
false
[QUESTION]return me the keywords, which have been contained by more than 100 papers in PVLDB .[/QUESTION] [SQL]SELECT t1.keyword FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t3.name = "PVLDB" GROUP BY t1.keyword HAVING COUNT ( DISTINCT t2.title ) > 100;[/SQL]
[QUESTION]return me the keywords, which have been contained by more than 100 papers in PVLDB .[/QUESTION] [SQL]SELECT t1.keyword FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t3.name = "PVLDB" GROUP BY t1.keyword HAVING COUNT ( DISTINCT t2.title ) > 100;[/SQL]
[QUESTION]return me the keywords, which have been contained by more than 100 papers in PVLDB .[/QUESTION] [SQL]SELECT t1.keyword FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t3.name = "PVLDB" GROUP BY t1.keyword HAVING COUNT ( DISTINCT t2.title ) > 100;[/SQL]
tracking_software_problems
CREATE TABLE "Problem_Category_Codes" ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80), PRIMARY KEY (problem_category_code) ) CREATE TABLE "Problem_Log" ( problem_log_id INTEGER, assigned_to_staff_id INTEGER NOT NULL, problem_id INTEGER NOT NULL, problem_category_code VARCHAR(20) NOT NULL, problem_status_code VARCHAR(20) NOT NULL, log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(255), PRIMARY KEY (problem_log_id), FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code) ) CREATE TABLE "Problem_Status_Codes" ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80), PRIMARY KEY (problem_status_code) ) CREATE TABLE "Problems" ( problem_id INTEGER, product_id INTEGER NOT NULL, closure_authorised_by_staff_id INTEGER NOT NULL, reported_by_staff_id INTEGER NOT NULL, date_problem_reported DATETIME NOT NULL, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255), PRIMARY KEY (problem_id), FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(product_id) REFERENCES "Product" (product_id), FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id) ) CREATE TABLE "Product" ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255), PRIMARY KEY (product_id) ) CREATE TABLE "Staff" ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255), PRIMARY KEY (staff_id) )
CREATE TABLE "Problem_Category_Codes" ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80), PRIMARY KEY (problem_category_code) ) /* 2 rows from Problem_Category_Codes table: problem_category_code problem_category_description Datatabase Database design or contents. GUI User Interface. */ CREATE TABLE "Problem_Log" ( problem_log_id INTEGER, assigned_to_staff_id INTEGER NOT NULL, problem_id INTEGER NOT NULL, problem_category_code VARCHAR(20) NOT NULL, problem_status_code VARCHAR(20) NOT NULL, log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(255), PRIMARY KEY (problem_log_id), FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code) ) /* 2 rows from Problem_Log table: problem_log_id assigned_to_staff_id problem_id problem_category_code problem_status_code log_entry_date log_entry_description log_entry_fix other_log_details 1 11 11 Middleware Solved 2011-03-13 13:11:57 t k p 2 11 8 GUI Solved 1976-03-31 14:03:02 a k s */ CREATE TABLE "Problem_Status_Codes" ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80), PRIMARY KEY (problem_status_code) ) /* 2 rows from Problem_Status_Codes table: problem_status_code problem_status_description Reported Reported Solved Solved */ CREATE TABLE "Problems" ( problem_id INTEGER, product_id INTEGER NOT NULL, closure_authorised_by_staff_id INTEGER NOT NULL, reported_by_staff_id INTEGER NOT NULL, date_problem_reported DATETIME NOT NULL, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255), PRIMARY KEY (problem_id), FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(product_id) REFERENCES "Product" (product_id), FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id) ) /* 2 rows from Problems table: problem_id product_id closure_authorised_by_staff_id reported_by_staff_id date_problem_reported date_problem_closed problem_description other_problem_details 1 4 4 2 1978-06-26 19:10:17 2012-07-22 19:24:26 x p 2 8 3 10 1988-11-07 16:09:31 1973-06-07 04:13:51 w p */ CREATE TABLE "Product" ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255), PRIMARY KEY (product_id) ) /* 2 rows from Product table: product_id product_name product_details 1 rose k 2 yellow q */ CREATE TABLE "Staff" ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255), PRIMARY KEY (staff_id) ) /* 2 rows from Staff table: staff_id staff_first_name staff_last_name other_staff_details 1 Lacey Bosco m 2 Dameon Frami x */
What are the log id and entry description of each problem?
SELECT problem_log_id , log_entry_description FROM problem_log
[{'problem_log_id': 1, 'log_entry_description': 't'}, {'problem_log_id': 2, 'log_entry_description': 'a'}, {'problem_log_id': 3, 'log_entry_description': 'b'}, {'problem_log_id': 4, 'log_entry_description': 'a'}, {'problem_log_id': 5, 'log_entry_description': 'c'}, {'problem_log_id': 6, 'log_entry_description': 'h'}, {'problem_log_id': 7, 'log_entry_description': 's'}, {'problem_log_id': 8, 'log_entry_description': 'j'}, {'problem_log_id': 9, 'log_entry_description': 'p'}, {'problem_log_id': 10, 'log_entry_description': 'd'}, {'problem_log_id': 11, 'log_entry_description': 'w'}, {'problem_log_id': 12, 'log_entry_description': 'c'}, {'problem_log_id': 13, 'log_entry_description': 'q'}, {'problem_log_id': 14, 'log_entry_description': 'a'}, {'problem_log_id': 15, 'log_entry_description': 'v'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
tracking_software_problems
CREATE TABLE "Problem_Category_Codes" ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80), PRIMARY KEY (problem_category_code) ) CREATE TABLE "Problem_Log" ( problem_log_id INTEGER, assigned_to_staff_id INTEGER NOT NULL, problem_id INTEGER NOT NULL, problem_category_code VARCHAR(20) NOT NULL, problem_status_code VARCHAR(20) NOT NULL, log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(255), PRIMARY KEY (problem_log_id), FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code) ) CREATE TABLE "Problem_Status_Codes" ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80), PRIMARY KEY (problem_status_code) ) CREATE TABLE "Problems" ( problem_id INTEGER, product_id INTEGER NOT NULL, closure_authorised_by_staff_id INTEGER NOT NULL, reported_by_staff_id INTEGER NOT NULL, date_problem_reported DATETIME NOT NULL, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255), PRIMARY KEY (problem_id), FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(product_id) REFERENCES "Product" (product_id), FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id) ) CREATE TABLE "Product" ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255), PRIMARY KEY (product_id) ) CREATE TABLE "Staff" ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255), PRIMARY KEY (staff_id) )
CREATE TABLE "Problem_Category_Codes" ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80), PRIMARY KEY (problem_category_code) ) /* 2 rows from Problem_Category_Codes table: problem_category_code problem_category_description Datatabase Database design or contents. GUI User Interface. */ CREATE TABLE "Problem_Log" ( problem_log_id INTEGER, assigned_to_staff_id INTEGER NOT NULL, problem_id INTEGER NOT NULL, problem_category_code VARCHAR(20) NOT NULL, problem_status_code VARCHAR(20) NOT NULL, log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(255), PRIMARY KEY (problem_log_id), FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code) ) /* 2 rows from Problem_Log table: problem_log_id assigned_to_staff_id problem_id problem_category_code problem_status_code log_entry_date log_entry_description log_entry_fix other_log_details 1 11 11 Middleware Solved 2011-03-13 13:11:57 t k p 2 11 8 GUI Solved 1976-03-31 14:03:02 a k s */ CREATE TABLE "Problem_Status_Codes" ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80), PRIMARY KEY (problem_status_code) ) /* 2 rows from Problem_Status_Codes table: problem_status_code problem_status_description Reported Reported Solved Solved */ CREATE TABLE "Problems" ( problem_id INTEGER, product_id INTEGER NOT NULL, closure_authorised_by_staff_id INTEGER NOT NULL, reported_by_staff_id INTEGER NOT NULL, date_problem_reported DATETIME NOT NULL, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255), PRIMARY KEY (problem_id), FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(product_id) REFERENCES "Product" (product_id), FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id) ) /* 2 rows from Problems table: problem_id product_id closure_authorised_by_staff_id reported_by_staff_id date_problem_reported date_problem_closed problem_description other_problem_details 1 4 4 2 1978-06-26 19:10:17 2012-07-22 19:24:26 x p 2 8 3 10 1988-11-07 16:09:31 1973-06-07 04:13:51 w p */ CREATE TABLE "Product" ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255), PRIMARY KEY (product_id) ) /* 2 rows from Product table: product_id product_name product_details 1 rose k 2 yellow q */ CREATE TABLE "Staff" ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255), PRIMARY KEY (staff_id) ) /* 2 rows from Staff table: staff_id staff_first_name staff_last_name other_staff_details 1 Lacey Bosco m 2 Dameon Frami x */
Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.
SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop"
[{'problem_description': 'w'}, {'problem_description': 'd'}, {'problem_description': 'r'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
document_management
CREATE TABLE "Document_Functional_Areas" ( document_code VARCHAR(15) NOT NULL, functional_area_code VARCHAR(15) NOT NULL, FOREIGN KEY(functional_area_code) REFERENCES "Functional_Areas" (functional_area_code), FOREIGN KEY(document_code) REFERENCES "Documents" (document_code) ) CREATE TABLE "Document_Sections" ( section_id INTEGER, document_code VARCHAR(15) NOT NULL, section_sequence INTEGER, section_code VARCHAR(20), section_title VARCHAR(80), PRIMARY KEY (section_id), FOREIGN KEY(document_code) REFERENCES "Documents" (document_code) ) CREATE TABLE "Document_Sections_Images" ( section_id INTEGER NOT NULL, image_id INTEGER NOT NULL, PRIMARY KEY (section_id, image_id), FOREIGN KEY(image_id) REFERENCES "Images" (image_id), FOREIGN KEY(section_id) REFERENCES "Document_Sections" (section_id) ) CREATE TABLE "Document_Structures" ( document_structure_code VARCHAR(15), parent_document_structure_code VARCHAR(15), document_structure_description VARCHAR(80), PRIMARY KEY (document_structure_code) ) CREATE TABLE "Documents" ( document_code VARCHAR(15), document_structure_code VARCHAR(15) NOT NULL, document_type_code VARCHAR(15) NOT NULL, access_count INTEGER, document_name VARCHAR(80), PRIMARY KEY (document_code), FOREIGN KEY(document_structure_code) REFERENCES "Document_Structures" (document_structure_code) ) CREATE TABLE "Functional_Areas" ( functional_area_code VARCHAR(15), parent_functional_area_code VARCHAR(15), functional_area_description VARCHAR(80) NOT NULL, PRIMARY KEY (functional_area_code) ) CREATE TABLE "Images" ( image_id INTEGER, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(255), PRIMARY KEY (image_id) ) CREATE TABLE "Roles" ( role_code VARCHAR(15), role_description VARCHAR(80), PRIMARY KEY (role_code) ) CREATE TABLE "Users" ( user_id INTEGER, role_code VARCHAR(15) NOT NULL, user_name VARCHAR(40), user_login VARCHAR(40), password VARCHAR(40), PRIMARY KEY (user_id), FOREIGN KEY(role_code) REFERENCES "Roles" (role_code) )
CREATE TABLE "Document_Functional_Areas" ( document_code VARCHAR(15) NOT NULL, functional_area_code VARCHAR(15) NOT NULL, FOREIGN KEY(functional_area_code) REFERENCES "Functional_Areas" (functional_area_code), FOREIGN KEY(document_code) REFERENCES "Documents" (document_code) ) /* 2 rows from Document_Functional_Areas table: document_code functional_area_code 675 9 930 1 */ CREATE TABLE "Document_Sections" ( section_id INTEGER, document_code VARCHAR(15) NOT NULL, section_sequence INTEGER, section_code VARCHAR(20), section_title VARCHAR(80), PRIMARY KEY (section_id), FOREIGN KEY(document_code) REFERENCES "Documents" (document_code) ) /* 2 rows from Document_Sections table: section_id document_code section_sequence section_code section_title 12 714 6072 70 after 15 217 4510 14 after */ CREATE TABLE "Document_Sections_Images" ( section_id INTEGER NOT NULL, image_id INTEGER NOT NULL, PRIMARY KEY (section_id, image_id), FOREIGN KEY(image_id) REFERENCES "Images" (image_id), FOREIGN KEY(section_id) REFERENCES "Document_Sections" (section_id) ) /* 2 rows from Document_Sections_Images table: section_id image_id 93 6 86 2 */ CREATE TABLE "Document_Structures" ( document_structure_code VARCHAR(15), parent_document_structure_code VARCHAR(15), document_structure_description VARCHAR(80), PRIMARY KEY (document_structure_code) ) /* 2 rows from Document_Structures table: document_structure_code parent_document_structure_code document_structure_description 1 1 Header 6 1 Main section */ CREATE TABLE "Documents" ( document_code VARCHAR(15), document_structure_code VARCHAR(15) NOT NULL, document_type_code VARCHAR(15) NOT NULL, access_count INTEGER, document_name VARCHAR(80), PRIMARY KEY (document_code), FOREIGN KEY(document_structure_code) REFERENCES "Document_Structures" (document_structure_code) ) /* 2 rows from Documents table: document_code document_structure_code document_type_code access_count document_name 217 8 Book 1864 Learning English 621 1 Paper 8208 Research about Art history */ CREATE TABLE "Functional_Areas" ( functional_area_code VARCHAR(15), parent_functional_area_code VARCHAR(15), functional_area_description VARCHAR(80) NOT NULL, PRIMARY KEY (functional_area_code) ) /* 2 rows from Functional_Areas table: functional_area_code parent_functional_area_code functional_area_description 8 8 Signature 1 8 Acknowledgement */ CREATE TABLE "Images" ( image_id INTEGER, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(255), PRIMARY KEY (image_id) ) /* 2 rows from Images table: image_id image_alt_text image_name image_url 1 Lea top1 http://www.rempelnader.com/1.jpg 2 Arden top2 http://connellykertzmann.org/1.jpg */ CREATE TABLE "Roles" ( role_code VARCHAR(15), role_description VARCHAR(80), PRIMARY KEY (role_code) ) /* 2 rows from Roles table: role_code role_description DBA Database Administrator PROJ-MGR Project Manager */ CREATE TABLE "Users" ( user_id INTEGER, role_code VARCHAR(15) NOT NULL, user_name VARCHAR(40), user_login VARCHAR(40), password VARCHAR(40), PRIMARY KEY (user_id), FOREIGN KEY(role_code) REFERENCES "Roles" (role_code) ) /* 2 rows from Users table: user_id role_code user_name user_login password 1 PROJ-MGR dickens.elta 0 e72b5a2d50b39a8760764a5f7a9d68ca2f076877 2 DBA tremblay.raheem 1 9bc25a040d5647ced5ec32e1a455e90fafc10bcb */
List all the document names which contains "CV".
SELECT document_name FROM documents WHERE document_name LIKE "%CV%"
[{'document_name': 'David CV'}, {'document_name': 'John CV'}, {'document_name': 'Joe CV'}]
Easy
false
true
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]Return the document id, template id, and description for the document with the name Robbin CV.[/QUESTION] [SQL]SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = "Robbin CV"[/SQL]
[QUESTION]Return the document id, template id, and description for the document with the name Robbin CV.[/QUESTION] [SQL]SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = "Robbin CV"[/SQL]
[QUESTION]Return the document id, template id, and description for the document with the name Robbin CV.[/QUESTION] [SQL]SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = "Robbin CV"[/SQL]
[QUESTION]Return the document id, template id, and description for the document with the name Robbin CV.[/QUESTION] [SQL]SELECT document_id , template_id , Document_Description FROM Documents WHERE document_name = "Robbin CV"[/SQL]
game_1
CREATE TABLE "Plays_Games" ( "StuID" INTEGER, "GameID" INTEGER, "Hours_Played" INTEGER, FOREIGN KEY("GameID") REFERENCES "Video_Games" ("GameID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "SportsInfo" ( "StuID" INTEGER, "SportName" VARCHAR(32), "HoursPerWeek" INTEGER, "GamesPlayed" INTEGER, "OnScholarship" VARCHAR(1), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) CREATE TABLE "Video_Games" ( "GameID" INTEGER, "GName" VARCHAR(40), "GType" VARCHAR(40), PRIMARY KEY ("GameID") )
CREATE TABLE "Plays_Games" ( "StuID" INTEGER, "GameID" INTEGER, "Hours_Played" INTEGER, FOREIGN KEY("GameID") REFERENCES "Video_Games" ("GameID"), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from Plays_Games table: StuID GameID Hours_Played 1001 1 35 1001 2 15 */ CREATE TABLE "SportsInfo" ( "StuID" INTEGER, "SportName" VARCHAR(32), "HoursPerWeek" INTEGER, "GamesPlayed" INTEGER, "OnScholarship" VARCHAR(1), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID") ) /* 2 rows from SportsInfo table: StuID SportName HoursPerWeek GamesPlayed OnScholarship 1001 Athletics 2 5 N 1002 Football 7 20 Y */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */ CREATE TABLE "Video_Games" ( "GameID" INTEGER, "GName" VARCHAR(40), "GType" VARCHAR(40), PRIMARY KEY ("GameID") ) /* 2 rows from Video_Games table: GameID GName GType 1 RNG Stone Collectible card game 2 The Vanishing of Eric Calder Walking Simulator */
Show all sport name and the number of students.
SELECT sportname , count(*) FROM Sportsinfo GROUP BY sportname
[{'SportName': 'Athletics', 'count(*)': 1}, {'SportName': 'Baseball', 'count(*)': 1}, {'SportName': 'Basketball', 'count(*)': 1}, {'SportName': 'Cricket', 'count(*)': 1}, {'SportName': 'Curling', 'count(*)': 1}, {'SportName': 'Football', 'count(*)': 2}, {'SportName': 'Lacrosse', 'count(*)': 3}, {'SportName': 'Soccer', 'count(*)': 1}, {'SportName': 'Swimming', 'count(*)': 1}, {'SportName': 'Tennis', 'count(*)': 2}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
[QUESTION]Show the names of high school students and their corresponding number of friends.[/QUESTION] [SQL]SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id[/SQL]
[QUESTION]Show the names of high school students and their corresponding number of friends.[/QUESTION] [SQL]SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id[/SQL]
[QUESTION]Show the names of high school students and their corresponding number of friends.[/QUESTION] [SQL]SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id[/SQL]
[QUESTION]Show the names of high school students and their corresponding number of friends.[/QUESTION] [SQL]SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id[/SQL]
customers_and_invoices
CREATE TABLE "Accounts" ( account_id INTEGER, customer_id INTEGER NOT NULL, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255), PRIMARY KEY (account_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id) ) CREATE TABLE "Customers" ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50), PRIMARY KEY (customer_id) ) CREATE TABLE "Financial_Transactions" ( transaction_id INTEGER NOT NULL, account_id INTEGER NOT NULL, invoice_number INTEGER, transaction_type VARCHAR(15) NOT NULL, transaction_date DATETIME, transaction_amount DECIMAL(19, 4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255), FOREIGN KEY(account_id) REFERENCES "Accounts" (account_id), FOREIGN KEY(invoice_number) REFERENCES "Invoices" (invoice_number) ) CREATE TABLE "Invoice_Line_Items" ( order_item_id INTEGER NOT NULL, invoice_number INTEGER NOT NULL, product_id INTEGER NOT NULL, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19, 4), derived_product_cost DECIMAL(19, 4), derived_vat_payable DECIMAL(19, 4), derived_total_cost DECIMAL(19, 4), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(invoice_number) REFERENCES "Invoices" (invoice_number), FOREIGN KEY(order_item_id) REFERENCES "Order_Items" (order_item_id) ) CREATE TABLE "Invoices" ( invoice_number INTEGER, order_id INTEGER NOT NULL, invoice_date DATETIME, PRIMARY KEY (invoice_number), FOREIGN KEY(order_id) REFERENCES "Orders" (order_id) ) CREATE TABLE "Order_Items" ( order_item_id INTEGER, order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255), PRIMARY KEY (order_item_id), FOREIGN KEY(order_id) REFERENCES "Orders" (order_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id) ) CREATE TABLE "Orders" ( order_id INTEGER, customer_id INTEGER NOT NULL, date_order_placed DATETIME NOT NULL, order_details VARCHAR(255), PRIMARY KEY (order_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id) ) CREATE TABLE "Product_Categories" ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19, 4), PRIMARY KEY (production_type_code) ) CREATE TABLE "Products" ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15) NOT NULL, unit_price DECIMAL(19, 4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20), PRIMARY KEY (product_id), FOREIGN KEY(production_type_code) REFERENCES "Product_Categories" (production_type_code) )
CREATE TABLE "Accounts" ( account_id INTEGER, customer_id INTEGER NOT NULL, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255), PRIMARY KEY (account_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id) ) /* 2 rows from Accounts table: account_id customer_id date_account_opened account_name other_account_details 1 8 2016-07-30 22:22:24 900 Regular 2 3 2017-05-29 16:45:17 520 VIP */ CREATE TABLE "Customers" ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50), PRIMARY KEY (customer_id) ) /* 2 rows from Customers table: customer_id customer_first_name customer_middle_initial customer_last_name gender email_address login_name login_password phone_number town_city state_county_province country 1 Dee A Larkin 1 [email protected] xhartmann 77789d292604ea04406f 241.796.1219x37862 North Nellie WestVirginia USA 2 Brennon H Weimann 0 [email protected] shayne.lesch ce97a3e4539347daab96 (943)219-4234x415 South Isabell Oklahoma USA */ CREATE TABLE "Financial_Transactions" ( transaction_id INTEGER NOT NULL, account_id INTEGER NOT NULL, invoice_number INTEGER, transaction_type VARCHAR(15) NOT NULL, transaction_date DATETIME, transaction_amount DECIMAL(19, 4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255), FOREIGN KEY(account_id) REFERENCES "Accounts" (account_id), FOREIGN KEY(invoice_number) REFERENCES "Invoices" (invoice_number) ) /* 2 rows from Financial_Transactions table: transaction_id account_id invoice_number transaction_type transaction_date transaction_amount transaction_comment other_transaction_details 1 13 12 Payment 2018-03-15 21:13:57 613.9600 None None 2 9 1 Payment 2018-03-13 13:27:46 368.4600 None None */ CREATE TABLE "Invoice_Line_Items" ( order_item_id INTEGER NOT NULL, invoice_number INTEGER NOT NULL, product_id INTEGER NOT NULL, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19, 4), derived_product_cost DECIMAL(19, 4), derived_vat_payable DECIMAL(19, 4), derived_total_cost DECIMAL(19, 4), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(invoice_number) REFERENCES "Invoices" (invoice_number), FOREIGN KEY(order_item_id) REFERENCES "Order_Items" (order_item_id) ) /* 2 rows from Invoice_Line_Items table: order_item_id invoice_number product_id product_title product_quantity product_price derived_product_cost derived_vat_payable derived_total_cost 14 9 5 prod_name 4 742.3700 191.1100 None 69.8200 3 9 15 prod_name 1 814.8700 176.2900 None 59.5600 */ CREATE TABLE "Invoices" ( invoice_number INTEGER, order_id INTEGER NOT NULL, invoice_date DATETIME, PRIMARY KEY (invoice_number), FOREIGN KEY(order_id) REFERENCES "Orders" (order_id) ) /* 2 rows from Invoices table: invoice_number order_id invoice_date 1 9 2018-03-01 16:40:48 2 9 2018-03-20 00:21:41 */ CREATE TABLE "Order_Items" ( order_item_id INTEGER, order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255), PRIMARY KEY (order_item_id), FOREIGN KEY(order_id) REFERENCES "Orders" (order_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id) ) /* 2 rows from Order_Items table: order_item_id order_id product_id product_quantity other_order_item_details 1 4 4 6 None 2 4 10 7 None */ CREATE TABLE "Orders" ( order_id INTEGER, customer_id INTEGER NOT NULL, date_order_placed DATETIME NOT NULL, order_details VARCHAR(255), PRIMARY KEY (order_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id) ) /* 2 rows from Orders table: order_id customer_id date_order_placed order_details 1 12 2012-06-27 20:49:56 None 2 12 2012-08-25 07:51:54 None */ CREATE TABLE "Product_Categories" ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19, 4), PRIMARY KEY (production_type_code) ) /* 2 rows from Product_Categories table: production_type_code product_type_description vat_rating Food Food 15.8400 DVDs Dvd products 11.4000 */ CREATE TABLE "Products" ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15) NOT NULL, unit_price DECIMAL(19, 4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20), PRIMARY KEY (product_id), FOREIGN KEY(production_type_code) REFERENCES "Product_Categories" (production_type_code) ) /* 2 rows from Products table: product_id parent_product_id production_type_code unit_price product_name product_color product_size 1 4 Food 617.9500 Coffee Bean Red Medium 2 4 Books 558.4900 Learning French Yellow Medium */
What is the average, minimum, maximum, and total transaction amount?
SELECT avg(transaction_amount) , min(transaction_amount) , max(transaction_amount) , sum(transaction_amount) FROM Financial_transactions
[{'avg(transaction_amount)': 1329.0559999999998, 'min(transaction_amount)': 368.46, 'max(transaction_amount)': 1979.66, 'sum(transaction_amount)': 19935.839999999997}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]What is the average number of bank customers?[/QUESTION] [SQL]SELECT avg(no_of_customers) FROM bank[/SQL]
[QUESTION]What is the average number of bank customers?[/QUESTION] [SQL]SELECT avg(no_of_customers) FROM bank[/SQL]
apartment_rentals
CREATE TABLE "Apartment_Bookings" ( apt_booking_id INTEGER NOT NULL, apt_id INTEGER, guest_id INTEGER NOT NULL, booking_status_code CHAR(15) NOT NULL, booking_start_date DATETIME, booking_end_date DATETIME, PRIMARY KEY (apt_booking_id), FOREIGN KEY(apt_id) REFERENCES "Apartments" (apt_id), FOREIGN KEY(guest_id) REFERENCES "Guests" (guest_id), UNIQUE (apt_booking_id) ) CREATE TABLE "Apartment_Buildings" ( building_id INTEGER NOT NULL, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80), PRIMARY KEY (building_id), UNIQUE (building_id) ) CREATE TABLE "Apartment_Facilities" ( apt_id INTEGER NOT NULL, facility_code CHAR(15) NOT NULL, PRIMARY KEY (apt_id, facility_code), FOREIGN KEY(apt_id) REFERENCES "Apartments" (apt_id) ) CREATE TABLE "Apartments" ( apt_id INTEGER NOT NULL, building_id INTEGER NOT NULL, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5), PRIMARY KEY (apt_id), FOREIGN KEY(building_id) REFERENCES "Apartment_Buildings" (building_id), UNIQUE (apt_id) ) CREATE TABLE "Guests" ( guest_id INTEGER NOT NULL, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME, PRIMARY KEY (guest_id), UNIQUE (guest_id) ) CREATE TABLE "View_Unit_Status" ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME NOT NULL, available_yn NUMERIC, PRIMARY KEY (status_date), FOREIGN KEY(apt_id) REFERENCES "Apartments" (apt_id), FOREIGN KEY(apt_booking_id) REFERENCES "Apartment_Bookings" (apt_booking_id) )
CREATE TABLE "Apartment_Bookings" ( apt_booking_id INTEGER NOT NULL, apt_id INTEGER, guest_id INTEGER NOT NULL, booking_status_code CHAR(15) NOT NULL, booking_start_date DATETIME, booking_end_date DATETIME, PRIMARY KEY (apt_booking_id), FOREIGN KEY(apt_id) REFERENCES "Apartments" (apt_id), FOREIGN KEY(guest_id) REFERENCES "Guests" (guest_id), UNIQUE (apt_booking_id) ) /* 2 rows from Apartment_Bookings table: apt_booking_id apt_id guest_id booking_status_code booking_start_date booking_end_date 258 10 2 Provisional 2016-09-26 17:13:49 2017-10-07 11:38:48 279 15 15 Provisional 2016-04-01 06:28:08 2017-10-25 11:08:42 */ CREATE TABLE "Apartment_Buildings" ( building_id INTEGER NOT NULL, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80), PRIMARY KEY (building_id), UNIQUE (building_id) ) /* 2 rows from Apartment_Buildings table: building_id building_short_name building_full_name building_description building_address building_manager building_phone 133 Normandie Court Normandie Court Studio 7950 Casper Vista Apt. 176 Marquiseberg, CA 70496 Emma (948)040-1064x387 153 Mercedes House Mercedes House Studio 354 Otto Villages Charliefort, VT 71664 Brenden 915-617-2408x832 */ CREATE TABLE "Apartment_Facilities" ( apt_id INTEGER NOT NULL, facility_code CHAR(15) NOT NULL, PRIMARY KEY (apt_id, facility_code), FOREIGN KEY(apt_id) REFERENCES "Apartments" (apt_id) ) /* 2 rows from Apartment_Facilities table: apt_id facility_code 1 Boardband 2 Boardband */ CREATE TABLE "Apartments" ( apt_id INTEGER NOT NULL, building_id INTEGER NOT NULL, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5), PRIMARY KEY (apt_id), FOREIGN KEY(building_id) REFERENCES "Apartment_Buildings" (building_id), UNIQUE (apt_id) ) /* 2 rows from Apartments table: apt_id building_id apt_type_code apt_number bathroom_count bedroom_count room_count 1 808 Flat Suite 645 1 3 7 2 624 Flat Apt. 585 2 4 5 */ CREATE TABLE "Guests" ( guest_id INTEGER NOT NULL, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME, PRIMARY KEY (guest_id), UNIQUE (guest_id) ) /* 2 rows from Guests table: guest_id gender_code guest_first_name guest_last_name date_of_birth 1 Male Kip DuBuque 1995-11-04 07:09:57 2 Unknown Rebeca Runolfsdottir 1974-05-12 21:53:58 */ CREATE TABLE "View_Unit_Status" ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME NOT NULL, available_yn NUMERIC, PRIMARY KEY (status_date), FOREIGN KEY(apt_id) REFERENCES "Apartments" (apt_id), FOREIGN KEY(apt_booking_id) REFERENCES "Apartment_Bookings" (apt_booking_id) ) /* 2 rows from View_Unit_Status table: apt_id apt_booking_id status_date available_yn 11 920 1970-09-28 10:24:29 1.0000000000 15 575 1972-03-23 22:55:53 1.0000000000 */
Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.
SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC
[{'apt_type_code': 'Studio', 'COUNT(*)': 4}, {'apt_type_code': 'Duplex', 'COUNT(*)': 5}, {'apt_type_code': 'Flat', 'COUNT(*)': 6}]
Easy
false
false
false
true
false
true
false
false
false
false
false
false
false
department_store
CREATE TABLE "Addresses" ( address_id INTEGER, address_details VARCHAR(255), PRIMARY KEY (address_id) ) CREATE TABLE "Customer_Addresses" ( customer_id INTEGER NOT NULL, address_id INTEGER NOT NULL, date_from DATETIME NOT NULL, date_to DATETIME, PRIMARY KEY (customer_id, address_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id), FOREIGN KEY(address_id) REFERENCES "Addresses" (address_id) ) CREATE TABLE "Customer_Orders" ( order_id INTEGER, customer_id INTEGER NOT NULL, order_status_code VARCHAR(10) NOT NULL, order_date DATETIME NOT NULL, PRIMARY KEY (order_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id) ) CREATE TABLE "Customers" ( customer_id INTEGER, payment_method_code VARCHAR(10) NOT NULL, customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80), PRIMARY KEY (customer_id) ) CREATE TABLE "Department_Store_Chain" ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80), PRIMARY KEY (dept_store_chain_id) ) CREATE TABLE "Department_Stores" ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80), PRIMARY KEY (dept_store_id), FOREIGN KEY(dept_store_chain_id) REFERENCES "Department_Store_Chain" (dept_store_chain_id) ) CREATE TABLE "Departments" ( department_id INTEGER, dept_store_id INTEGER NOT NULL, department_name VARCHAR(80), PRIMARY KEY (department_id), FOREIGN KEY(dept_store_id) REFERENCES "Department_Stores" (dept_store_id) ) CREATE TABLE "Order_Items" ( order_item_id INTEGER, order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, PRIMARY KEY (order_item_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(order_id) REFERENCES "Customer_Orders" (order_id) ) CREATE TABLE "Product_Suppliers" ( product_id INTEGER NOT NULL, supplier_id INTEGER NOT NULL, date_supplied_from DATETIME NOT NULL, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19, 4), PRIMARY KEY (product_id, supplier_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(supplier_id) REFERENCES "Suppliers" (supplier_id) ) CREATE TABLE "Products" ( product_id INTEGER, product_type_code VARCHAR(10) NOT NULL, product_name VARCHAR(80), product_price DECIMAL(19, 4), PRIMARY KEY (product_id) ) CREATE TABLE "Staff" ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80), PRIMARY KEY (staff_id) ) CREATE TABLE "Staff_Department_Assignments" ( staff_id INTEGER NOT NULL, department_id INTEGER NOT NULL, date_assigned_from DATETIME NOT NULL, job_title_code VARCHAR(10) NOT NULL, date_assigned_to DATETIME, PRIMARY KEY (staff_id, department_id), FOREIGN KEY(staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(department_id) REFERENCES "Departments" (department_id) ) CREATE TABLE "Supplier_Addresses" ( supplier_id INTEGER NOT NULL, address_id INTEGER NOT NULL, date_from DATETIME NOT NULL, date_to DATETIME, PRIMARY KEY (supplier_id, address_id), FOREIGN KEY(supplier_id) REFERENCES "Suppliers" (supplier_id), FOREIGN KEY(address_id) REFERENCES "Addresses" (address_id) ) CREATE TABLE "Suppliers" ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80), PRIMARY KEY (supplier_id) )
CREATE TABLE "Addresses" ( address_id INTEGER, address_details VARCHAR(255), PRIMARY KEY (address_id) ) /* 2 rows from Addresses table: address_id address_details 1 28481 Crist Circle East Burdettestad, IA 21232 2 0292 Mitchel Pike Port Abefurt, IA 84402-4249 */ CREATE TABLE "Customer_Addresses" ( customer_id INTEGER NOT NULL, address_id INTEGER NOT NULL, date_from DATETIME NOT NULL, date_to DATETIME, PRIMARY KEY (customer_id, address_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id), FOREIGN KEY(address_id) REFERENCES "Addresses" (address_id) ) /* 2 rows from Customer_Addresses table: customer_id address_id date_from date_to 2 9 2017-12-11 05:00:22 2018-03-20 20:52:34 1 6 2017-10-07 23:00:26 2018-02-28 14:53:52 */ CREATE TABLE "Customer_Orders" ( order_id INTEGER, customer_id INTEGER NOT NULL, order_status_code VARCHAR(10) NOT NULL, order_date DATETIME NOT NULL, PRIMARY KEY (order_id), FOREIGN KEY(customer_id) REFERENCES "Customers" (customer_id) ) /* 2 rows from Customer_Orders table: order_id customer_id order_status_code order_date 1 12 Completed 2018-02-10 15:44:48 2 4 New 2018-01-31 17:49:18 */ CREATE TABLE "Customers" ( customer_id INTEGER, payment_method_code VARCHAR(10) NOT NULL, customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80), PRIMARY KEY (customer_id) ) /* 2 rows from Customers table: customer_id payment_method_code customer_code customer_name customer_address customer_phone customer_email 1 Credit Card 401 Ahmed 75099 Tremblay Port Apt. 163 South Norrisland, SC 80546 254-072-4068x33935 [email protected] 2 Credit Card 665 Chauncey 8408 Lindsay Court East Dasiabury, IL 72656-3552 +41(8)1897032009 [email protected] */ CREATE TABLE "Department_Store_Chain" ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80), PRIMARY KEY (dept_store_chain_id) ) /* 2 rows from Department_Store_Chain table: dept_store_chain_id dept_store_chain_name 1 South 2 West */ CREATE TABLE "Department_Stores" ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80), PRIMARY KEY (dept_store_id), FOREIGN KEY(dept_store_chain_id) REFERENCES "Department_Store_Chain" (dept_store_chain_id) ) /* 2 rows from Department_Stores table: dept_store_id dept_store_chain_id store_name store_address store_phone store_email 1 1 store_name 01290 Jeremie Parkway Suite 753 North Arielle, MS 51249 (948)944-5099x2027 [email protected] 2 3 store_name 082 Purdy Expressway O'Connellshire, IL 31732 877-917-5029 [email protected] */ CREATE TABLE "Departments" ( department_id INTEGER, dept_store_id INTEGER NOT NULL, department_name VARCHAR(80), PRIMARY KEY (department_id), FOREIGN KEY(dept_store_id) REFERENCES "Department_Stores" (dept_store_id) ) /* 2 rows from Departments table: department_id dept_store_id department_name 1 5 human resource 2 11 purchasing */ CREATE TABLE "Order_Items" ( order_item_id INTEGER, order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, PRIMARY KEY (order_item_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(order_id) REFERENCES "Customer_Orders" (order_id) ) /* 2 rows from Order_Items table: order_item_id order_id product_id 1 9 7 2 1 3 */ CREATE TABLE "Product_Suppliers" ( product_id INTEGER NOT NULL, supplier_id INTEGER NOT NULL, date_supplied_from DATETIME NOT NULL, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19, 4), PRIMARY KEY (product_id, supplier_id), FOREIGN KEY(product_id) REFERENCES "Products" (product_id), FOREIGN KEY(supplier_id) REFERENCES "Suppliers" (supplier_id) ) /* 2 rows from Product_Suppliers table: product_id supplier_id date_supplied_from date_supplied_to total_amount_purchased total_value_purchased 4 3 2017-06-19 00:49:05 2018-03-24 19:29:18 89366.05 36014.6000 8 4 2017-07-02 00:35:12 2018-03-25 07:30:49 25085.57 36274.5600 */ CREATE TABLE "Products" ( product_id INTEGER, product_type_code VARCHAR(10) NOT NULL, product_name VARCHAR(80), product_price DECIMAL(19, 4), PRIMARY KEY (product_id) ) /* 2 rows from Products table: product_id product_type_code product_name product_price 1 Clothes red jeans 734.7300 2 Clothes yellow jeans 687.2300 */ CREATE TABLE "Staff" ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80), PRIMARY KEY (staff_id) ) /* 2 rows from Staff table: staff_id staff_gender staff_name 1 1 Tom 2 1 Malika */ CREATE TABLE "Staff_Department_Assignments" ( staff_id INTEGER NOT NULL, department_id INTEGER NOT NULL, date_assigned_from DATETIME NOT NULL, job_title_code VARCHAR(10) NOT NULL, date_assigned_to DATETIME, PRIMARY KEY (staff_id, department_id), FOREIGN KEY(staff_id) REFERENCES "Staff" (staff_id), FOREIGN KEY(department_id) REFERENCES "Departments" (department_id) ) /* 2 rows from Staff_Department_Assignments table: staff_id department_id date_assigned_from job_title_code date_assigned_to 5 4 2017-06-11 22:55:20 Department Manager 2018-03-23 21:59:11 10 5 2017-12-18 19:12:15 Sales Person 2018-03-23 20:25:24 */ CREATE TABLE "Supplier_Addresses" ( supplier_id INTEGER NOT NULL, address_id INTEGER NOT NULL, date_from DATETIME NOT NULL, date_to DATETIME, PRIMARY KEY (supplier_id, address_id), FOREIGN KEY(supplier_id) REFERENCES "Suppliers" (supplier_id), FOREIGN KEY(address_id) REFERENCES "Addresses" (address_id) ) /* 2 rows from Supplier_Addresses table: supplier_id address_id date_from date_to 4 5 2016-09-22 16:41:31 2018-03-14 20:06:37 3 9 2014-11-07 19:18:49 2018-03-16 16:39:58 */ CREATE TABLE "Suppliers" ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80), PRIMARY KEY (supplier_id) ) /* 2 rows from Suppliers table: supplier_id supplier_name supplier_phone 1 Lidl (692)009-5928 2 AB Store 1-483-283-4742 */
What are the maximum and minimum product prices for each product type?
SELECT product_type_code , max(product_price) , min(product_price) FROM products GROUP BY product_type_code
[{'product_type_code': 'Clothes', 'max(product_price)': 939.57, 'min(product_price)': 408.82}, {'product_type_code': 'Hardware', 'max(product_price)': 971.44, 'min(product_price)': 612.46}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
[QUESTION]What are the minimum and maximum number of products across all the shops?[/QUESTION] [SQL]SELECT min(Number_products) , max(Number_products) FROM shop[/SQL]
[QUESTION]What are the minimum and maximum number of products across all the shops?[/QUESTION] [SQL]SELECT min(Number_products) , max(Number_products) FROM shop[/SQL]
[QUESTION]What are the minimum and maximum number of products across all the shops?[/QUESTION] [SQL]SELECT min(Number_products) , max(Number_products) FROM shop[/SQL]
[QUESTION]What are the minimum and maximum number of products across all the shops?[/QUESTION] [SQL]SELECT min(Number_products) , max(Number_products) FROM shop[/SQL]
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
people working on sensor fusion
SELECT DISTINCT t1.authorname FROM paperkeyphrase AS t2 JOIN keyphrase AS t4 ON t2.keyphraseid = t4.keyphraseid JOIN writes AS t3 ON t3.paperid = t2.paperid JOIN author AS t1 ON t3.authorid = t1.authorid WHERE t4.keyphrasename LIKE "sensor fusion";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
true
true
false
false
false
false
false
false
true
false
false
false
false
product_catalog
CREATE TABLE "Attribute_Definitions" ( attribute_id INTEGER, attribute_name VARCHAR(30), attribute_data_type VARCHAR(10), PRIMARY KEY (attribute_id) ) CREATE TABLE "Catalog_Contents" ( catalog_entry_id INTEGER, catalog_level_number INTEGER NOT NULL, parent_entry_id INTEGER, previous_entry_id INTEGER, next_entry_id INTEGER, catalog_entry_name VARCHAR(80), product_stock_number VARCHAR(50), price_in_dollars DOUBLE, price_in_euros DOUBLE, price_in_pounds DOUBLE, capacity VARCHAR(20), length VARCHAR(20), height VARCHAR(20), width VARCHAR(20), PRIMARY KEY (catalog_entry_id), FOREIGN KEY(catalog_level_number) REFERENCES "Catalog_Structure" (catalog_level_number) ) CREATE TABLE "Catalog_Contents_Additional_Attributes" ( catalog_entry_id INTEGER NOT NULL, catalog_level_number INTEGER NOT NULL, attribute_id INTEGER NOT NULL, attribute_value VARCHAR(255) NOT NULL, FOREIGN KEY(catalog_level_number) REFERENCES "Catalog_Structure" (catalog_level_number), FOREIGN KEY(catalog_entry_id) REFERENCES "Catalog_Contents" (catalog_entry_id) ) CREATE TABLE "Catalog_Structure" ( catalog_level_number INTEGER, catalog_id INTEGER NOT NULL, catalog_level_name VARCHAR(50), PRIMARY KEY (catalog_level_number), FOREIGN KEY(catalog_id) REFERENCES "Catalogs" (catalog_id) ) CREATE TABLE "Catalogs" ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME, PRIMARY KEY (catalog_id) )
CREATE TABLE "Attribute_Definitions" ( attribute_id INTEGER, attribute_name VARCHAR(30), attribute_data_type VARCHAR(10), PRIMARY KEY (attribute_id) ) /* 2 rows from Attribute_Definitions table: attribute_id attribute_name attribute_data_type 1 Green Bool 2 Black Bool */ CREATE TABLE "Catalog_Contents" ( catalog_entry_id INTEGER, catalog_level_number INTEGER NOT NULL, parent_entry_id INTEGER, previous_entry_id INTEGER, next_entry_id INTEGER, catalog_entry_name VARCHAR(80), product_stock_number VARCHAR(50), price_in_dollars DOUBLE, price_in_euros DOUBLE, price_in_pounds DOUBLE, capacity VARCHAR(20), length VARCHAR(20), height VARCHAR(20), width VARCHAR(20), PRIMARY KEY (catalog_entry_id), FOREIGN KEY(catalog_level_number) REFERENCES "Catalog_Structure" (catalog_level_number) ) /* 2 rows from Catalog_Contents table: catalog_entry_id catalog_level_number parent_entry_id previous_entry_id next_entry_id catalog_entry_name product_stock_number price_in_dollars price_in_euros price_in_pounds capacity length height width 1 1 5 9 7 Cola 89 cp 200.78 159.84 172.17 1 3 9 5 2 8 6 9 8 Root beer 37 hq 687.59 590.11 471.78 8 6 5 6 */ CREATE TABLE "Catalog_Contents_Additional_Attributes" ( catalog_entry_id INTEGER NOT NULL, catalog_level_number INTEGER NOT NULL, attribute_id INTEGER NOT NULL, attribute_value VARCHAR(255) NOT NULL, FOREIGN KEY(catalog_level_number) REFERENCES "Catalog_Structure" (catalog_level_number), FOREIGN KEY(catalog_entry_id) REFERENCES "Catalog_Contents" (catalog_entry_id) ) /* 2 rows from Catalog_Contents_Additional_Attributes table: catalog_entry_id catalog_level_number attribute_id attribute_value 5 8 4 1 15 9 3 0 */ CREATE TABLE "Catalog_Structure" ( catalog_level_number INTEGER, catalog_id INTEGER NOT NULL, catalog_level_name VARCHAR(50), PRIMARY KEY (catalog_level_number), FOREIGN KEY(catalog_id) REFERENCES "Catalogs" (catalog_id) ) /* 2 rows from Catalog_Structure table: catalog_level_number catalog_id catalog_level_name 1 1 Category 8 2 Sub-Category */ CREATE TABLE "Catalogs" ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME, PRIMARY KEY (catalog_id) ) /* 2 rows from Catalogs table: catalog_id catalog_name catalog_publisher date_of_publication date_of_latest_revision 1 Chocolate Koepp-Rutherford handmade chocolate store 2013-03-15 05:09:17 2017-09-26 12:10:36 2 Coffee Bean Murray Coffee shop 2012-04-13 06:37:09 2017-10-26 01:16:51 */
Name all the products with next entry ID greater than 8.
SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8
[{'catalog_entry_name': 'Sprite Lemo'}, {'catalog_entry_name': 'Diet Pepsi'}, {'catalog_entry_name': 'Wanglaoji'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]Return the name, location and district of all shops in descending order of number of products.[/QUESTION] [SQL]SELECT name , LOCATION , district FROM shop ORDER BY number_products DESC[/SQL]
concert_singer
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") )
CREATE TABLE concert ( "concert_ID" INTEGER, "concert_Name" TEXT, "Theme" TEXT, "Stadium_ID" TEXT, "Year" TEXT, PRIMARY KEY ("concert_ID"), FOREIGN KEY("Stadium_ID") REFERENCES stadium ("Stadium_ID") ) /* 2 rows from concert table: concert_ID concert_Name Theme Stadium_ID Year 1 Auditions Free choice 1 2014 2 Super bootcamp Free choice 2 2 2014 */ CREATE TABLE singer ( "Singer_ID" INTEGER, "Name" TEXT, "Country" TEXT, "Song_Name" TEXT, "Song_release_year" TEXT, "Age" INTEGER, "Is_male" BOOLEAN, PRIMARY KEY ("Singer_ID") ) /* 2 rows from singer table: Singer_ID Name Country Song_Name Song_release_year Age Is_male 1 Joe Sharp Netherlands You 1992 52 True 2 Timbaland United States Dangerous 2008 32 True */ CREATE TABLE singer_in_concert ( "concert_ID" INTEGER, "Singer_ID" TEXT, PRIMARY KEY ("concert_ID", "Singer_ID"), FOREIGN KEY("concert_ID") REFERENCES concert ("concert_ID"), FOREIGN KEY("Singer_ID") REFERENCES singer ("Singer_ID") ) /* 2 rows from singer_in_concert table: concert_ID Singer_ID 1 2 1 3 */ CREATE TABLE stadium ( "Stadium_ID" INTEGER, "Location" TEXT, "Name" TEXT, "Capacity" INTEGER, "Highest" INTEGER, "Lowest" INTEGER, "Average" INTEGER, PRIMARY KEY ("Stadium_ID") ) /* 2 rows from stadium table: Stadium_ID Location Name Capacity Highest Lowest Average 1 Raith Rovers Stark's Park 10104 4812 1294 2106 2 Ayr United Somerset Park 11998 2363 1057 1477 */
Which year has most number of concerts?
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
[{'Year': '2015'}]
Easy
false
false
false
true
true
true
false
false
false
false
false
false
false
[QUESTION]What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?[/QUESTION] [SQL]SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015[/SQL]
[QUESTION]What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?[/QUESTION] [SQL]SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015[/SQL]
[QUESTION]What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?[/QUESTION] [SQL]SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015[/SQL]
[QUESTION]What are the names and locations of the stadiums that had concerts that occurred in both 2014 and 2015?[/QUESTION] [SQL]SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2014 INTERSECT SELECT T2.name , T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id WHERE T1.Year = 2015[/SQL]
scientist_1
CREATE TABLE "AssignedTo" ( "Scientist" INTEGER NOT NULL, "Project" CHAR(4) NOT NULL, PRIMARY KEY ("Scientist", "Project"), FOREIGN KEY("Scientist") REFERENCES "Scientists" ("SSN"), FOREIGN KEY("Project") REFERENCES "Projects" ("Code") ) CREATE TABLE "Projects" ( "Code" CHAR(4), "Name" CHAR(50) NOT NULL, "Hours" INTEGER, PRIMARY KEY ("Code") ) CREATE TABLE "Scientists" ( "SSN" INTEGER, "Name" CHAR(30) NOT NULL, PRIMARY KEY ("SSN") )
CREATE TABLE "AssignedTo" ( "Scientist" INTEGER NOT NULL, "Project" CHAR(4) NOT NULL, PRIMARY KEY ("Scientist", "Project"), FOREIGN KEY("Scientist") REFERENCES "Scientists" ("SSN"), FOREIGN KEY("Project") REFERENCES "Projects" ("Code") ) /* 2 rows from AssignedTo table: Scientist Project 123234877 AeH1 152934485 AeH3 */ CREATE TABLE "Projects" ( "Code" CHAR(4), "Name" CHAR(50) NOT NULL, "Hours" INTEGER, PRIMARY KEY ("Code") ) /* 2 rows from Projects table: Code Name Hours AeH1 Winds: Studying Bernoullis Principle 156 AeH2 Aerodynamics and Bridge Design 189 */ CREATE TABLE "Scientists" ( "SSN" INTEGER, "Name" CHAR(30) NOT NULL, PRIMARY KEY ("SSN") ) /* 2 rows from Scientists table: SSN Name 123234877 Michael Rogers 152934485 Anand Manikutty */
List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.
SELECT T1.Name , T3.Name , T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name , T1.Name
[{'Name': 'A Matter of Time', 'Hours': 112}, {'Name': 'A Puzzling Parallax', 'Hours': 299}, {'Name': 'A Silver-Cleaning Battery', 'Hours': 545}, {'Name': 'A Silver-Cleaning Battery', 'Hours': 545}, {'Name': 'Aerodynamics and Gas Mileage', 'Hours': 256}, {'Name': 'Aerodynamics and Gas Mileage', 'Hours': 256}, {'Name': 'Aerodynamics and Ice Hockey', 'Hours': 789}, {'Name': 'Build Your Own Telescope', 'Hours': 6546}, {'Name': 'Build Your Own Telescope', 'Hours': 6546}, {'Name': 'Build Your Own Telescope', 'Hours': 6546}, {'Name': 'Juicy: Extracting Apple Juice with Pectinase', 'Hours': 321}, {'Name': 'Winds: Studying Bernoullis Principle', 'Hours': 156}]
Hard
false
false
false
true
false
false
false
false
true
false
false
false
false
twitter_1
CREATE TABLE follows ( f1 INTEGER NOT NULL, f2 INTEGER NOT NULL, PRIMARY KEY (f1, f2), FOREIGN KEY(f2) REFERENCES user_profiles (uid), FOREIGN KEY(f1) REFERENCES user_profiles (uid) ) CREATE TABLE tweets ( id BIGINT NOT NULL, uid INTEGER NOT NULL, text CHAR(140) NOT NULL, createdate DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), FOREIGN KEY(uid) REFERENCES user_profiles (uid) ) CREATE TABLE user_profiles ( uid INTEGER NOT NULL, name VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, partitionid INTEGER DEFAULT NULL, followers INTEGER DEFAULT NULL, PRIMARY KEY (uid) )
CREATE TABLE follows ( f1 INTEGER NOT NULL, f2 INTEGER NOT NULL, PRIMARY KEY (f1, f2), FOREIGN KEY(f2) REFERENCES user_profiles (uid), FOREIGN KEY(f1) REFERENCES user_profiles (uid) ) /* 2 rows from follows table: f1 f2 1 2 2 3 */ CREATE TABLE tweets ( id BIGINT NOT NULL, uid INTEGER NOT NULL, text CHAR(140) NOT NULL, createdate DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), FOREIGN KEY(uid) REFERENCES user_profiles (uid) ) /* 2 rows from tweets table: id uid text createdate 1 1 Hello I'm Tony Stark. 2018-03-09 20:00:14 2 3 Today I have went shopping at Laffayette. 2018-03-09 20:01:02 */ CREATE TABLE user_profiles ( uid INTEGER NOT NULL, name VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, partitionid INTEGER DEFAULT NULL, followers INTEGER DEFAULT NULL, PRIMARY KEY (uid) ) /* 2 rows from user_profiles table: uid name email partitionid followers 1 Iron Man [email protected] 1 6662425 2 Mary [email protected] 2 890 */
Find the maximum and total number of followers of all users.
SELECT max(followers) , sum(followers) FROM user_profiles
[{'max(followers)': 99999998, 'sum(followers)': 260392178}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
how long is the shortest river in the usa
SELECT LENGTH FROM river WHERE LENGTH = ( SELECT MIN ( LENGTH ) FROM river );
[{'Nenhum': 'Nenhum resultado encontrado'}]
Extra Hard
false
false
false
false
false
false
false
false
false
true
false
false
false
[QUESTION]what is the longest river in the state with the highest point[/QUESTION] [SQL]SELECT t1.river_name FROM highlow AS t2 JOIN river AS t1 ON t1.traverse = t2.state_name WHERE t2.highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow ) ORDER BY t1.length DESC LIMIT 1;[/SQL]
[QUESTION]what is the longest river in the state with the highest point[/QUESTION] [SQL]SELECT t1.river_name FROM highlow AS t2 JOIN river AS t1 ON t1.traverse = t2.state_name WHERE t2.highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow ) ORDER BY t1.length DESC LIMIT 1;[/SQL]
[QUESTION]what is the longest river in the state with the highest point[/QUESTION] [SQL]SELECT t1.river_name FROM highlow AS t2 JOIN river AS t1 ON t1.traverse = t2.state_name WHERE t2.highest_elevation = ( SELECT MAX ( highest_elevation ) FROM highlow ) ORDER BY t1.length DESC LIMIT 1;[/SQL]
scholar
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") )
CREATE TABLE "paperDataset" ( "paperId" INTEGER DEFAULT NULL, "datasetId" INTEGER DEFAULT NULL, PRIMARY KEY ("datasetId", "paperId") ) /* 2 rows from paperDataset table: paperId datasetId */ CREATE TABLE "paperKeyphrase" ( "paperId" INTEGER DEFAULT NULL, "keyphraseId" INTEGER DEFAULT NULL, PRIMARY KEY ("keyphraseId", "paperId"), FOREIGN KEY("keyphraseId") REFERENCES keyphrase ("keyphraseId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from paperKeyphrase table: paperId keyphraseId */ CREATE TABLE author ( "authorId" INTEGER NOT NULL, "authorName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("authorId") ) /* 2 rows from author table: authorId authorName */ CREATE TABLE cite ( "citingPaperId" INTEGER NOT NULL, "citedPaperId" INTEGER NOT NULL, PRIMARY KEY ("citingPaperId", "citedPaperId"), FOREIGN KEY("citingPaperId") REFERENCES paper ("paperId"), FOREIGN KEY("citedPaperId") REFERENCES paper ("paperId") ) /* 2 rows from cite table: citingPaperId citedPaperId */ CREATE TABLE dataset ( "datasetId" INTEGER NOT NULL, "datasetName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("datasetId") ) /* 2 rows from dataset table: datasetId datasetName */ CREATE TABLE journal ( "journalId" INTEGER NOT NULL, "journalName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("journalId") ) /* 2 rows from journal table: journalId journalName */ CREATE TABLE keyphrase ( "keyphraseId" INTEGER NOT NULL, "keyphraseName" VARCHAR(50) DEFAULT NULL, PRIMARY KEY ("keyphraseId") ) /* 2 rows from keyphrase table: keyphraseId keyphraseName */ CREATE TABLE paper ( "paperId" INTEGER NOT NULL, title VARCHAR(300) DEFAULT NULL, "venueId" INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, "numCiting" INTEGER DEFAULT NULL, "numCitedBy" INTEGER DEFAULT NULL, "journalId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId"), FOREIGN KEY("venueId") REFERENCES venue ("venueId"), FOREIGN KEY("journalId") REFERENCES journal ("journalId") ) /* 2 rows from paper table: paperId title venueId year numCiting numCitedBy journalId */ CREATE TABLE venue ( "venueId" INTEGER NOT NULL, "venueName" VARCHAR(100) DEFAULT NULL, PRIMARY KEY ("venueId") ) /* 2 rows from venue table: venueId venueName */ CREATE TABLE writes ( "paperId" INTEGER DEFAULT NULL, "authorId" INTEGER DEFAULT NULL, PRIMARY KEY ("paperId", "authorId"), FOREIGN KEY("authorId") REFERENCES author ("authorId"), FOREIGN KEY("paperId") REFERENCES paper ("paperId") ) /* 2 rows from writes table: paperId authorId */
keyphrases by Luke Zettlemoyer
SELECT DISTINCT t1.keyphraseid FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN writes AS t4 ON t4.paperid = t3.paperid JOIN author AS t5 ON t4.authorid = t5.authorid WHERE t5.authorname = "Luke Zettlemoyer";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Hard
true
false
false
false
false
false
false
false
true
false
false
false
false
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
what is the capital of the state with the largest population density
SELECT DISTINCT capital FROM state WHERE density = ( SELECT MAX ( density ) FROM state );
[{'Nenhum': 'Nenhum resultado encontrado'}]
Extra Hard
true
false
false
false
false
false
false
false
false
true
false
false
false
[QUESTION]Give the name, population, and head of state for the country that has the largest area.[/QUESTION] [SQL]SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1[/SQL]
[QUESTION]Give the name, population, and head of state for the country that has the largest area.[/QUESTION] [SQL]SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1[/SQL]
[QUESTION]Give the name, population, and head of state for the country that has the largest area.[/QUESTION] [SQL]SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1[/SQL]
[QUESTION]Give the name, population, and head of state for the country that has the largest area.[/QUESTION] [SQL]SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1[/SQL]
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
what are the populations of all the major cities in wisconsin
SELECT population FROM city WHERE population > 150000 AND state_name = "wisconsin";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]How many cities in each district have a population that is above the average population across all cities?[/QUESTION] [SQL]SELECT count(*) , District FROM city WHERE Population > (SELECT avg(Population) FROM city) GROUP BY District[/SQL]
geo
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) )
CREATE TABLE border_info ( state_name TEXT, border TEXT, PRIMARY KEY (border, state_name), FOREIGN KEY(border) REFERENCES state (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from border_info table: state_name border */ CREATE TABLE city ( city_name TEXT, population INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (city_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from city table: city_name population country_name state_name */ CREATE TABLE highlow ( state_name TEXT, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, PRIMARY KEY (state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from highlow table: state_name highest_elevation lowest_point highest_point lowest_elevation */ CREATE TABLE lake ( lake_name TEXT, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT ) /* 2 rows from lake table: lake_name area country_name state_name */ CREATE TABLE mountain ( mountain_name TEXT, mountain_altitude INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, state_name TEXT, PRIMARY KEY (mountain_name, state_name), FOREIGN KEY(state_name) REFERENCES state (state_name) ) /* 2 rows from mountain table: mountain_name mountain_altitude country_name state_name */ CREATE TABLE river ( river_name TEXT, length INTEGER DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, traverse TEXT, PRIMARY KEY (river_name), FOREIGN KEY(traverse) REFERENCES state (state_name) ) /* 2 rows from river table: river_name length country_name traverse */ CREATE TABLE state ( state_name TEXT, population INTEGER DEFAULT NULL, area DOUBLE DEFAULT NULL, country_name VARCHAR(3) DEFAULT '' NOT NULL, capital TEXT, density DOUBLE DEFAULT NULL, PRIMARY KEY (state_name) ) /* 2 rows from state table: state_name population area country_name capital density */
what is the tallest mountain in the united states
SELECT mountain_name FROM mountain WHERE mountain_altitude = ( SELECT MAX ( mountain_altitude ) FROM mountain );
[{'Nenhum': 'Nenhum resultado encontrado'}]
Extra Hard
false
false
false
false
false
false
false
false
false
true
false
false
false
college_3
CREATE TABLE "Course" ( "CID" VARCHAR(7), "CName" VARCHAR(40), "Credits" INTEGER, "Instructor" INTEGER, "Days" VARCHAR(5), "Hours" VARCHAR(11), "DNO" INTEGER, PRIMARY KEY ("CID"), FOREIGN KEY("Instructor") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) CREATE TABLE "Department" ( "DNO" INTEGER, "Division" VARCHAR(2), "DName" VARCHAR(25), "Room" VARCHAR(5), "Building" VARCHAR(13), "DPhone" INTEGER, PRIMARY KEY ("DNO") ) CREATE TABLE "Enrolled_in" ( "StuID" INTEGER, "CID" VARCHAR(7), "Grade" VARCHAR(2), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("CID") REFERENCES "Course" ("CID"), FOREIGN KEY("Grade") REFERENCES "Gradeconversion" (lettergrade) ) CREATE TABLE "Faculty" ( "FacID" INTEGER, "Lname" VARCHAR(15), "Fname" VARCHAR(15), "Rank" VARCHAR(15), "Sex" VARCHAR(1), "Phone" INTEGER, "Room" VARCHAR(5), "Building" VARCHAR(13), PRIMARY KEY ("FacID") ) CREATE TABLE "Gradeconversion" ( lettergrade VARCHAR(2), gradepoint FLOAT, PRIMARY KEY (lettergrade) ) CREATE TABLE "Member_of" ( "FacID" INTEGER, "DNO" INTEGER, "Appt_Type" VARCHAR(15), FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) CREATE TABLE "Minor_in" ( "StuID" INTEGER, "DNO" INTEGER, FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Course" ( "CID" VARCHAR(7), "CName" VARCHAR(40), "Credits" INTEGER, "Instructor" INTEGER, "Days" VARCHAR(5), "Hours" VARCHAR(11), "DNO" INTEGER, PRIMARY KEY ("CID"), FOREIGN KEY("Instructor") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) /* 2 rows from Course table: CID CName Credits Instructor Days Hours DNO 600.101 COMPUTER LITERACY 3 6112 MTW 3 600 600.103 INTRODUCTION TO COMPUTER SCIENCE 1 4230 Th 4 600 */ CREATE TABLE "Department" ( "DNO" INTEGER, "Division" VARCHAR(2), "DName" VARCHAR(25), "Room" VARCHAR(5), "Building" VARCHAR(13), "DPhone" INTEGER, PRIMARY KEY ("DNO") ) /* 2 rows from Department table: DNO Division DName Room Building DPhone 10 AS History of Art 268 Mergenthaler 7117 20 AS Biology 144 Mudd 7330 */ CREATE TABLE "Enrolled_in" ( "StuID" INTEGER, "CID" VARCHAR(7), "Grade" VARCHAR(2), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("CID") REFERENCES "Course" ("CID"), FOREIGN KEY("Grade") REFERENCES "Gradeconversion" (lettergrade) ) /* 2 rows from Enrolled_in table: StuID CID Grade 1001 550.681 A- 1001 600.303 B */ CREATE TABLE "Faculty" ( "FacID" INTEGER, "Lname" VARCHAR(15), "Fname" VARCHAR(15), "Rank" VARCHAR(15), "Sex" VARCHAR(1), "Phone" INTEGER, "Room" VARCHAR(5), "Building" VARCHAR(13), PRIMARY KEY ("FacID") ) /* 2 rows from Faculty table: FacID Lname Fname Rank Sex Phone Room Building 1082 Giuliano Mark Instructor M 2424 224 NEB 1121 Goodrich Michael Professor M 3593 219 NEB */ CREATE TABLE "Gradeconversion" ( lettergrade VARCHAR(2), gradepoint FLOAT, PRIMARY KEY (lettergrade) ) /* 2 rows from Gradeconversion table: lettergrade gradepoint A+ 4.0 A 4.0 */ CREATE TABLE "Member_of" ( "FacID" INTEGER, "DNO" INTEGER, "Appt_Type" VARCHAR(15), FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) /* 2 rows from Member_of table: FacID DNO Appt_Type 7792 600 Primary 9210 520 Primary */ CREATE TABLE "Minor_in" ( "StuID" INTEGER, "DNO" INTEGER, FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("DNO") REFERENCES "Department" ("DNO") ) /* 2 rows from Minor_in table: StuID DNO 1004 520 1005 550 */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
Find the first name of students in the descending order of age.
SELECT Fname FROM STUDENT ORDER BY Age DESC
[{'Fname': 'Bruce'}, {'Fname': 'Paul'}, {'Fname': 'Sarah'}, {'Fname': 'David'}, {'Fname': 'Ian'}, {'Fname': 'Shiela'}, {'Fname': 'Lisa'}, {'Fname': 'Dinesh'}, {'Fname': 'Jandy'}, {'Fname': 'Steven'}, {'Fname': 'Michael'}, {'Fname': 'David'}, {'Fname': 'Eric'}, {'Fname': 'Sarah'}, {'Fname': 'Eric'}, {'Fname': 'Tracy'}, {'Fname': 'Eric'}, {'Fname': 'George'}, {'Fname': 'Eric'}, {'Fname': 'Linda'}, {'Fname': 'Andy'}, {'Fname': 'Lisa'}, {'Fname': 'Charles'}, {'Fname': 'Arthur'}, {'Fname': 'Stacy'}, {'Fname': 'Mark'}, {'Fname': 'Paul'}, {'Fname': 'William'}, {'Fname': 'Eric'}, {'Fname': 'Derek'}, {'Fname': 'Mark'}, {'Fname': 'Michael'}, {'Fname': 'Jun'}, {'Fname': 'Susan'}]
Easy
false
false
false
true
false
false
false
false
false
false
false
false
false
[QUESTION]Find the first names of students who took exactly one class.[/QUESTION] [SQL]SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1[/SQL]
[QUESTION]Find the first names of students who took exactly one class.[/QUESTION] [SQL]SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1[/SQL]
[QUESTION]Find the first names of students who took exactly one class.[/QUESTION] [SQL]SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1[/SQL]
[QUESTION]Find the first names of students who took exactly one class.[/QUESTION] [SQL]SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1[/SQL]
election
CREATE TABLE county ( "County_Id" INTEGER, "County_name" TEXT, "Population" REAL, "Zip_code" TEXT, PRIMARY KEY ("County_Id") ) CREATE TABLE election ( "Election_ID" INTEGER, "Counties_Represented" TEXT, "District" INTEGER, "Delegate" TEXT, "Party" INTEGER, "First_Elected" REAL, "Committee" TEXT, PRIMARY KEY ("Election_ID"), FOREIGN KEY("District") REFERENCES county ("County_Id"), FOREIGN KEY("Party") REFERENCES party ("Party_ID") ) CREATE TABLE party ( "Party_ID" INTEGER, "Year" REAL, "Party" TEXT, "Governor" TEXT, "Lieutenant_Governor" TEXT, "Comptroller" TEXT, "Attorney_General" TEXT, "US_Senate" TEXT, PRIMARY KEY ("Party_ID") )
CREATE TABLE county ( "County_Id" INTEGER, "County_name" TEXT, "Population" REAL, "Zip_code" TEXT, PRIMARY KEY ("County_Id") ) /* 2 rows from county table: County_Id County_name Population Zip_code 1 Howard 21000.0 D21 2 Baltimore County 90000.0 D08 */ CREATE TABLE election ( "Election_ID" INTEGER, "Counties_Represented" TEXT, "District" INTEGER, "Delegate" TEXT, "Party" INTEGER, "First_Elected" REAL, "Committee" TEXT, PRIMARY KEY ("Election_ID"), FOREIGN KEY("District") REFERENCES county ("County_Id"), FOREIGN KEY("Party") REFERENCES party ("Party_ID") ) /* 2 rows from election table: Election_ID Counties_Represented District Delegate Party First_Elected Committee 1 09.1 9A 1 Bates, Gail H. Gail H. Bates 1 2002.0 Appropriations 2 09.1 9A 1 Miller, Warren E. Warren E. Miller 1 2003.0 Economic Matters */ CREATE TABLE party ( "Party_ID" INTEGER, "Year" REAL, "Party" TEXT, "Governor" TEXT, "Lieutenant_Governor" TEXT, "Comptroller" TEXT, "Attorney_General" TEXT, "US_Senate" TEXT, PRIMARY KEY ("Party_ID") ) /* 2 rows from party table: Party_ID Year Party Governor Lieutenant_Governor Comptroller Attorney_General US_Senate 1 1998.0 Democratic Peter Vallone Sandra Frankel Carl McCall Eliot Spitzer Charles Schumer 2 1998.0 Liberal Betsy McCaughey Ross Jonathan Reiter Carl McCall Eliot Spitzer Charles Schumer */
What are the names of parties that have both delegates on "Appropriations" committee and
SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Economic Matters"
[{'Party': 'Democratic'}]
Hard
false
false
false
false
false
false
false
false
true
false
true
false
false
hospital_1
CREATE TABLE "Affiliated_With" ( "Physician" INTEGER NOT NULL, "Department" INTEGER NOT NULL, "PrimaryAffiliation" BOOLEAN NOT NULL, PRIMARY KEY ("Physician", "Department"), CONSTRAINT "fk_Affiliated_With_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Affiliated_With_Department_DepartmentID" FOREIGN KEY("Department") REFERENCES "Department" ("DepartmentID") ) CREATE TABLE "Appointment" ( "AppointmentID" INTEGER NOT NULL, "Patient" INTEGER NOT NULL, "PrepNurse" INTEGER, "Physician" INTEGER NOT NULL, "Start" DATETIME NOT NULL, "End" DATETIME NOT NULL, "ExaminationRoom" TEXT NOT NULL, PRIMARY KEY ("AppointmentID"), CONSTRAINT "fk_Appointment_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Appointment_Nurse_EmployeeID" FOREIGN KEY("PrepNurse") REFERENCES "Nurse" ("EmployeeID"), CONSTRAINT "fk_Appointment_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID") ) CREATE TABLE "Block" ( "BlockFloor" INTEGER NOT NULL, "BlockCode" INTEGER NOT NULL, PRIMARY KEY ("BlockFloor", "BlockCode") ) CREATE TABLE "Department" ( "DepartmentID" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Head" INTEGER NOT NULL, CONSTRAINT "pk_Department" PRIMARY KEY ("DepartmentID"), CONSTRAINT "fk_Department_Physician_EmployeeID" FOREIGN KEY("Head") REFERENCES "Physician" ("EmployeeID") ) CREATE TABLE "Medication" ( "Code" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Brand" VARCHAR(30) NOT NULL, "Description" VARCHAR(30) NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE "Nurse" ( "EmployeeID" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Position" VARCHAR(30) NOT NULL, "Registered" BOOLEAN NOT NULL, "SSN" INTEGER NOT NULL, PRIMARY KEY ("EmployeeID") ) CREATE TABLE "On_Call" ( "Nurse" INTEGER NOT NULL, "BlockFloor" INTEGER NOT NULL, "BlockCode" INTEGER NOT NULL, "OnCallStart" DATETIME NOT NULL, "OnCallEnd" DATETIME NOT NULL, PRIMARY KEY ("Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd"), CONSTRAINT "fk_OnCall_Nurse_EmployeeID" FOREIGN KEY("Nurse") REFERENCES "Nurse" ("EmployeeID"), CONSTRAINT "fk_OnCall_Block_Floor" FOREIGN KEY("BlockFloor", "BlockCode") REFERENCES "Block" ("BlockFloor", "BlockCode") ) CREATE TABLE "Patient" ( "SSN" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Address" VARCHAR(30) NOT NULL, "Phone" VARCHAR(30) NOT NULL, "InsuranceID" INTEGER NOT NULL, "PCP" INTEGER NOT NULL, PRIMARY KEY ("SSN"), CONSTRAINT "fk_Patient_Physician_EmployeeID" FOREIGN KEY("PCP") REFERENCES "Physician" ("EmployeeID") ) CREATE TABLE "Physician" ( "EmployeeID" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Position" VARCHAR(30) NOT NULL, "SSN" INTEGER NOT NULL, CONSTRAINT pk_physician PRIMARY KEY ("EmployeeID") ) CREATE TABLE "Prescribes" ( "Physician" INTEGER NOT NULL, "Patient" INTEGER NOT NULL, "Medication" INTEGER NOT NULL, "Date" DATETIME NOT NULL, "Appointment" INTEGER, "Dose" VARCHAR(30) NOT NULL, PRIMARY KEY ("Physician", "Patient", "Medication", "Date"), CONSTRAINT "fk_Prescribes_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Prescribes_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Prescribes_Medication_Code" FOREIGN KEY("Medication") REFERENCES "Medication" ("Code"), CONSTRAINT "fk_Prescribes_Appointment_AppointmentID" FOREIGN KEY("Appointment") REFERENCES "Appointment" ("AppointmentID") ) CREATE TABLE "Procedures" ( "Code" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Cost" REAL NOT NULL, PRIMARY KEY ("Code") ) CREATE TABLE "Room" ( "RoomNumber" INTEGER NOT NULL, "RoomType" VARCHAR(30) NOT NULL, "BlockFloor" INTEGER NOT NULL, "BlockCode" INTEGER NOT NULL, "Unavailable" BOOLEAN NOT NULL, PRIMARY KEY ("RoomNumber"), CONSTRAINT "fk_Room_Block_PK" FOREIGN KEY("BlockFloor", "BlockCode") REFERENCES "Block" ("BlockFloor", "BlockCode") ) CREATE TABLE "Stay" ( "StayID" INTEGER NOT NULL, "Patient" INTEGER NOT NULL, "Room" INTEGER NOT NULL, "StayStart" DATETIME NOT NULL, "StayEnd" DATETIME NOT NULL, PRIMARY KEY ("StayID"), CONSTRAINT "fk_Stay_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Stay_Room_Number" FOREIGN KEY("Room") REFERENCES "Room" ("RoomNumber") ) CREATE TABLE "Trained_In" ( "Physician" INTEGER NOT NULL, "Treatment" INTEGER NOT NULL, "CertificationDate" DATETIME NOT NULL, "CertificationExpires" DATETIME NOT NULL, PRIMARY KEY ("Physician", "Treatment"), CONSTRAINT "fk_Trained_In_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Trained_In_Procedures_Code" FOREIGN KEY("Treatment") REFERENCES "Procedures" ("Code") ) CREATE TABLE "Undergoes" ( "Patient" INTEGER NOT NULL, "Procedures" INTEGER NOT NULL, "Stay" INTEGER NOT NULL, "DateUndergoes" DATETIME NOT NULL, "Physician" INTEGER NOT NULL, "AssistingNurse" INTEGER, PRIMARY KEY ("Patient", "Procedures", "Stay", "DateUndergoes"), CONSTRAINT "fk_Undergoes_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Undergoes_Procedures_Code" FOREIGN KEY("Procedures") REFERENCES "Procedures" ("Code"), CONSTRAINT "fk_Undergoes_Stay_StayID" FOREIGN KEY("Stay") REFERENCES "Stay" ("StayID"), CONSTRAINT "fk_Undergoes_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Undergoes_Nurse_EmployeeID" FOREIGN KEY("AssistingNurse") REFERENCES "Nurse" ("EmployeeID") )
CREATE TABLE "Affiliated_With" ( "Physician" INTEGER NOT NULL, "Department" INTEGER NOT NULL, "PrimaryAffiliation" BOOLEAN NOT NULL, PRIMARY KEY ("Physician", "Department"), CONSTRAINT "fk_Affiliated_With_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Affiliated_With_Department_DepartmentID" FOREIGN KEY("Department") REFERENCES "Department" ("DepartmentID") ) /* 2 rows from Affiliated_With table: Physician Department PrimaryAffiliation 1 1 True 2 1 True */ CREATE TABLE "Appointment" ( "AppointmentID" INTEGER NOT NULL, "Patient" INTEGER NOT NULL, "PrepNurse" INTEGER, "Physician" INTEGER NOT NULL, "Start" DATETIME NOT NULL, "End" DATETIME NOT NULL, "ExaminationRoom" TEXT NOT NULL, PRIMARY KEY ("AppointmentID"), CONSTRAINT "fk_Appointment_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Appointment_Nurse_EmployeeID" FOREIGN KEY("PrepNurse") REFERENCES "Nurse" ("EmployeeID"), CONSTRAINT "fk_Appointment_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID") ) /* 2 rows from Appointment table: AppointmentID Patient PrepNurse Physician Start End ExaminationRoom 13216584 100000001 101 1 2008-04-24 10:00:00 2008-04-24 11:00:00 A 26548913 100000002 101 2 2008-04-24 10:00:00 2008-04-24 11:00:00 B */ CREATE TABLE "Block" ( "BlockFloor" INTEGER NOT NULL, "BlockCode" INTEGER NOT NULL, PRIMARY KEY ("BlockFloor", "BlockCode") ) /* 2 rows from Block table: BlockFloor BlockCode 1 1 1 2 */ CREATE TABLE "Department" ( "DepartmentID" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Head" INTEGER NOT NULL, CONSTRAINT "pk_Department" PRIMARY KEY ("DepartmentID"), CONSTRAINT "fk_Department_Physician_EmployeeID" FOREIGN KEY("Head") REFERENCES "Physician" ("EmployeeID") ) /* 2 rows from Department table: DepartmentID Name Head 1 General Medicine 4 2 Surgery 7 */ CREATE TABLE "Medication" ( "Code" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Brand" VARCHAR(30) NOT NULL, "Description" VARCHAR(30) NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from Medication table: Code Name Brand Description 1 Procrastin-X X N/A 2 Thesisin Foo Labs N/A */ CREATE TABLE "Nurse" ( "EmployeeID" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Position" VARCHAR(30) NOT NULL, "Registered" BOOLEAN NOT NULL, "SSN" INTEGER NOT NULL, PRIMARY KEY ("EmployeeID") ) /* 2 rows from Nurse table: EmployeeID Name Position Registered SSN 101 Carla Espinosa Head Nurse True 111111110 102 Laverne Roberts Nurse True 222222220 */ CREATE TABLE "On_Call" ( "Nurse" INTEGER NOT NULL, "BlockFloor" INTEGER NOT NULL, "BlockCode" INTEGER NOT NULL, "OnCallStart" DATETIME NOT NULL, "OnCallEnd" DATETIME NOT NULL, PRIMARY KEY ("Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd"), CONSTRAINT "fk_OnCall_Nurse_EmployeeID" FOREIGN KEY("Nurse") REFERENCES "Nurse" ("EmployeeID"), CONSTRAINT "fk_OnCall_Block_Floor" FOREIGN KEY("BlockFloor", "BlockCode") REFERENCES "Block" ("BlockFloor", "BlockCode") ) /* 2 rows from On_Call table: Nurse BlockFloor BlockCode OnCallStart OnCallEnd 101 1 1 2008-11-04 11:00:00 2008-11-04 19:00:00 101 1 2 2008-11-04 11:00:00 2008-11-04 19:00:00 */ CREATE TABLE "Patient" ( "SSN" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Address" VARCHAR(30) NOT NULL, "Phone" VARCHAR(30) NOT NULL, "InsuranceID" INTEGER NOT NULL, "PCP" INTEGER NOT NULL, PRIMARY KEY ("SSN"), CONSTRAINT "fk_Patient_Physician_EmployeeID" FOREIGN KEY("PCP") REFERENCES "Physician" ("EmployeeID") ) /* 2 rows from Patient table: SSN Name Address Phone InsuranceID PCP 100000001 John Smith 42 Foobar Lane 555-0256 68476213 1 100000002 Grace Ritchie 37 Snafu Drive 555-0512 36546321 2 */ CREATE TABLE "Physician" ( "EmployeeID" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Position" VARCHAR(30) NOT NULL, "SSN" INTEGER NOT NULL, CONSTRAINT pk_physician PRIMARY KEY ("EmployeeID") ) /* 2 rows from Physician table: EmployeeID Name Position SSN 1 John Dorian Staff Internist 111111111 2 Elliot Reid Attending Physician 222222222 */ CREATE TABLE "Prescribes" ( "Physician" INTEGER NOT NULL, "Patient" INTEGER NOT NULL, "Medication" INTEGER NOT NULL, "Date" DATETIME NOT NULL, "Appointment" INTEGER, "Dose" VARCHAR(30) NOT NULL, PRIMARY KEY ("Physician", "Patient", "Medication", "Date"), CONSTRAINT "fk_Prescribes_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Prescribes_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Prescribes_Medication_Code" FOREIGN KEY("Medication") REFERENCES "Medication" ("Code"), CONSTRAINT "fk_Prescribes_Appointment_AppointmentID" FOREIGN KEY("Appointment") REFERENCES "Appointment" ("AppointmentID") ) /* 2 rows from Prescribes table: Physician Patient Medication Date Appointment Dose 1 100000001 1 2008-04-24 10:47:00 13216584 5 9 100000004 2 2008-04-27 10:53:00 86213939 10 */ CREATE TABLE "Procedures" ( "Code" INTEGER NOT NULL, "Name" VARCHAR(30) NOT NULL, "Cost" REAL NOT NULL, PRIMARY KEY ("Code") ) /* 2 rows from Procedures table: Code Name Cost 1 Reverse Rhinopodoplasty 1500.0 2 Obtuse Pyloric Recombobulation 3750.0 */ CREATE TABLE "Room" ( "RoomNumber" INTEGER NOT NULL, "RoomType" VARCHAR(30) NOT NULL, "BlockFloor" INTEGER NOT NULL, "BlockCode" INTEGER NOT NULL, "Unavailable" BOOLEAN NOT NULL, PRIMARY KEY ("RoomNumber"), CONSTRAINT "fk_Room_Block_PK" FOREIGN KEY("BlockFloor", "BlockCode") REFERENCES "Block" ("BlockFloor", "BlockCode") ) /* 2 rows from Room table: RoomNumber RoomType BlockFloor BlockCode Unavailable 101 Single 1 1 False 102 Single 1 1 False */ CREATE TABLE "Stay" ( "StayID" INTEGER NOT NULL, "Patient" INTEGER NOT NULL, "Room" INTEGER NOT NULL, "StayStart" DATETIME NOT NULL, "StayEnd" DATETIME NOT NULL, PRIMARY KEY ("StayID"), CONSTRAINT "fk_Stay_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Stay_Room_Number" FOREIGN KEY("Room") REFERENCES "Room" ("RoomNumber") ) /* 2 rows from Stay table: StayID Patient Room StayStart StayEnd 3215 100000001 111 2008-05-01 00:00:00 2008-05-04 00:00:00 3216 100000003 123 2008-05-03 00:00:00 2008-05-14 00:00:00 */ CREATE TABLE "Trained_In" ( "Physician" INTEGER NOT NULL, "Treatment" INTEGER NOT NULL, "CertificationDate" DATETIME NOT NULL, "CertificationExpires" DATETIME NOT NULL, PRIMARY KEY ("Physician", "Treatment"), CONSTRAINT "fk_Trained_In_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Trained_In_Procedures_Code" FOREIGN KEY("Treatment") REFERENCES "Procedures" ("Code") ) /* 2 rows from Trained_In table: Physician Treatment CertificationDate CertificationExpires 3 1 2008-01-01 00:00:00 2008-12-31 00:00:00 3 2 2008-01-01 00:00:00 2008-12-31 00:00:00 */ CREATE TABLE "Undergoes" ( "Patient" INTEGER NOT NULL, "Procedures" INTEGER NOT NULL, "Stay" INTEGER NOT NULL, "DateUndergoes" DATETIME NOT NULL, "Physician" INTEGER NOT NULL, "AssistingNurse" INTEGER, PRIMARY KEY ("Patient", "Procedures", "Stay", "DateUndergoes"), CONSTRAINT "fk_Undergoes_Patient_SSN" FOREIGN KEY("Patient") REFERENCES "Patient" ("SSN"), CONSTRAINT "fk_Undergoes_Procedures_Code" FOREIGN KEY("Procedures") REFERENCES "Procedures" ("Code"), CONSTRAINT "fk_Undergoes_Stay_StayID" FOREIGN KEY("Stay") REFERENCES "Stay" ("StayID"), CONSTRAINT "fk_Undergoes_Physician_EmployeeID" FOREIGN KEY("Physician") REFERENCES "Physician" ("EmployeeID"), CONSTRAINT "fk_Undergoes_Nurse_EmployeeID" FOREIGN KEY("AssistingNurse") REFERENCES "Nurse" ("EmployeeID") ) /* 2 rows from Undergoes table: Patient Procedures Stay DateUndergoes Physician AssistingNurse 100000001 6 3215 2008-05-02 00:00:00 3 101 100000001 2 3215 2008-05-03 00:00:00 7 101 */
Which patients made more than one appointment? Tell me the name and phone number of these patients.
SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING count(*) > 1
[{'Name': 'John Smith', 'Phone': '555-0256'}, {'Name': 'Grace Ritchie', 'Phone': '555-0512'}, {'Name': 'Dennis Doe', 'Phone': '555-2048'}]
Medium
false
false
false
false
false
true
true
true
false
false
false
false
false
[QUESTION]List the date of each treatment, together with the first name of the professional who operated it.[/QUESTION] [SQL]SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id[/SQL]
[QUESTION]List the date of each treatment, together with the first name of the professional who operated it.[/QUESTION] [SQL]SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id[/SQL]
[QUESTION]List the date of each treatment, together with the first name of the professional who operated it.[/QUESTION] [SQL]SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id[/SQL]
[QUESTION]List the date of each treatment, together with the first name of the professional who operated it.[/QUESTION] [SQL]SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id[/SQL]
yelp
CREATE TABLE business ( bid INTEGER, business_id TEXT, name TEXT, full_address TEXT, city TEXT, latitude TEXT, longitude TEXT, review_count INTEGER, is_open INTEGER, rating REAL, state TEXT, PRIMARY KEY (bid) ) CREATE TABLE category ( id INTEGER, business_id TEXT, category_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE checkin ( cid INTEGER, business_id TEXT, count INTEGER, day TEXT, PRIMARY KEY (cid), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE neighbourhood ( id INTEGER, business_id TEXT, neighbourhood_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE review ( rid INTEGER, business_id TEXT, user_id TEXT, rating REAL, text TEXT, year INTEGER, month TEXT, PRIMARY KEY (rid), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE tip ( tip_id INTEGER, business_id TEXT, text TEXT, user_id TEXT, likes INTEGER, year INTEGER, month TEXT, PRIMARY KEY (tip_id), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) CREATE TABLE user ( uid INTEGER, user_id TEXT, name TEXT, PRIMARY KEY (uid) )
CREATE TABLE business ( bid INTEGER, business_id TEXT, name TEXT, full_address TEXT, city TEXT, latitude TEXT, longitude TEXT, review_count INTEGER, is_open INTEGER, rating REAL, state TEXT, PRIMARY KEY (bid) ) /* 2 rows from business table: bid business_id name full_address city latitude longitude review_count is_open rating state */ CREATE TABLE category ( id INTEGER, business_id TEXT, category_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from category table: id business_id category_name */ CREATE TABLE checkin ( cid INTEGER, business_id TEXT, count INTEGER, day TEXT, PRIMARY KEY (cid), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from checkin table: cid business_id count day */ CREATE TABLE neighbourhood ( id INTEGER, business_id TEXT, neighbourhood_name TEXT, PRIMARY KEY (id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from neighbourhood table: id business_id neighbourhood_name */ CREATE TABLE review ( rid INTEGER, business_id TEXT, user_id TEXT, rating REAL, text TEXT, year INTEGER, month TEXT, PRIMARY KEY (rid), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from review table: rid business_id user_id rating text year month */ CREATE TABLE tip ( tip_id INTEGER, business_id TEXT, text TEXT, user_id TEXT, likes INTEGER, year INTEGER, month TEXT, PRIMARY KEY (tip_id), FOREIGN KEY(user_id) REFERENCES user (user_id), FOREIGN KEY(business_id) REFERENCES business (business_id) ) /* 2 rows from tip table: tip_id business_id text user_id likes year month */ CREATE TABLE user ( uid INTEGER, user_id TEXT, name TEXT, PRIMARY KEY (uid) ) /* 2 rows from user table: uid user_id name */
find all the restaurant in Pennsylvania
SELECT t1.name FROM category AS t2 JOIN business AS t1 ON t2.business_id = t1.business_id WHERE t1.state = "Pennsylvania" AND t2.category_name = "restaurant";
[{'Nenhum': 'Nenhum resultado encontrado'}]
Medium
false
false
false
false
false
false
false
true
false
false
false
false
false
allergy_1
CREATE TABLE "Allergy_Type" ( "Allergy" VARCHAR(20), "AllergyType" VARCHAR(20), PRIMARY KEY ("Allergy") ) CREATE TABLE "Has_Allergy" ( "StuID" INTEGER, "Allergy" VARCHAR(20), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("Allergy") REFERENCES "Allergy_Type" ("Allergy") ) CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") )
CREATE TABLE "Allergy_Type" ( "Allergy" VARCHAR(20), "AllergyType" VARCHAR(20), PRIMARY KEY ("Allergy") ) /* 2 rows from Allergy_Type table: Allergy AllergyType Eggs food Nuts food */ CREATE TABLE "Has_Allergy" ( "StuID" INTEGER, "Allergy" VARCHAR(20), FOREIGN KEY("StuID") REFERENCES "Student" ("StuID"), FOREIGN KEY("Allergy") REFERENCES "Allergy_Type" ("Allergy") ) /* 2 rows from Has_Allergy table: StuID Allergy 1001 Cat 1002 Shellfish */ CREATE TABLE "Student" ( "StuID" INTEGER, "LName" VARCHAR(12), "Fname" VARCHAR(12), "Age" INTEGER, "Sex" VARCHAR(1), "Major" INTEGER, "Advisor" INTEGER, city_code VARCHAR(3), PRIMARY KEY ("StuID") ) /* 2 rows from Student table: StuID LName Fname Age Sex Major Advisor city_code 1001 Smith Linda 18 F 600 1121 BAL 1002 Kim Tracy 19 F 600 7712 HKG */
Show all advisors and corresponding number of students.
SELECT advisor , count(*) FROM Student GROUP BY advisor
[{'Advisor': 1121, 'count(*)': 3}, {'Advisor': 1148, 'count(*)': 3}, {'Advisor': 2192, 'count(*)': 4}, {'Advisor': 2311, 'count(*)': 3}, {'Advisor': 5718, 'count(*)': 2}, {'Advisor': 7134, 'count(*)': 2}, {'Advisor': 7271, 'count(*)': 2}, {'Advisor': 7712, 'count(*)': 1}, {'Advisor': 7723, 'count(*)': 1}, {'Advisor': 7792, 'count(*)': 1}, {'Advisor': 8423, 'count(*)': 1}, {'Advisor': 8721, 'count(*)': 1}, {'Advisor': 8722, 'count(*)': 3}, {'Advisor': 8723, 'count(*)': 1}, {'Advisor': 8741, 'count(*)': 1}, {'Advisor': 8772, 'count(*)': 3}, {'Advisor': 8918, 'count(*)': 1}, {'Advisor': 9172, 'count(*)': 1}]
Easy
false
false
false
false
false
true
false
false
false
false
false
false
false
[QUESTION]Show the student IDs and numbers of friends corresponding to each.[/QUESTION] [SQL]SELECT student_id , count(*) FROM Friend GROUP BY student_id[/SQL]
[QUESTION]Show the student IDs and numbers of friends corresponding to each.[/QUESTION] [SQL]SELECT student_id , count(*) FROM Friend GROUP BY student_id[/SQL]
[QUESTION]Show the student IDs and numbers of friends corresponding to each.[/QUESTION] [SQL]SELECT student_id , count(*) FROM Friend GROUP BY student_id[/SQL]
[QUESTION]Show the student IDs and numbers of friends corresponding to each.[/QUESTION] [SQL]SELECT student_id , count(*) FROM Friend GROUP BY student_id[/SQL]
gas_company
CREATE TABLE company ( "Company_ID" INTEGER, "Rank" INTEGER, "Company" TEXT, "Headquarters" TEXT, "Main_Industry" TEXT, "Sales_billion" REAL, "Profits_billion" REAL, "Assets_billion" REAL, "Market_Value" REAL, PRIMARY KEY ("Company_ID") ) CREATE TABLE gas_station ( "Station_ID" INTEGER, "Open_Year" INTEGER, "Location" TEXT, "Manager_Name" TEXT, "Vice_Manager_Name" TEXT, "Representative_Name" TEXT, PRIMARY KEY ("Station_ID") ) CREATE TABLE station_company ( "Station_ID" INTEGER, "Company_ID" INTEGER, "Rank_of_the_Year" INTEGER, PRIMARY KEY ("Station_ID", "Company_ID"), FOREIGN KEY("Company_ID") REFERENCES company ("Company_ID"), FOREIGN KEY("Station_ID") REFERENCES gas_station ("Station_ID") )
CREATE TABLE company ( "Company_ID" INTEGER, "Rank" INTEGER, "Company" TEXT, "Headquarters" TEXT, "Main_Industry" TEXT, "Sales_billion" REAL, "Profits_billion" REAL, "Assets_billion" REAL, "Market_Value" REAL, PRIMARY KEY ("Company_ID") ) /* 2 rows from company table: Company_ID Rank Company Headquarters Main_Industry Sales_billion Profits_billion Assets_billion Market_Value 1 1 ExxonMobil USA Oil and gas 433.5 41.1 331.1 407.4 2 3 General Electric USA Conglomerate 147.3 14.2 717.2 213.7 */ CREATE TABLE gas_station ( "Station_ID" INTEGER, "Open_Year" INTEGER, "Location" TEXT, "Manager_Name" TEXT, "Vice_Manager_Name" TEXT, "Representative_Name" TEXT, PRIMARY KEY ("Station_ID") ) /* 2 rows from gas_station table: Station_ID Open_Year Location Manager_Name Vice_Manager_Name Representative_Name 1 1998 Herne Hill BrianWingrave Russell Denman Clive Burr 2 1999 Channel Hill SimonMarloe Russell Brown Rob Jefferies */ CREATE TABLE station_company ( "Station_ID" INTEGER, "Company_ID" INTEGER, "Rank_of_the_Year" INTEGER, PRIMARY KEY ("Station_ID", "Company_ID"), FOREIGN KEY("Company_ID") REFERENCES company ("Company_ID"), FOREIGN KEY("Station_ID") REFERENCES gas_station ("Station_ID") ) /* 2 rows from station_company table: Station_ID Company_ID Rank_of_the_Year 11 1 1 1 3 2 */
Show minimum, maximum, and average market value for all companies.
SELECT min(market_value) , max(market_value) , avg(market_value) FROM company
[{'min(market_value)': 147.4, 'max(market_value)': 407.4, 'avg(market_value)': 225.34}]
Easy
false
false
false
false
false
false
false
false
false
false
false
false
false
[QUESTION]find the minimum and maximum number of products of all stores.[/QUESTION] [SQL]SELECT min(Number_products) , max(Number_products) FROM shop[/SQL]
race_track
CREATE TABLE race ( "Race_ID" INTEGER, "Name" TEXT, "Class" TEXT, "Date" TEXT, "Track_ID" TEXT, PRIMARY KEY ("Race_ID"), FOREIGN KEY("Track_ID") REFERENCES track ("Track_ID") ) CREATE TABLE track ( "Track_ID" INTEGER, "Name" TEXT, "Location" TEXT, "Seating" REAL, "Year_Opened" REAL, PRIMARY KEY ("Track_ID") )
CREATE TABLE race ( "Race_ID" INTEGER, "Name" TEXT, "Class" TEXT, "Date" TEXT, "Track_ID" TEXT, PRIMARY KEY ("Race_ID"), FOREIGN KEY("Track_ID") REFERENCES track ("Track_ID") ) /* 2 rows from race table: Race_ID Name Class Date Track_ID 1 Rolex 24 At Daytona DP/GT January 26 January 27 1 2 Gainsco Grand Prix of Miami DP/GT March 29 2 */ CREATE TABLE track ( "Track_ID" INTEGER, "Name" TEXT, "Location" TEXT, "Seating" REAL, "Year_Opened" REAL, PRIMARY KEY ("Track_ID") ) /* 2 rows from track table: Track_ID Name Location Seating Year_Opened 1 Auto Club Speedway Fontana, CA 92000.0 1997.0 2 Chicagoland Speedway Joliet, IL 75000.0 2001.0 */
What are the names of different tracks, and how many races has each had?
SELECT T2.name , count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id
[{'Name': 'Auto Club Speedway', 'count(*)': 1}, {'Name': 'Chicagoland Speedway', 'count(*)': 2}, {'Name': 'Daytona International Speedway', 'count(*)': 1}, {'Name': 'Homestead-Miami Speedway', 'count(*)': 1}, {'Name': 'Kansas Speedway', 'count(*)': 1}, {'Name': 'Martinsville Speedway', 'count(*)': 1}]
Medium
false
false
false
false
false
true
false
true
false
false
false
false
false