instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Visualize a bar chart for how many students are older than average for each gender?, list by the the total number from high to low. | CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))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 Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEG... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY COUNT(*) DESC |
Where did South Melbourne play as the home team? | CREATE TABLE table_name_72 (venue VARCHAR,home_team VARCHAR) | SELECT venue FROM table_name_72 WHERE home_team = "south melbourne" |
What is the smallest crowd when the away team scored 10.18 (78)? | CREATE TABLE table_58136 ("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_58136 WHERE "Away team score" = '10.18 (78)' |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and I want to rank y-axis in desc order please. | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC |
show me the flights from BOSTON to OAKLAND | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer va... | 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 = 'OAKLAND... |
Who was the winner of stage 12? | CREATE TABLE table_32624 ("Stage" text,"Date" text,"Route" text,"Terrain" text,"Length" text,"Winner" text) | SELECT "Winner" FROM table_32624 WHERE "Stage" = '12' |
what was the name of episode 5? | CREATE TABLE table_26565917_2 (title VARCHAR,no_in_season VARCHAR) | SELECT title FROM table_26565917_2 WHERE no_in_season = 5 |
What is Score, when Date is May 7, 2006? | CREATE TABLE table_7948 ("Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponents in the final" text,"Score" text) | SELECT "Score" FROM table_7948 WHERE "Date" = 'may 7, 2006' |
what's the report with location sterreichring | CREATE TABLE table_1140080_2 (report VARCHAR,location VARCHAR) | SELECT report FROM table_1140080_2 WHERE location = "Österreichring" |
what are the percentile of 83.0 in a glucose lab test given the same age of patient 42473 during their current hospital visit? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id numb... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age =... |
how many laps did tony stewart race in 2012 ? | CREATE TABLE table_204_604 (id number,"year" number,"date" text,"driver" text,"team" text,"manufacturer" text,"race distance\nlaps" number,"race distance\nmiles (km)" text,"race time" text,"average speed\n(mph)" number,"report" text) | SELECT "race distance\nlaps" FROM table_204_604 WHERE "driver" = 'tony stewart' |
Which Avg/G has a Name of david allen, and a Gain larger than 371? | CREATE TABLE table_77058 ("Name" text,"Gain" real,"Loss" real,"Long" real,"Avg/G" real) | SELECT AVG("Avg/G") FROM table_77058 WHERE "Name" = 'david allen' AND "Gain" > '371' |
What was the time in part 3 when Nick Heidfeld was the driver? | CREATE TABLE table_2234 ("Pos" text,"No" text,"Driver" text,"Constructor" text,"Part 1" text,"Part 2" text,"Part 3" text,"Grid" text) | SELECT "Part 3" FROM table_2234 WHERE "Driver" = 'Nick Heidfeld' |
when was first time patient 5142 was measured with a arterial bp [systolic] greater than 144.0 on last month/03? | 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 number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE procedures_icd (row_id numbe... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5142)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... |
What is the Opponent with a Round with 3, and a Venue of home? | CREATE TABLE table_name_24 (opponent VARCHAR,round VARCHAR,venue VARCHAR) | SELECT opponent FROM table_name_24 WHERE round = "3" AND venue = "home" |
Name the number of ends lost for 6 stolen ends | CREATE TABLE table_26745426_2 (Ends VARCHAR,stolen_ends VARCHAR) | SELECT COUNT(Ends) AS lost FROM table_26745426_2 WHERE stolen_ends = 6 |
What date was Bury the home team? | CREATE TABLE table_44397 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Date" FROM table_44397 WHERE "Away team" = 'bury' |
What is the Flattening ratio associated with the Equatorial diameter of 120,536km? | CREATE TABLE table_name_75 (flattening_ratio VARCHAR,equatorial_diameter VARCHAR) | SELECT flattening_ratio FROM table_name_75 WHERE equatorial_diameter = "120,536km" |
List the number of the description of the outcomes for all projects, and show by the X-axis in ascending. | CREATE TABLE Organisation_Types (organisation_type VARCHAR(10),organisation_type_description VARCHAR(255))CREATE TABLE Project_Staff (staff_id DOUBLE,project_id INTEGER,role_code VARCHAR(10),date_from DATETIME,date_to DATETIME,other_details VARCHAR(255))CREATE TABLE Research_Outcomes (outcome_code VARCHAR(10),outcome_d... | SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description |
What is the newest Season in which had 0 Podiums, and having 1 total of Races, as well as total wins larger than 0? | CREATE TABLE table_name_65 (season INTEGER,wins VARCHAR,podiums VARCHAR,races VARCHAR) | SELECT MAX(season) FROM table_name_65 WHERE podiums = 0 AND races = 1 AND wins > 0 |
who was the next highest scorer after max twigg ? | CREATE TABLE table_203_854 (id number,"position" number,"driver" text,"no." text,"car" text,"entrant" text,"rd 1" number,"rd 2" number,"rd 3" number,"rd 4" number,"rd 5" number,"rd 6" number,"rd 7" number,"rd 8" number,"total" number) | SELECT "driver" FROM table_203_854 WHERE "total" < (SELECT "total" FROM table_203_854 WHERE "driver" = 'max twigg') ORDER BY "total" DESC LIMIT 1 |
Type of stratovolcano, and a Name of goat rocks, and a Elevation (m) larger than 2,494 has what highest elevation in feet? | CREATE TABLE table_name_40 (elevation__ft_ INTEGER,elevation__m_ VARCHAR,type VARCHAR,name VARCHAR) | SELECT MAX(elevation__ft_) FROM table_name_40 WHERE type = "stratovolcano" AND name = "goat rocks" AND elevation__m_ > 2 OFFSET 494 |
What Scores by each individual judge has a Status of current, and a Co-contestant (Yaar vs. Pyaar) of krushna abhishek? | CREATE TABLE table_12298 ("Main contestant" text,"Co-contestant (Yaar vs. Pyaar)" text,"Date performed" text,"Scores by each individual judge" text,"Total score/week" text,"Position" text,"Status" text) | SELECT "Scores by each individual judge" FROM table_12298 WHERE "Status" = 'current' AND "Co-contestant (Yaar vs. Pyaar)" = 'krushna abhishek' |
List all number of yards with an AST of 8. | CREATE TABLE table_18015 ("Name" text,"GP" real,"Solo" real,"Ast" real,"Total" real,"TFL-Yds" text,"No-Yds" text,"BrUp" real,"QBH" real,"No.-Yds" text,"Avg" text,"TD" real,"Long" real,"Rcv-Yds" text,"FF" real,"Blkd Kick" real) | SELECT "No-Yds" FROM table_18015 WHERE "Ast" = '8' |
Show the total number from each type, and order y axis in ascending order. | CREATE TABLE festival_detail (Festival_ID int,Festival_Name text,Chair_Name text,Location text,Year int,Num_of_Audience int)CREATE TABLE artwork (Artwork_ID int,Type text,Name text)CREATE TABLE nomination (Artwork_ID int,Festival_ID int,Result text) | SELECT Type, COUNT(*) FROM artwork GROUP BY Type ORDER BY COUNT(*) |
Name the land where geo id is 3807717980 | CREATE TABLE table_1918 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" text,"Water (sqmi)" text,"Latitude" text,"Longitude" text,"GEO ID" real,"ANSI code" real) | SELECT "Land ( sqmi )" FROM table_1918 WHERE "GEO ID" = '3807717980' |
What is the service chage of the boat howitzers with a 12-pdr light destination? | CREATE TABLE table_35342 ("Designation" text,"Bore" text,"Weight" text,"Service Charge" text,"Range (yards)" text,"Number Made" real) | SELECT "Service Charge" FROM table_35342 WHERE "Designation" = '12-pdr light' |
What is the smallest number of assists for Ben Duggan with less than 7 points? | CREATE TABLE table_name_17 (assists INTEGER,name VARCHAR,points VARCHAR) | SELECT MIN(assists) FROM table_name_17 WHERE name = "ben duggan" AND points < 7 |
What was the city whose stadium is Gerald J. Ford Stadium? | CREATE TABLE table_28719193_19 (city VARCHAR,stadium VARCHAR) | SELECT city FROM table_28719193_19 WHERE stadium = "Gerald J. Ford stadium" |
What is the production code when the u.s. viewers (million) is 11.76? | CREATE TABLE table_26702204_1 (production_code VARCHAR,us_viewers__million_ VARCHAR) | SELECT production_code FROM table_26702204_1 WHERE us_viewers__million_ = "11.76" |
What is the total of the team with a T score greater than 8 and an E score less than 8.4? | CREATE TABLE table_39233 ("Nation" text,"T Score" real,"A Score" real,"E Score" real,"Total" real) | SELECT SUM("Total") FROM table_39233 WHERE "T Score" > '8' AND "E Score" < '8.4' |
Compare all train names' total numbers. | CREATE TABLE route (train_id int,station_id int)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,l... | SELECT name, COUNT(name) FROM train GROUP BY name |
a diagnosis of alzheimer's's disease ( nincds _ adrda criterion ) , and mini _ mental status examination ( mmse ) score between > / = 18 and < / = 26 | CREATE TABLE table_train_142 ("id" int,"allergy_to_monoclonal_antibodies" bool,"allergic_reactions" bool,"allergy_to_methylprednisolone" bool,"mini_mental_state_examination_mmse" int,"depressed_mood" bool,"urea_cycle_disorder" bool,"clinical_contraindication_use_valproate" bool,"hypersensitivity" bool,"allergy_to_diphe... | SELECT * FROM table_train_142 WHERE alzheimer_disease_ad = 1 AND (mini_mental_state_examination_mmse >= 18 AND mini_mental_state_examination_mmse <= 26) |
since 2102, has patient 19352 been diagnosed with any illness? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)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 outputevents (row_id number,subject_id number,hadm_id n... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19352) AND STRFTIME('%y', diagnoses_icd.charttime) >= '2102' |
how many height m ( ft ) with notes being via wccv; formerly w236aj | CREATE TABLE table_13998897_1 (height_m___ft__ VARCHAR,notes VARCHAR) | SELECT COUNT(height_m___ft__) FROM table_13998897_1 WHERE notes = "via WCCV; formerly W236AJ" |
Name the old bulgarian names for yanuari | CREATE TABLE table_19977 ("No." real,"English name" text,"Bulgarian name" text,"Bulgarian name (Transliteration)" text,"Old Bulgarian Names" text,"Old Bulgarian name (Transliteration)" text,"Old Bulgarian name - Meaning" text) | SELECT "Old Bulgarian Names" FROM table_19977 WHERE "Bulgarian name ( Transliteration )" = 'Yanuari' |
What stroke has a max power of 109 ps(80kw)@4000 rpm? | CREATE TABLE table_35995 ("Code" text,"Vehicle" text,"Year" text,"Displacement" text,"Bore" text,"Stroke" text,"C.R." text,"Max. Power" text) | SELECT "Stroke" FROM table_35995 WHERE "Max. Power" = '109 ps(80kw)@4000 rpm' |
How many upvotes do I have for each tag? (Wiki & Non-Wiki). how long before I get tag badges? | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUser... | SELECT TagName, SUM(CASE WHEN Posts.CommunityOwnedDate IS NULL OR Votes.CreationDate < Posts.CommunityOwnedDate THEN 1 ELSE 0 END) AS NonWikiUpvotes, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Post... |
How big was the crowd when Richmond was the away team? | CREATE TABLE table_53293 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Crowd" FROM table_53293 WHERE "Away team" = 'richmond' |
How many writers for the episode 'peace, brother'? | CREATE TABLE table_29295 ("Episode No. Episode No. refers to the episodes number in the overall series,whereas Series No. refers to the episodes number in this particular series." real,"Series No." real,"Episode" text,"Director" text,"Writer(s)" text,"Original airdate" text) | SELECT COUNT("Writer(s)") FROM table_29295 WHERE "Episode" = 'Peace, Brother' |
which year had the most credits ? | CREATE TABLE table_201_36 (id number,"year" number,"title" text,"role" text,"notes" text) | SELECT "year" FROM table_201_36 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1 |
Where did Hawthorn play as the away team? | CREATE TABLE table_4684 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_4684 WHERE "Away team" = 'hawthorn' |
Name the record for june 7 | CREATE TABLE table_21315 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "Record" FROM table_21315 WHERE "Date" = 'June 7' |
How much did the Hydra team from Bronx, New York raise? | CREATE TABLE table_14620 ("Celebrity" text,"Background" text,"Original Team" text,"Hometown" text,"Result" text,"Raised" text) | SELECT "Raised" FROM table_14620 WHERE "Original Team" = 'hydra' AND "Hometown" = 'bronx, new york' |
Who was the away team for the game with a score of 139-119? | CREATE TABLE table_name_75 (away_team VARCHAR,score VARCHAR) | SELECT away_team FROM table_name_75 WHERE score = "139-119" |
Deloria & Boas of n included what university of Minnesota? | CREATE TABLE table_6743 ("Buechel & Manhart spelling (pronunciation)" text,"Ullrich" text,"Brandon University" text,"Deloria & Boas" text,"Dakota Mission" text,"Rood & Taylor" text,"Riggs" text,"Williamson" text,"University of Minnesota" text,"White Hat" text) | SELECT "University of Minnesota" FROM table_6743 WHERE "Deloria & Boas" = 'n' |
What denominations are the stamps with themes opera, l opold simoneau and pierrette alarie? | CREATE TABLE table_11900773_4 (denomination VARCHAR,theme VARCHAR) | SELECT denomination FROM table_11900773_4 WHERE theme = "Opera, Léopold Simoneau and Pierrette Alarie" |
A line chart for what are the number of the distinct visit dates?, rank by the X in ascending please. | CREATE TABLE Photos (Photo_ID INTEGER,Tourist_Attraction_ID INTEGER,Name VARCHAR(255),Description VARCHAR(255),Filename VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Hotels (hotel_id INTEGER,star_rating_code CHAR(15),pets_allowed_yn CHAR(1),price_range real,other_hotel_details VARCHAR(255))CREATE TABLE Tourist_A... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY Visit_Date |
How many bronzes did netherlands win? | CREATE TABLE table_name_9 (bronze VARCHAR,nation VARCHAR) | SELECT bronze FROM table_name_9 WHERE nation = "netherlands" |
When was the school in Salem, Massachusetts located? | CREATE TABLE table_23259 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Primary Conference" text,"LEC Sport" text) | SELECT "Founded" FROM table_23259 WHERE "Location" = 'Salem, Massachusetts' |
What is the Lead for the 1999 00 season? | CREATE TABLE table_41281 ("Season" text,"Skip" text,"Third" text,"Second" text,"Lead" text) | SELECT "Lead" FROM table_41281 WHERE "Season" = '1999–00' |
What is the series number for the episode with production code bdf109? | CREATE TABLE table_28019988_2 (series__number VARCHAR,production_code VARCHAR) | SELECT series__number FROM table_28019988_2 WHERE production_code = "BDF109" |
when was the last time patient 030-58018 has been diagnosed with malignancy - cancer with metastases to the lung until 1 year ago? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,pat... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-58018')) AND diagnosis.diagnosisname = 'malignancy - cancer w... |
show me the flights available from ATLANTA to BALTIMORE leaving ATLANTA in the morning | 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 flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number ... | 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... |
did patient 027-136480 in 07/this year receive a peak airway/pressure lab test? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid ... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480')) AND lab.labname = 'peak airway/pressure' AND DATETIME(lab.labresulttime, '... |
What is the lowest lane for Nigeria, with a react less than 0.133? | CREATE TABLE table_name_17 (lane INTEGER,country VARCHAR,react VARCHAR) | SELECT MIN(lane) FROM table_name_17 WHERE country = "nigeria" AND react < 0.133 |
how much does it cost to take a drug called furosemide 20 mg po tabs? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'furosemide 20 mg po tabs') |
what was the first time that the sao2 of patient 017-9785 was, , greater than 88.0? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-9785')) AND vitalperiodic.sao2 > 88.0 AND NOT v... |
Which incumbent was first elected in 1958? | CREATE TABLE table_18228 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Incumbent" FROM table_18228 WHERE "First elected" = '1958' |
Which person has a bodyweight of 73.6? | CREATE TABLE table_name_15 (name VARCHAR,bodyweight VARCHAR) | SELECT name FROM table_name_15 WHERE bodyweight = 73.6 |
What is the date that the item was laid down if it was launched on 1899-04-25? | CREATE TABLE table_33842 ("Kanji" text,"Name (Translation)" text,"Builder" text,"Laid down" text,"Launched" text,"Completed" text) | SELECT "Laid down" FROM table_33842 WHERE "Launched" = '1899-04-25' |
Name the ICAO for IATA of ccu | CREATE TABLE table_68856 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "ICAO" FROM table_68856 WHERE "IATA" = 'ccu' |
Find the number of employees we have. | CREATE TABLE roles (role_code text,role_name text,role_description text)CREATE TABLE employees (employee_id number,role_code text,employee_name text,gender_mfu text,date_of_birth time,other_details text)CREATE TABLE ref_document_types (document_type_code text,document_type_name text,document_type_description text)CREAT... | SELECT COUNT(*) FROM employees |
Who were the candidates in the district won by the incumbent Del Latta? | CREATE TABLE table_1341690_35 (candidates VARCHAR,incumbent VARCHAR) | SELECT candidates FROM table_1341690_35 WHERE incumbent = "Del Latta" |
Where was the final game played in 2007 | CREATE TABLE table_11214772_2 (location VARCHAR,year VARCHAR) | SELECT location FROM table_11214772_2 WHERE year = 2007 |
For each year, bin the year into day of the week interval, and return the total number of times the team Boston Red Stockings won in the postseasons using a line chart, sort by the x axis in desc. | CREATE TABLE home_game (year INTEGER,league_id TEXT,team_id TEXT,park_id TEXT,span_first TEXT,span_last TEXT,games INTEGER,openings INTEGER,attendance INTEGER)CREATE TABLE college (college_id TEXT,name_full TEXT,city TEXT,state TEXT,country TEXT)CREATE TABLE team_franchise (franchise_id TEXT,franchise_name TEXT,active ... | SELECT year, SUM(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC |
WHAT SAN PAULO CAREER HAD SMALLER THAN 201 APPEARANCES, SMALLER THAN 2 GOALS, AND FOR RICARDO ROCHA? | CREATE TABLE table_49015 ("Name" text,"Nationality" text,"Position" text,"S\u00e3o Paulo career" text,"Appearances" real,"Goals" real) | SELECT "S\u00e3o Paulo career" FROM table_49015 WHERE "Appearances" < '201' AND "Goals" < '2' AND "Name" = 'ricardo rocha' |
How many goals did the player with 229 club apps have? | CREATE TABLE table_58183 ("Nationality" text,"Position" text,"Tottenham Hotspur career" text,"Club Apps" text,"Goals" text) | SELECT "Goals" FROM table_58183 WHERE "Club Apps" = '229' |
Which points has place smaller than 2? | CREATE TABLE table_64103 ("Draw" real,"Language" text,"Artist" text,"Song" text,"English translation" text,"Place" real,"Points" real) | SELECT "Points" FROM table_64103 WHERE "Place" < '2' |
How many points after 1960 for fred tuck cars? | CREATE TABLE table_name_80 (points INTEGER,entrant VARCHAR,year VARCHAR) | SELECT MAX(points) FROM table_name_80 WHERE entrant = "fred tuck cars" AND year > 1960 |
Who were the writers of episode 20? | CREATE TABLE table_2263 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT "Written by" FROM table_2263 WHERE "No. in season" = '20' |
the last time patient 013-29301 was prescribed protonix and zofran at the same time in 08/this year? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultur... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'zofran' AND patient.uniquepid = '013-29301' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TI... |
how long were employees of nynex on strike ? | CREATE TABLE table_203_759 (id number,"year" number,"company" text,"number of members affected" number,"duration of strike" text,"notes" text) | SELECT "duration of strike" FROM table_203_759 WHERE "company" = 'nynex' |
Who was the opponent with a series of 1-0? | CREATE TABLE table_14901 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Series" text) | SELECT "Opponent" FROM table_14901 WHERE "Series" = '1-0' |
what is the number of series where the airdate is december 26, 1964? | CREATE TABLE table_25800134_9 (series__number VARCHAR,airdate VARCHAR) | SELECT COUNT(series__number) FROM table_25800134_9 WHERE airdate = "December 26, 1964" |
Which player was drafted by the New York Rangers? | CREATE TABLE table_2850912_10 (player VARCHAR,nhl_team VARCHAR) | SELECT player FROM table_2850912_10 WHERE nhl_team = "New York Rangers" |
Give the Finish for a Stage that is larger than 15 | CREATE TABLE table_name_44 (finish VARCHAR,stage INTEGER) | SELECT finish FROM table_name_44 WHERE stage > 15 |
Search for keyword within a tag. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Cl... | SELECT p.Id, p.Title, p.ViewCount FROM Posts AS p INNER JOIN Tags AS t ON t.TagName = '##TagName##' INNER JOIN PostTags AS pt ON pt.PostId = p.Id AND pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.Body LIKE '%##SearchTerm##%' OR p.Title LIKE '%##SearchTerm##%' ORDER BY p.CreationDate DESC |
For those employees whose first name is ending with the letter m, visualize a bar chart to show each employee's salary by the last name, and display from low to high by the x axis 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 departments (DEPARTMENT_ID decimal(4,... | SELECT LAST_NAME, SALARY FROM employees WHERE FIRST_NAME LIKE '%m' ORDER BY LAST_NAME |
Which League Cup goals have a Scorer of ken houghton, and an FA Cup goals smaller than 0? | CREATE TABLE table_9697 ("Scorer" text,"Club" text,"League goals" text,"FA Cup goals" real,"League Cup goals" real,"Total" real) | SELECT MAX("League Cup goals") FROM table_9697 WHERE "Scorer" = 'ken houghton' AND "FA Cup goals" < '0' |
what is the average age of patients who are discharged due to home health care and diagnosed with primary disease gastrointestinal bleed? | 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 AVG(demographic.age) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.diagnosis = "GASTROINTESTINAL BLEED" |
Post Metrics Over Year and Month. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,Las... | SELECT TIME_TO_STR(P.CreationDate, '%YEAR') AS PostYear, TIME_TO_STR(P.CreationDate, '%-mONT%-H') AS PostMonth, COUNT(*) AS Posts, SUM(AnswerCount) AS AnswerSum, SUM(CommentCount) AS CommentSum, MIN(FavoriteCount) AS FavoriteMin, AVG(FavoriteCount) AS FavoriteAvg, MAX(FavoriteCount) AS FavoriteMax, SUM(FavoriteCount) A... |
What is the Score for the Game less than 21, and of antonio davis (12)had the High rebounds? | CREATE TABLE table_name_87 (score VARCHAR,game VARCHAR,high_rebounds VARCHAR) | SELECT score FROM table_name_87 WHERE game < 21 AND high_rebounds = "antonio davis (12)" |
Name the high rebounds for american airlines center 20,557 | CREATE TABLE table_23284271_11 (high_rebounds VARCHAR,location_attendance VARCHAR) | SELECT high_rebounds FROM table_23284271_11 WHERE location_attendance = "American Airlines Center 20,557" |
What electives are offered for CS majors that are upper level ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
What is the runner-up record where winner record is Ireland 59 points? | CREATE TABLE table_28601467_1 (runner_up VARCHAR,winner VARCHAR) | SELECT runner_up FROM table_28601467_1 WHERE winner = "Ireland 59 points" |
how many times did they rank below 8th place ? | CREATE TABLE table_203_715 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT COUNT(*) FROM table_203_715 WHERE "position" > 8 |
Can I take ENVIRON 102 for PreMajor ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREAT... | SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'ENVIRON' AND course.number = 102 AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
What date was the score 29-7? | CREATE TABLE table_name_28 (date VARCHAR,score VARCHAR) | SELECT date FROM table_name_28 WHERE score = "29-7" |
What school is located in Michigan City? | CREATE TABLE table_37447 ("School" text,"Mascot" text,"Location" text,"Enrollment" real,"IHSAA Class" text,"IHSAA Football Class" text,"County" text) | SELECT "School" FROM table_37447 WHERE "Location" = 'michigan city' |
Progress towards Favorite Question and Stellar Question badges. Questions need to be favorited 25 times for Favorite Question nad 100 times for Stellar Question | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,Creati... | SELECT Id AS "post_link", FavoriteCount, CAST(CAST(CAST(FavoriteCount AS FLOAT) * 4 AS INT) AS TEXT(3)) + '%' AS Favorite, CAST(FavoriteCount AS TEXT(3)) + '%' AS Stellar FROM Posts WHERE PostTypeId = 1 AND FavoriteCount > 0 ORDER BY FavoriteCount DESC LIMIT 500 |
Tell me about my question!. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostI... | SELECT * FROM Posts |
give me the number of patients whose admission type is urgent and procedure long title is insertion of one vascular stent? | 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 demographic (subject_id text,hadm_id t... | 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.long_title = "Insertion of one vascular stent" |
What is the venue of Fracture of acrylic bone cement ? | CREATE TABLE field (fieldid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABL... | SELECT DISTINCT venueid FROM paper WHERE title = 'Fracture of acrylic bone cement' |
What is the average 1st place with a Rank that is larger than 10? | CREATE TABLE table_41161 ("Rank" real,"Country" text,"1st place" real,"2nd place" real,"3rd place" real,"Total" real) | SELECT AVG("1st place") FROM table_41161 WHERE "Rank" > '10' |
when was patient 3929 for the first time prescribed a drug via ou route until 01/2105? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 inputevents_cv (row_... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929) AND prescriptions.route = 'ou' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-01' ORDER BY prescriptions.startdate LIMIT 1 |
Which ICAO has a Province of heilongjiang, and a IATA of jmu? | CREATE TABLE table_10069 ("City" text,"Province" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "ICAO" FROM table_10069 WHERE "Province" = 'heilongjiang' AND "IATA" = 'jmu' |
Who was second runner up when Janina San Miguel won Binibining Pilipinas-World? | CREATE TABLE table_1825751_4 (second_runner_up VARCHAR,binibining_pilipinas_world VARCHAR) | SELECT second_runner_up FROM table_1825751_4 WHERE binibining_pilipinas_world = "Janina San Miguel" |
What is the name of the position of the person whose hometown is Queens, NY? | CREATE TABLE table_name_45 (position VARCHAR,hometown VARCHAR) | SELECT position FROM table_name_45 WHERE hometown = "queens, ny" |
Which Virtue has a (vice) of lust? | CREATE TABLE table_36359 ("Virtue" text,"Latin" text,"Gloss" text,"(Vice)" text,"(Latin)" text) | SELECT "Virtue" FROM table_36359 WHERE "(Vice)" = 'lust' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.