instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which OF-5 is in Ghana? | CREATE TABLE table_52037 ("Country" text,"OF-5" text,"OF-4" text,"OF-2" text,"OF-1" text) | SELECT "OF-5" FROM table_52037 WHERE "Country" = 'ghana' |
What is the calling at for the 09.50 departure? | CREATE TABLE table_18332845_2 (calling_at VARCHAR,departure VARCHAR) | SELECT calling_at FROM table_18332845_2 WHERE departure = "09.50" |
Who directed the episode that originally aired on March 18, 1988? | CREATE TABLE table_24023 ("Ep." real,"Season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. Code" text) | SELECT "Directed by" FROM table_24023 WHERE "Original air date" = 'March 18, 1988' |
Can you tell me the Score that has the Team of memphis? | CREATE TABLE table_name_89 (score VARCHAR,team VARCHAR) | SELECT score FROM table_name_89 WHERE team = "memphis" |
Which engine is responsible for the USAC Championship Car? | CREATE TABLE table_79784 ("Season" text,"Date" text,"Driver" text,"Chassis" text,"Engine" text,"Series" text,"Report" text) | SELECT "Engine" FROM table_79784 WHERE "Series" = 'usac championship car' |
What draft pick number attended syracuse and was drafted by the Carolina panthers? | CREATE TABLE table_name_38 (pick__number INTEGER,nfl_team VARCHAR,college VARCHAR) | SELECT SUM(pick__number) FROM table_name_38 WHERE nfl_team = "carolina panthers" AND college = "syracuse" |
what is the only years without representatives from either the democratic or republican party . | CREATE TABLE table_203_95 (id number,"year" text,"democratic\nparty" number,"republican\nparty" number,"independent\n/ other" text,"majority" number) | SELECT "year" FROM table_203_95 WHERE "democratic\nparty" = 0 AND "republican\nparty" = 0 |
What was the outcome of the match opponents in the final of Marius C lug ru Ciprian Petre Porumb? | CREATE TABLE table_71806 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score" text) | SELECT "Outcome" FROM table_71806 WHERE "Opponents in the final" = 'marius călugăru ciprian petre porumb' |
Give me line charts of worldwide gross the number of season over year season by major genres Away_team, I want to display X in descending order please. | CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendance real,Capacity_Percentage real)CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team ... | SELECT Season, COUNT(Season) FROM game GROUP BY Away_team, Season ORDER BY Season DESC |
what is the average age of male patients with medicaid insurance? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Medicaid" |
what was the maximum theophylline value for patient 007-1517 on their first hospital visit. | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-1517' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... |
Name the security forces with civilians being 67 | CREATE TABLE table_57138 ("Year" text,"Security Forces" text,"Insurgents" text,"Civilians" text,"Total:" text) | SELECT "Security Forces" FROM table_57138 WHERE "Civilians" = '67' |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of phone_number and salary , and list by the Y in desc please. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUN... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC |
Date of October 25, 1964 involves what record? | CREATE TABLE table_name_1 (record VARCHAR,date VARCHAR) | SELECT record FROM table_name_1 WHERE date = "october 25, 1964" |
When did they play the swindon wildcats away? | CREATE TABLE table_name_14 (date VARCHAR,venue VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_14 WHERE venue = "away" AND opponent = "swindon wildcats" |
how many of the private patients had a lab test for total cholesterol? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Cholesterol, Total" |
What's the total number of games with more than 20 points for the 1976 season? | CREATE TABLE table_80430 ("Season" text,"Team Name" text,"Games" real,"Losses" real,"Points" real) | SELECT COUNT("Games") FROM table_80430 WHERE "Season" = '1976' AND "Points" > '20' |
How many are the total winners if 7 won the Men's Open? | CREATE TABLE table_182298_5 (total VARCHAR,mens_open VARCHAR) | SELECT total FROM table_182298_5 WHERE mens_open = 7 |
What are the names of customers who have a savings balance lower than their checking balance, and what is the total of their checking and savings balances? | CREATE TABLE accounts (custid number,name text)CREATE TABLE checking (custid number,balance number)CREATE TABLE savings (custid number,balance number) | SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance |
for patient id 30011, specify the icd9 code and procedural long title. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "30011" |
What was the smallest crowd size for away team st kilda? | CREATE TABLE table_54711 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MIN("Crowd") FROM table_54711 WHERE "Away team" = 'st kilda' |
Which authority has a rocket launch called rehnuma-8? | CREATE TABLE table_11869952_1 (institutional_authority VARCHAR,rocket_launch VARCHAR) | SELECT institutional_authority FROM table_11869952_1 WHERE rocket_launch = "Rehnuma-8" |
What is the Head Coach of Novy Urengoy? | CREATE TABLE table_35376 ("Previous season" text,"Team" text,"Town" text,"Arena (capacity)" text,"Website" text,"Head Coach" text,"Foreign Players (max. 2)" text) | SELECT "Head Coach" FROM table_35376 WHERE "Town" = 'novy urengoy' |
Name the location of record 5-3 | CREATE TABLE table_58291 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Location" FROM table_58291 WHERE "Record" = '5-3' |
what are the differences in the rbc in patient 031-15417 second measured on the first hospital visit compared to the first value measured on the first hospital visit? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... |
Return the average price for each product type by a bar chart, and could you list the average of product price from high to low order? | CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supplied_to DATETIME,total_amount_purchased VARCHAR(80),total_value_purchased DECIMAL(19,4))CREATE TABLE Staff_Department_Assignments (staff_id ... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC |
what was the daily minimum amount of nasogastric given to patient 11064 in the last hospital visit? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text... | SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11064 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outpu... |
What is the surface of the score, 7 6 (7 3) , 6 3? | CREATE TABLE table_name_40 (surface VARCHAR,score VARCHAR) | SELECT surface FROM table_name_40 WHERE score = "7–6 (7–3) , 6–3" |
What position has a Cross-code debut of 1st ru test v ireland? | CREATE TABLE table_name_79 (position VARCHAR,cross_code_debut VARCHAR) | SELECT position FROM table_name_79 WHERE cross_code_debut = "1st ru test v ireland" |
What is the sum of the place that has less than 2 losses? | CREATE TABLE table_69374 ("Place" real,"Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" real) | SELECT SUM("Place") FROM table_69374 WHERE "Lost" < '2' |
What is the lowest par for Bobby Cruickshank? | CREATE TABLE table_name_9 (to_par INTEGER,player VARCHAR) | SELECT MIN(to_par) FROM table_name_9 WHERE player = "bobby cruickshank" |
What is the record that has the Rose Garden 20,126 as the attendance? | CREATE TABLE table_10222 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text,"Streak" text) | SELECT "Record" FROM table_10222 WHERE "Attendance" = 'rose garden 20,126' |
What is GDP (PPP) Per Capita 2012 Euro, when Population In Millions is greater than 10.8, and when GDP (Nominal) Per Capita 2012 Euro is 25,600? | CREATE TABLE table_43200 ("s Member state" text,"GDP 2012 millions of euro" text,"Population in millions" real,"GDP (PPP) per capita 2012 euro" text,"GDP (Nominal) per capita 2012 euro" text,"GDP (PPP) per capita 2012 EU27 = 100" text) | SELECT "GDP (PPP) per capita 2012 euro" FROM table_43200 WHERE "Population in millions" > '10.8' AND "GDP (Nominal) per capita 2012 euro" = '25,600' |
how many iso/iec were published in 2011 ? | CREATE TABLE table_204_200 (id number,"iso/iec standard" text,"title" text,"status" text,"description" text,"wg" number) | SELECT COUNT("iso/iec standard") FROM table_204_200 WHERE "status" = 2011 |
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the founder , and group by attribute founder, and show from high to low by the total number please. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC |
what's the minimum species in the peruvian amazon with taxonomy s fern ( pteridophyta ) | CREATE TABLE table_11727969_1 (species_in_the_peruvian_amazon INTEGER,taxonomy VARCHAR) | SELECT MIN(species_in_the_peruvian_amazon) FROM table_11727969_1 WHERE taxonomy = "s Fern ( Pteridophyta )" |
What is the death status and number of days of hospital stay for subject id 52012? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "52012" |
Name the revenue for eps being 1.19 | CREATE TABLE table_23764 ("Year ended" real,"Revenue (\u20acmillion)" real,"Earnings before interest and taxes (\u20acm)" text,"Net profit (\u20acm)" text,"Earnings per share (\u20ac)" text) | SELECT MAX("Revenue (\u20acmillion)") FROM table_23764 WHERE "Earnings per share (\u20ac)" = '1.19' |
how many patients admitted in emergency were tested for ferritin? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Ferritin" |
Show the of customer addresses and group by premises type and address type code in a stacked bar chart The x-axis is premises type, sort x-axis in ascending order. | CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),customer_phone VARCHAR(80),customer_email VARCHAR(80),customer_address VARCHAR(255),customer_login VARCHAR(80),customer_password VARCHAR(10))CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_status_co... | SELECT premises_type, COUNT(premises_type) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY address_type_code, premises_type ORDER BY premises_type |
How many rounds did the match last when his record was 6-6? | CREATE TABLE table_45605 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Location" text) | SELECT "Round" FROM table_45605 WHERE "Record" = '6-6' |
What is the average % of population Tunisia, which has an average relative annual growth smaller than 1.03? | CREATE TABLE table_56045 ("Rank" text,"Country (or dependent territory)" text,"July 1,2013 projection" real,"% of pop." real,"Average relative annual growth (%)" real,"Average absolute annual growth" real) | SELECT AVG("% of pop.") FROM table_56045 WHERE "Country (or dependent territory)" = 'tunisia' AND "Average relative annual growth (%)" < '1.03' |
get the number of patients who take drug via ed route and have diagnoses icd9 code 56212. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "56212" AND prescriptions.route = "ED" |
how many patients whose admission year is less than 2138 and diagnoses long title is adrenal cortical steroids causing adverse effects in therapeutic use? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2138" AND diagnoses.long_title = "Adrenal cortical steroids causing adverse effects in therapeutic use" |
what is the maximum age of patients whose admission type is emergency and the hospital stay is 2 days? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "2" |
Name the episode that aired october 8, 1988 | CREATE TABLE table_80268 ("Episode title" text,"Villain(s)" text,"Identity(ies)" text,"Original airdate" text,"DVD volume" real) | SELECT "Episode title" FROM table_80268 WHERE "Original airdate" = 'october 8, 1988' |
What notes have 2 as the rank? | CREATE TABLE table_name_62 (notes VARCHAR,rank VARCHAR) | SELECT notes FROM table_name_62 WHERE rank = 2 |
What is the top 3 area of crime conducted? | CREATE TABLE greatermanchestercrime (crimeid text,crimets time,location text,lsoa text,type text,outcome text) | SELECT location FROM greatermanchestercrime GROUP BY location ORDER BY COUNT(*) DESC LIMIT 3 |
How many teams does Jeff Wyler own? | CREATE TABLE table_19908313_2 (team VARCHAR,listed_owner_s_ VARCHAR) | SELECT COUNT(team) FROM table_19908313_2 WHERE listed_owner_s_ = "Jeff Wyler" |
What is the highest Pick that has a round greater than 6 and an overall greater than 216? | CREATE TABLE table_8620 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT MAX("Pick") FROM table_8620 WHERE "Round" > '6' AND "Overall" > '216' |
who has more households between fallon and phillips ? | CREATE TABLE table_204_572 (id number,"rank" number,"county" text,"per capita\nincome" text,"median\nhousehold\nincome" text,"median\nfamily\nincome" text,"population" number,"number of\nhouseholds" number) | SELECT "county" FROM table_204_572 WHERE "county" IN ('fallon', 'phillips') ORDER BY "number of\nhouseholds" DESC LIMIT 1 |
In what category was character Jacqui Mcqueen nominated before 2011? | CREATE TABLE table_10960 ("Year" real,"Result" text,"Award" text,"Category" text,"Film or series" text,"Character" text) | SELECT "Category" FROM table_10960 WHERE "Character" = 'jacqui mcqueen' AND "Year" < '2011' |
how many patients whose drug code is lido5t and lab test fluid is joint fluid? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LIDO5T" AND lab.fluid = "Joint Fluid" |
What is the latest Year with Marianne Jean-Baptiste as the Golden Globe Actor? | CREATE TABLE table_name_50 (year INTEGER,actor VARCHAR) | SELECT MAX(year) FROM table_name_50 WHERE actor = "marianne jean-baptiste" |
How many positive votes for Tennessee in 2006? | CREATE TABLE table_67456 ("State" text,"Date" text,"Yes vote" text,"No vote" text,"Vote outcome" text) | SELECT "Yes vote" FROM table_67456 WHERE "Date" = '2006' AND "State" = 'tennessee' |
When the second intermediate period of egypt is the ubaid period in mesopotamia how many early calcolithics are there? | CREATE TABLE table_26151 ("Copper Age" text,"Chalcolithic (4500 BC - 3300 BC)" text,"Early Chalcolithic" text,"4500 BC - 4000 BC" text,"Ubaid period in Mesopotamia" text) | SELECT COUNT("Early Chalcolithic") FROM table_26151 WHERE "Ubaid period in Mesopotamia" = 'Second Intermediate Period of Egypt' |
What is the ethnic group that in 2001 had 117,513? | CREATE TABLE table_22533 ("Ethnic Group" text,"2001 (%)" text,"2001 (people)" text,"2006 (%)" text,"2006 (people)" real) | SELECT "Ethnic Group" FROM table_22533 WHERE "2001 (people)" = '117,513' |
what is the daily average of urine output of patient 025-51980 since 51 months ago? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe... | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-51980')) AND intakeoutput.celllabel = 'urine... |
Which group has the RNCS formula? | CREATE TABLE table_56823 ("Chemical class" text,"Group" text,"Formula" text,"Prefix" text,"Suffix" text) | SELECT "Group" FROM table_56823 WHERE "Formula" = 'rncs' |
Show me a bar chart for what are the total enrollments of universities of each affiliation type?, list Y-axis in desc order. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment) DESC |
A bar chart for returning the number of the completion date for all the tests that have 'Fail' result, display Y from low to high order please. | CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VAR... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) |
Does Political Sociology have only one teacher , Prof. Men ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE ta (campus_job_id int,student_id int,location var... | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Political Sociology%' AND NOT instructor.name LIKE '%Men%' AND offering_instructor.instructor_id = instru... |
what was the date of the first game ? | CREATE TABLE table_204_658 (id number,"week" number,"date" text,"kickoff" text,"opponent" text,"results\nfinal score" text,"results\nteam record" text,"game site" text,"attendance" number) | SELECT "date" FROM table_204_658 ORDER BY "date" LIMIT 1 |
which Construction is named heng-hai? | CREATE TABLE table_name_69 (construction VARCHAR,name__wade_giles_ VARCHAR) | SELECT construction FROM table_name_69 WHERE name__wade_giles_ = "heng-hai" |
What is the version with sbagen software? | CREATE TABLE table_15038373_1 (version VARCHAR,software VARCHAR) | SELECT version FROM table_15038373_1 WHERE software = "SBaGen" |
What surface was the April 24, 2003 match played on? | CREATE TABLE table_name_88 (surface VARCHAR,date VARCHAR) | SELECT surface FROM table_name_88 WHERE date = "april 24, 2003" |
tell me the number of protestant quaker religious background patients who have been diagnosed with hydronephrosis. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND diagnoses.long_title = "Hydronephrosis" |
Who was the turbine manufacturer of the wind farm that started service on 2005? | CREATE TABLE table_24837750_1 (turbine_manufacturer VARCHAR,date_in_service VARCHAR) | SELECT turbine_manufacturer FROM table_24837750_1 WHERE date_in_service = "2005" |
Which are the classes that Dr. Megan Berkobien teaches next semester ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_fe... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Megan Berkobien%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... |
Can you tell me the lowest React that has the Lane of 5? | CREATE TABLE table_name_50 (react INTEGER,lane VARCHAR) | SELECT MIN(react) FROM table_name_50 WHERE lane = 5 |
Which Date has a Score of 102 113? | CREATE TABLE table_name_63 (date VARCHAR,score VARCHAR) | SELECT date FROM table_name_63 WHERE score = "102–113" |
What is the built data for number 34? | CREATE TABLE table_12113888_1 (built VARCHAR,number VARCHAR) | SELECT built FROM table_12113888_1 WHERE number = 34 |
What is the average number of goals of the player with 234 apps and a rank above 8? | CREATE TABLE table_name_13 (goals INTEGER,apps VARCHAR,rank VARCHAR) | SELECT AVG(goals) FROM table_name_13 WHERE apps = 234 AND rank < 8 |
What date did the opponent George Khrikadze play? | CREATE TABLE table_name_97 (date VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_97 WHERE opponent = "george khrikadze" |
what airlines fly from NEW YORK to MILWAUKEE to LOS ANGELES | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE date... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGEL... |
Which School has a Previous Conference of none (new school), and a Year Joined larger than 1960, and a Location of versailles? | CREATE TABLE table_name_78 (school VARCHAR,location VARCHAR,previous_conference VARCHAR,year_joined VARCHAR) | SELECT school FROM table_name_78 WHERE previous_conference = "none (new school)" AND year_joined > 1960 AND location = "versailles" |
How many rankings (timeslot) were there for the episode that aired on May 2, 2010? | CREATE TABLE table_26029 ("#" real,"Airdate" text,"Episode" text,"Rating" text,"Share" real,"Rating/Share (18\u201349)" text,"Viewers (millions)" text,"Rank (Timeslot)" real,"Rank (Night)" real) | SELECT COUNT("Rank (Timeslot)") FROM table_26029 WHERE "Airdate" = 'May 2, 2010' |
What competition did they have 1 lost, 3 draws, and played 9 games? | CREATE TABLE table_name_17 (competition VARCHAR,played VARCHAR,lost VARCHAR,drew VARCHAR) | SELECT competition FROM table_name_17 WHERE lost = "1" AND drew = "3" AND played = "9" |
find unanswered question of users with reputation lower than 102. find unanswered question of users with reputation lower than 102 | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,Co... | SELECT q.Id, q.Title, 'https://math.stackexchange.com/questions/' + CAST(q.Id AS TEXT(16)), q.Tags FROM Posts AS q INNER JOIN Users AS u ON u.Id = q.OwnerUserId WHERE u.Reputation < 102 AND q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL ORDER BY q.LastEditDate DESC |
what test did patient 3403 go through for the first time since 04/2105? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icust... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3403) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-04' ORDER BY labevents.charttime LIMIT 1) |
For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the headquarter , and group by attribute headquarter. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
What is the Background of the contestant with a Hometown listed as Los Angeles, California? | CREATE TABLE table_name_71 (background VARCHAR,hometown VARCHAR) | SELECT background FROM table_name_71 WHERE hometown = "los angeles, california" |
Which pick has marko makinen as the player? | CREATE TABLE table_4129 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Pick" FROM table_4129 WHERE "Player" = 'Marko Makinen' |
What was the outcome when the final score was 7 6(9), 7 6(1)? | CREATE TABLE table_2199290_2 (outcome VARCHAR,score_in_the_final VARCHAR) | SELECT outcome FROM table_2199290_2 WHERE score_in_the_final = "7–6(9), 7–6(1)" |
Which Record has a Team of philadelphia? | CREATE TABLE table_name_66 (record VARCHAR,team VARCHAR) | SELECT record FROM table_name_66 WHERE team = "philadelphia" |
What is the film title and inventory id of the item in the inventory which was rented most frequently? | CREATE TABLE payment (payment_id number,customer_id number,staff_id number,rental_id number,amount number,payment_date time,last_update time)CREATE TABLE rental (rental_id number,rental_date time,inventory_id number,customer_id number,return_date time,staff_id number,last_update time)CREATE TABLE city (city_id number,c... | SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1 |
Name the originl title for no stars in the jungle | CREATE TABLE table_20963074_1 (original_title VARCHAR,film_title_used_in_nomination VARCHAR) | SELECT original_title FROM table_20963074_1 WHERE film_title_used_in_nomination = "No Stars in the Jungle" |
What is the lowest number of uncommitted superdelegates for a state with more than 16 total and 2 for Hillary Clinton? | CREATE TABLE table_7236 ("State or territory" text,"Hillary Clinton" real,"Barack Obama" real,"Uncommitted" real,"Unassigned" real,"Total" real) | SELECT MIN("Uncommitted") FROM table_7236 WHERE "Total" > '16' AND "Hillary Clinton" = '2' |
What is the Date of Tie no 35 with a Score of 3 2? | CREATE TABLE table_name_78 (date VARCHAR,score VARCHAR,tie_no VARCHAR) | SELECT date FROM table_name_78 WHERE score = "3–2" AND tie_no = "35" |
What year was the Guernsey record of 2-3-12 set? | CREATE TABLE table_65233 ("Fish" text,"Guernsey Record" text,"Year" text,"Location" text,"British Record" text) | SELECT "Year" FROM table_65233 WHERE "Guernsey Record" = '2-3-12' |
What is the quantity made number for the quantity preserved 4-6-0 ooooo ten-wheeler? | CREATE TABLE table_name_65 (quantity_made VARCHAR,quantity_preserved VARCHAR) | SELECT quantity_made FROM table_name_65 WHERE quantity_preserved = "4-6-0 — ooooo — ten-wheeler" |
For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of code , and group by attribute headquarter, sort Y-axis from high to low order. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC |
What is the snatch for the person holding the Olympic record, and 173kg of 172kg? | CREATE TABLE table_64298 ("World record" text,"Snatch" text,"Sergey Filimonov (KAZ)" text,"173kg" text,"Almaty,Kazakhstan" text) | SELECT "Snatch" FROM table_64298 WHERE "World record" = 'olympic record' AND "173kg" = '172kg' |
What did the home team of essendon score? | CREATE TABLE table_77772 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_77772 WHERE "Home team" = 'essendon' |
In what region does 17.4% of the population make below 50% of the median income? | CREATE TABLE table_3209 ("Region" text,"Median income (Intl.$)" real,"Below 40% of median income" text,"Below 50% of median income" text,"Below 60% of median income" text) | SELECT "Region" FROM table_3209 WHERE "Below 50% of median income" = '17.4%' |
In the year where Angela Stanford had a scoring average of 71.62, how many times did she take second place? | CREATE TABLE table_14836185_3 (scoring_average VARCHAR) | SELECT COUNT(2 AS nd) FROM table_14836185_3 WHERE scoring_average = "71.62" |
since 6 years ago, what were the three most frequently performed procedures that the patients received after the diagnosis of acute bronchiolitis within 2 months? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute bronchiolitis' AND DATETIME(diagno... |
The wildcats belong to what school? | CREATE TABLE table_name_38 (school VARCHAR,team VARCHAR) | SELECT school FROM table_name_38 WHERE team = "wildcats" |
During the play-off quarter-final which team scored position was the team that scored 56 points? | CREATE TABLE table_77671 ("Season" text,"Div." text,"Pos." text,"Pld." text,"Pts." text,"Play-offs" text,"Trophy" text) | SELECT "Pos." FROM table_77671 WHERE "Play-offs" = 'quarter-final' AND "Pts." = '56' |
Can you tell me the lowest Losses that has the Gains smaller than 0? | CREATE TABLE table_48671 ("Party" text,"Seats (dissol.)" real,"Seats (2012)" real,"Gains" real,"Holds" real,"Losses" real,"Net change" text) | SELECT MIN("Losses") FROM table_48671 WHERE "Gains" < '0' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.