instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
how many united states competitors did not win medals ? | CREATE TABLE table_204_664 (id number,"rank" number,"bib" number,"name" text,"nationality" text,"start" text,"penalties (p+p+s+s)" text,"time" text,"deficit" text) | SELECT COUNT(*) FROM table_204_664 WHERE "nationality" = 'united states' AND NOT "rank" IS NULL |
Bar chart x axis sportname y axis the total number | CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))CREATE TABLE Spor... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName |
Did Jason Pennycooke win the award he was nominated for? | CREATE TABLE table_55029 ("Year" real,"Award" text,"Category" text,"Nominee" text,"Result" text) | SELECT "Result" FROM table_55029 WHERE "Nominee" = 'jason pennycooke' |
What was Jim Colbert's score? | CREATE TABLE table_47677 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_47677 WHERE "Player" = 'jim colbert' |
tell me the first procedure patient 029-7028 had last year? | 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 treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-7028')) AND DATETIME(treatment.treatmenttime, 'start of year'... |
Who has a license of proprietary (available on inquiry)? | CREATE TABLE table_54561 ("Name" text,"Current version" text,"System" text,"Platform" text,"License" text) | SELECT "Name" FROM table_54561 WHERE "License" = 'proprietary (available on inquiry)' |
What is the highest total for bronze with a gold larger than 0, a silver smaller than 5, and a total of 15? | CREATE TABLE table_45093 ("Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Bronze") FROM table_45093 WHERE "Gold" > '0' AND "Total" = '15' AND "Silver" < '5' |
In what Borough is the History Type Fairbanks Community Museum? | CREATE TABLE table_34537 ("Name" text,"Town/City" text,"Borough" text,"Region" text,"Type" text) | SELECT "Borough" FROM table_34537 WHERE "Type" = 'history' AND "Name" = 'fairbanks community museum' |
What is the College of the LB Player with Big Ten Conf.? | CREATE TABLE table_name_70 (college VARCHAR,pos VARCHAR,conf VARCHAR) | SELECT college FROM table_name_70 WHERE pos = "lb" AND conf = "big ten" |
How many bids were there for the .500 win percentage in the Ohio Valley conference? | CREATE TABLE table_32437 ("Conference" text,"# of Bids" real,"Record" text,"Win %" text,"Round of 32" text,"Sweet Sixteen" text,"Elite Eight" text,"Final Four" text,"Championship Game" text) | SELECT SUM("# of Bids") FROM table_32437 WHERE "Win %" = '.500' AND "Conference" = 'ohio valley' |
Name the country that has m ntt | CREATE TABLE table_54739 ("Date" real,"Country" text,"Place" text,"Building" text,"Size" text) | SELECT "Country" FROM table_54739 WHERE "Place" = 'mänttä' |
What was the pick number for the person from the United States who as drafted to the SF position from North Carolina? | CREATE TABLE table_name_78 (pick VARCHAR,position VARCHAR,nationality VARCHAR,college_high_school_club VARCHAR) | SELECT pick FROM table_name_78 WHERE nationality = "united states" AND college_high_school_club = "north carolina" AND position = "sf" |
what are the afternoon flights from ATLANTA to BALTIMORE | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTI... |
How many series premieres did the season 'All-stars' have? | CREATE TABLE table_2311410_1 (series_premiere VARCHAR,season VARCHAR) | SELECT COUNT(series_premiere) FROM table_2311410_1 WHERE season = "All-Stars" |
How many Times have a Reaction Time larger than 0.17500000000000002, and a Lane of 3? | CREATE TABLE table_name_62 (time VARCHAR,reaction_time VARCHAR,lane VARCHAR) | SELECT COUNT(time) FROM table_name_62 WHERE reaction_time > 0.17500000000000002 AND lane = 3 |
What package/option has documentaries as the content, yes as the HDTV, and a television service of history hd? | CREATE TABLE table_name_56 (package_option VARCHAR,television_service VARCHAR,content VARCHAR,hdtv VARCHAR) | SELECT package_option FROM table_name_56 WHERE content = "documentaries" AND hdtv = "yes" AND television_service = "history hd" |
When was the game played against Astley Bridge 'a'? | CREATE TABLE table_60102 ("Date" text,"Opponents" text,"H / A" text,"Result F \u2013 A" text,"Scorers" text) | SELECT "Date" FROM table_60102 WHERE "Opponents" = 'astley bridge ''a' |
How many laps for a grid of over 18 and retired due to electrical failure? | CREATE TABLE table_name_31 (laps INTEGER,grid VARCHAR,time_retired VARCHAR) | SELECT SUM(laps) FROM table_name_31 WHERE grid > 18 AND time_retired = "electrical" |
what is the sum of spartak when played is 102 and draw is less than 19? | CREATE TABLE table_65756 ("Competition" text,"Played" real,"Spartak" real,"Draw" real,"Dynamo" real) | SELECT SUM("Spartak") FROM table_65756 WHERE "Played" = '102' AND "Draw" < '19' |
What was the dominant religion in 2002 of the settlement with the cyrillic and other name of (romanian: voivodin )? | CREATE TABLE table_27885 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text) | SELECT "Dominant religion (2002)" FROM table_27885 WHERE "Cyrillic Name Other Names" = 'Војводинци (Romanian: Voivodinţ)' |
Create a bar chart showing school_id across all neutral, and rank by the School_ID from high to low. | 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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Neutral, School_ID FROM basketball_match ORDER BY School_ID DESC |
calculate the total number of patients who had sm bowel endoscopy nec | CREATE TABLE procedures (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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Sm bowel endoscopy NEC" |
Which division has no playoff but has a 12th game in their season? | CREATE TABLE table_32154 ("Year" text,"Division" real,"League" text,"Reg. Season" text,"Playoffs" text) | SELECT MAX("Division") FROM table_32154 WHERE "Playoffs" = 'no playoff' AND "Reg. Season" = '12th' |
What was the score for the game that attendance was 70,721? | CREATE TABLE table_62728 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_62728 WHERE "Attendance" = '70,721' |
Who was the pilot at lake dumbleyung? | CREATE TABLE table_50022 ("Speed" text,"Craft" text,"Pilot(s)" text,"Location" text,"Date" text) | SELECT "Pilot(s)" FROM table_50022 WHERE "Location" = 'lake dumbleyung' |
What is the number of points of the match with less than 22 games played? | CREATE TABLE table_60332 ("Position" real,"Club" text,"Games played" real,"Wins" real,"Draws" real,"Loses" real,"Goals scored" real,"Goals conceded" real,"Points" real) | SELECT COUNT("Points") FROM table_60332 WHERE "Games played" < '22' |
What is Gene Sauers' to par? | CREATE TABLE table_59521 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT "To par" FROM table_59521 WHERE "Player" = 'gene sauers' |
Out of the upper-level classes this Fall are any MCDB classes ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course (course_id int,name varchar,department varchar,numbe... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MCDB' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' ... |
how many countries had at least a gdp -lrb- usd bin -rrb- of eight or greater in 2012 ? | CREATE TABLE table_203_530 (id number,"country" text,"gdp (usd bln,2012)" number,"gdp (usd bln,2017)" number,"gdp (usd ppp bln,2012)" number,"gdp (usd ppp bln,2017)" number,"per capita (usd,2012)" number,"per capita (usd,2017)" number,"per capita (usd ppp,2012)" number,"per capita (usd ppp,2017)" number) | SELECT COUNT("country") FROM table_203_530 WHERE "gdp (usd bln, 2012)" >= 8 |
What were the points in the 1958-59 season? | CREATE TABLE table_24151 ("Season" text,"Games" real,"Won" real,"Lost" real,"Tied" real,"Points" real,"Pct %" text,"Goals For" real,"Goals Against" real,"Standing" text) | SELECT "Points" FROM table_24151 WHERE "Season" = '1958-59' |
What is the grid of driver tomas scheckter from vision racing team? | CREATE TABLE table_50659 ("Fin. Pos" text,"Car No." text,"Driver" text,"Team" text,"Laps" text,"Time/Retired" text,"Grid" text,"Laps Led" text,"Points" text) | SELECT "Grid" FROM table_50659 WHERE "Team" = 'vision racing' AND "Driver" = 'tomas scheckter' |
How many different writers have written the episode with series number 8? | CREATE TABLE table_23958944_2 (written_by VARCHAR,no_by_series VARCHAR) | SELECT COUNT(written_by) FROM table_23958944_2 WHERE no_by_series = 8 |
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of salary bin hire_date by time, and visualize them by a bar chart, and order y-axis in asc order. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0)... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) |
What was the production in 2005-06 for the commodity that produced 1,175 in 2001-02? | CREATE TABLE table_4577 ("Commodity" text,"2001-02" text,"2002-03" text,"2003-04" text,"2004-05" text,"2005-06" text,"2006-07" text) | SELECT "2005-06" FROM table_4577 WHERE "2001-02" = '1,175' |
What is the lowest Gold, when Silver is 0, and when Bronze is 2? | CREATE TABLE table_name_52 (gold INTEGER,silver VARCHAR,bronze VARCHAR) | SELECT MIN(gold) FROM table_name_52 WHERE silver = 0 AND bronze = 2 |
Show the number of brand from each brand, order total number in ascending order. | CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text) | SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand) |
Show the name of each party and the corresponding number of delegates from that party in a bar chart. | CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE county (County_Id int,Co... | SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party |
Who was the cover model in the 7-86 issue? | CREATE TABLE table_20218 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"20 Questions" text,"Pictorials" text) | SELECT "Cover model" FROM table_20218 WHERE "Date" = '7-86' |
What team does Lee Palmer play for? | CREATE TABLE table_1965650_10 (college_junior_club_team VARCHAR,player VARCHAR) | SELECT college_junior_club_team FROM table_1965650_10 WHERE player = "Lee Palmer" |
What is the sum of Total ranking 9 and a Gold more than 6 | CREATE TABLE table_7957 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Total") FROM table_7957 WHERE "Rank" = '9' AND "Gold" > '6' |
what are the flights from BOSTON to SAN FRANCISCO | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time i... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... |
What is total number of years that has genre of first-person shooter? | CREATE TABLE table_65243 ("Year" real,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text) | SELECT SUM("Year") FROM table_65243 WHERE "Genre" = 'first-person shooter' |
How many matches were drawn by the teams that won exactly 10? | CREATE TABLE table_27293285_6 (drawn VARCHAR,won VARCHAR) | SELECT COUNT(drawn) FROM table_27293285_6 WHERE won = "10" |
How many people attended the game that resulted in an away team score of 18.17 (125)? | CREATE TABLE table_54146 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT SUM("Crowd") FROM table_54146 WHERE "Away team score" = '18.17 (125)' |
how many patients whose insurance is government and lab test name is % hemoglobin a1c? | CREATE TABLE diagnoses (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 lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "% Hemoglobin A1c" |
Who are the players that played for the jazz from 1979-86 | CREATE TABLE table_11545282_4 (player VARCHAR,years_for_jazz VARCHAR) | SELECT player FROM table_11545282_4 WHERE years_for_jazz = "1979-86" |
A bar chart showing the average of capacity of cinemas open for each year, sort in asc by the names. | CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price... | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY Openning_year |
For those employees who did not have any job in the past, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday. | 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 HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
Who tied for highest rebounds in game 29? | CREATE TABLE table_25881 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_25881 WHERE "Game" = '29' |
Which season did not qualify for UEFA competitions? | CREATE TABLE table_37512 ("Season" text,"Competition" text,"Round" text,"Against" text,"Played" text,"Drew" text,"Lost" text,"Goals for" text,"Goals against" text) | SELECT "Season" FROM table_37512 WHERE "Against" = 'did not qualify for uefa competitions' |
What Species has the Species common name listed as human? | CREATE TABLE table_7845 ("Species" text,"Species common name" text,"NCBI Accession Number (mRNA/Protein)" text,"Length (bp/aa)" text,"Protein Identity" text) | SELECT "Species" FROM table_7845 WHERE "Species common name" = 'human' |
when did patient 73713 receive a prescription last month for the first time? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id nu... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate LIMIT 1 |
What is the total number of white (Hispanic/Non-Hispanic) having a black (Hispanic/Non-Hispanic) of 9.9 and Hispanic under 99.5? | CREATE TABLE table_63298 ("Municipality (2010)" text,"White (both Hispanic and Non-Hispanic)" real,"Black (Both Hispanic and Non-Hispanic)" real,"Amerindian (Both Hispanic and Non-Hispanic)" real,"n Asia (Both Hispanic and Non-Hispanic)" real,"Multiracial (Both Hispanic and Non-Hispanic)" real,"Hispanic (Of any Race)" ... | SELECT COUNT("White (both Hispanic and Non-Hispanic)") FROM table_63298 WHERE "Black (Both Hispanic and Non-Hispanic)" = '9.9' AND "Hispanic (Of any Race)" < '99.5' |
Who is the incumbent for the Oregon 5 District that was elected in 1996? | CREATE TABLE table_name_34 (incumbent VARCHAR,first_elected VARCHAR,district VARCHAR) | SELECT incumbent FROM table_name_34 WHERE first_elected = 1996 AND district = "oregon 5" |
What is the average year Rich Beem had a to par less than 17? | CREATE TABLE table_name_20 (year_won INTEGER,player VARCHAR,to_par VARCHAR) | SELECT AVG(year_won) FROM table_name_20 WHERE player = "rich beem" AND to_par < 17 |
What were the Runners-up prior to 1990 when Ivan Lendl was Champion in the Seiko Super Tennis Tournament? | CREATE TABLE table_name_80 (runners_up VARCHAR,year VARCHAR,champions VARCHAR,name_of_tournament VARCHAR) | SELECT runners_up FROM table_name_80 WHERE champions = "ivan lendl" AND name_of_tournament = "seiko super tennis" AND year < 1990 |
Find the name and component amount of the least popular furniture. | CREATE TABLE furniture (name VARCHAR,Num_of_Component VARCHAR,market_rate VARCHAR) | SELECT name, Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1 |
When populatioin is greater than 7,747 and the type is V, what is the sum of code? | CREATE TABLE table_52811 ("Code" real,"Type" text,"Name" text,"Area (km 2)" real,"Population" real,"Regional County Municipality" text,"Region" real) | SELECT COUNT("Code") FROM table_52811 WHERE "Type" = 'v' AND "Population" > '7,747' |
When did they play at the wachovia center? | CREATE TABLE table_62212 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text,"Streak" text) | SELECT "Date" FROM table_62212 WHERE "Location/Attendance" = 'wachovia center' |
What is the loss of the game with 38,062 folks in attendance? | CREATE TABLE table_name_12 (loss VARCHAR,attendance VARCHAR) | SELECT loss FROM table_name_12 WHERE attendance = "38,062" |
specific orbital energy of 29.8 mj/kg has what orbit? | CREATE TABLE table_37864 ("orbit" text,"center-to-center distance" text,"altitude above the Earth's surface" text,"Orbital period" text,"specific orbital energy" text) | SELECT "orbit" FROM table_37864 WHERE "specific orbital energy" = '−29.8 mj/kg' |
Who wrote episode 23 in the season? | CREATE TABLE table_27823359_1 (written_by VARCHAR,season__number VARCHAR) | SELECT written_by FROM table_27823359_1 WHERE season__number = "23" |
show me the flights from DENVER to PITTSBURGH and ATLANTA | CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE ground_service (ci... | SELECT DISTINCT flight.flight_id FROM 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 = 'ATLANTA' AND CITY_2.c... |
wWhich district has a retired republican hold with an incumbent of rufus p. spalding? | CREATE TABLE table_name_89 (district VARCHAR,result VARCHAR,incumbent VARCHAR) | SELECT district FROM table_name_89 WHERE result = "retired republican hold" AND incumbent = "rufus p. spalding" |
Show all countries and the number of people from each country. | CREATE TABLE people (country VARCHAR) | SELECT country, COUNT(*) FROM people GROUP BY country |
Who beat the Marlins with a score of 4-0? | CREATE TABLE table_name_68 (winning_team VARCHAR,losing_team VARCHAR,score VARCHAR) | SELECT winning_team FROM table_name_68 WHERE losing_team = "marlins" AND score = "4-0" |
what were the three most frequently prescribed drugs at the same time since 4 years ago for patients who were prescribed d5 1/4ns? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE icustays (row_id number,subject_id number,... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'd5 1/4ns' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRE... |
What is the name listed for the country that has a status of loaned and a moving to listed as leyton orient? | CREATE TABLE table_name_57 (name VARCHAR,status VARCHAR,moving_to VARCHAR) | SELECT name FROM table_name_57 WHERE status = "loaned" AND moving_to = "leyton orient" |
How big was the crowd for Essendon? | CREATE TABLE table_name_78 (crowd INTEGER,home_team VARCHAR) | SELECT SUM(crowd) FROM table_name_78 WHERE home_team = "essendon" |
The final score was 24-34 on what date? | CREATE TABLE table_69257 ("Week" real,"Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text) | SELECT "Date" FROM table_69257 WHERE "Final Score" = '24-34' |
What's part 1 of the verb whose part 4 is gevroren? | CREATE TABLE table_21703 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text) | SELECT "Part 1" FROM table_21703 WHERE "Part 4" = 'gevroren' |
give me the number of patients whose diagnoses short title is atrial fibrillation and procedure long title is other and unspecified coronary arteriography? | 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,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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.short_title = "Atrial fibrillation" AND procedures.long_title = "Other and unspecified coronary arteriography" |
What is Title, when Season is less than 1.8, and when First Broadcast is March 6, 1981? | CREATE TABLE table_48776 ("Title" text,"Season" real,"Director" text,"Teleplay" text,"First Broadcast" text) | SELECT "Title" FROM table_48776 WHERE "Season" < '1.8' AND "First Broadcast" = 'march 6, 1981' |
What are the smallest goals with a Goal Ratio of 0.14, and a Debut in Europe smaller than 1995? | CREATE TABLE table_name_20 (goals INTEGER,goal_ratio VARCHAR,debut_in_europe VARCHAR) | SELECT MIN(goals) FROM table_name_20 WHERE goal_ratio = 0.14 AND debut_in_europe < 1995 |
What is the highest evening gown with an average of 9.531 and swimsuit smaller than 9.449? | CREATE TABLE table_name_8 (evening_gown INTEGER,average VARCHAR,swimsuit VARCHAR) | SELECT MAX(evening_gown) FROM table_name_8 WHERE average = 9.531 AND swimsuit < 9.449 |
when was the last time patient 009-3149 was prescribed a medication in 09/this year via ng route? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid num... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-3149')) AND medication.routeadmin = 'ng' AND DATETIME(medi... |
Who was on the Prohibition ticket when Thomas Armstrong ran on the Greenback ticket? | CREATE TABLE table_42801 ("Office" text,"Democratic ticket" text,"Republican ticket" text,"Prohibition ticket" text,"Greenback ticket" text) | SELECT "Prohibition ticket" FROM table_42801 WHERE "Greenback ticket" = 'thomas armstrong' |
What is the smallest silver that has a bronze less than 0? | CREATE TABLE table_42743 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Silver") FROM table_42743 WHERE "Bronze" < '0' |
Which week was on october 30, 1983? | CREATE TABLE table_name_40 (week INTEGER,date VARCHAR) | SELECT SUM(week) FROM table_name_40 WHERE date = "october 30, 1983" |
Draw a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, display by the X from low to high. | 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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road |
Who is the designer of the Christmas: Winter Fun (USA) stamp? | CREATE TABLE table_368 ("Date of Issue" text,"Theme" text,"Denomination" text,"Design" text,"Illustration" text,"Printing Process" text,"Paper Type" text,"First Day Cover Cancellation" text) | SELECT "Design" FROM table_368 WHERE "Theme" = 'Christmas: Winter Fun (USA)' |
Which tournament had a performance of 1R in 2004 and 2R in 1998? | CREATE TABLE table_name_79 (tournament VARCHAR) | SELECT tournament FROM table_name_79 WHERE 2004 = "1r" AND 1998 = "2r" |
there is at least how many locations ? | CREATE TABLE table_204_185 (id number,"location" text,"town" text,"output (mw ac)" number,"modules" number,"number of arrays" number) | SELECT COUNT("location") FROM table_204_185 |
List all customer status codes and the number of customers having each status code in a bar chart, could you rank bar in descending order? | CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50))CREATE TABLE Vehicles (vehicle_id INTEGER,vehicle_details VARCHAR(255))CREATE TABLE Lessons (lesson_id INTEGER,customer_id INTEGER,lesson_status_c... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code DESC |
What are the first names of all employees that are professors ordered by date of birth, and count them by a bar chart | CREATE TABLE ENROLL (CLASS_CODE varchar(5),STU_NUM int,ENROLL_GRADE varchar(50))CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_IN... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM EMPLOYEE WHERE EMP_JOBCODE = 'PROF' GROUP BY EMP_FNAME ORDER BY EMP_DOB |
What was the percentage for K. Themistokleous when I. Kasoulidis was 30.1%? | CREATE TABLE table_name_65 (k_themistokleous VARCHAR,i_kasoulidis VARCHAR) | SELECT k_themistokleous FROM table_name_65 WHERE i_kasoulidis = "30.1%" |
When the value of 'since beginning of big 12' is synonymous with its' category, what are the in Ames values? | CREATE TABLE table_72095 ("Iowa State vs." text,"Overall Record" text,"in Ames" text,"at Opponents Venue" text,"at Neutral Site" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text,"Since Beginning of Big 12" text) | SELECT "in Ames" FROM table_72095 WHERE "Since Beginning of Big 12" = 'Since Beginning of Big 12' |
ACL papers with less than 5 citations | CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,key... | SELECT DISTINCT cite.citingpaperid FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) < 5 |
What was the date for the G1 group race at Flemington? | CREATE TABLE table_6401 ("Result" text,"Date" text,"Race" text,"Venue" text,"Group" text,"Distance" text,"Weight (kg)" real,"Time" text,"Jockey" text,"Winner/2nd" text) | SELECT "Date" FROM table_6401 WHERE "Group" = 'g1' AND "Venue" = 'flemington' |
insulin requirement > 1 u / kg / d. | CREATE TABLE table_train_240 ("id" int,"anemia" bool,"gender" string,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"estimated_glomerular_filtration_rate_egfr" int,"diastolic_blood_pressure_dbp" int,"insulin_requirement" float,"kidney_disease" bool,"body_mass_index_bmi" float,"hypertension" bool,"NOUSE"... | SELECT * FROM table_train_240 WHERE insulin_requirement > 1 |
What is the topic of the episode that runs 6:07? | CREATE TABLE table_33700 ("Episode Number" real,"Title" text,"Podcast Date" text,"Run time" text,"Historical References" text) | SELECT "Historical References" FROM table_33700 WHERE "Run time" = '6:07' |
i need a flight from SALT LAKE CITY to PHOENIX departing wednesday after 1700 | CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required var... | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1700 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa... |
Which Title has a Songwriter(s) of hadise a kg z, stefaan fernande, elio deepcore? | CREATE TABLE table_name_72 (title VARCHAR,songwriter_s_ VARCHAR) | SELECT title FROM table_name_72 WHERE songwriter_s_ = "hadise açıkgöz, stefaan fernande, elio deepcore" |
Visualize a bar chart for how many students are in each department?, and show in descending by the names. | CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE teaches (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0))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))CRE... | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY dept_name DESC |
What is the 2010 result of a tournament that is 1R in 2009, Q2 in 2011 and 1R in 2012? | CREATE TABLE table_name_43 (Id VARCHAR) | SELECT 2010 FROM table_name_43 WHERE 2011 = "q2" AND 2012 = "1r" AND 2009 = "1r" |
what is the number of interferometers that use wavebands r ? | CREATE TABLE table_203_279 (id number,"interferometer and observing mode" text,"waveband" text,"limiting magnitude" number,"minimum baseline (m)\n(un-projected)" number,"maximum baseline (m)" number,"approx. no. visibility measurements per year\n(measurements per night x nights used per year)" number,"max ratio of no. ... | SELECT COUNT("interferometer and observing mode") FROM table_203_279 WHERE "waveband" = 'r' |
count the number of patients whose admission type is urgent and procedure short title is percutaneous liver aspiration. | 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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Percutan liver aspirat" |
What's Salem State University's primary conference? | CREATE TABLE table_1974545_2 (primary_conference VARCHAR,institution VARCHAR) | SELECT primary_conference FROM table_1974545_2 WHERE institution = "Salem State University" |
What does the basic stem (root) -rama- mean? | CREATE TABLE table_557 ("Basic stem (root)" text,"Present stem" text,"Non-present stem" text,"Participle" text,"Verbal noun" text,"Short stem" text,"Meaning" text) | SELECT "Meaning" FROM table_557 WHERE "Basic stem (root)" = '-rama-' |
Get old unanswered questions from users with recent activity. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Badges (Id number,UserId number,N... | SELECT question.Id AS "post_link" FROM Posts AS question |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.