context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_564 ( id number, "devanagari" text, "iso 15919" text, "unrsgn" text, "iast" text, "comment" text )
what iast is listed before the o ?
SELECT "iast" FROM table_204_564 WHERE id = (SELECT id FROM table_204_564 WHERE "iast" = 'o') - 1
squall
CREATE TABLE table_57657 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the time/retired for grid 5?
SELECT "Time/Retired" FROM table_57657 WHERE "Grid" = '5'
wikisql
CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARCHAR(255) ) CREATE TABLE Research_Staff ( staff_id INTEGER, employer_organisation_id INTEGER, staff_details VARCHAR(255) ) CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10), organisation_typ...
Find the organisation ids and details of the organisations which are involved i Plot them as bar chart, and list from low to high by the Y.
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_id
nvbench
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
show me one way flights from TAMPA to ST. LOUIS departing before 1000
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, fare, flight, flight_fare WHERE ((fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.fare_id AND flight.departure_time < 1000 AND flight.flight_id = flight_fare.f...
atis
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...
Give me a bar chart for total number of capacity of each openning year, and show by the Y-axis in ascending.
SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY SUM(Capacity)
nvbench
CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE time_slot ( time_slot_id text, da...
Count the number of distinct instructors who have taught a course.
SELECT COUNT(DISTINCT id) FROM teaches
spider
CREATE TABLE table_42586 ( "Average population (x 1,000)" text, "Live births" text, "Deaths" text, "Natural change" text, "Migration" text, "Crude birth rate (per 1,000)" real, "Crude death rate (per 1,000)" real, "Natural change (per 1,000)" real, "Migration (per 1,000)" real )
How many Crude death rate (per 1,000) has a Migration (per 1,000) larger than -5.06, and a Natural change (per 1,000) larger than 7.06? Question 1
SELECT AVG("Crude death rate (per 1,000)") FROM table_42586 WHERE "Migration (per 1,000)" > '-5.06' AND "Natural change (per 1,000)" > '7.06'
wikisql
CREATE TABLE city ( City_ID int, City text, Hanzi text, Hanyu_Pinyin text, Regional_Population int, GDP real ) CREATE TABLE match ( Match_ID int, Date text, Venue text, Score text, Result text, Competition text ) CREATE TABLE temperature ( City_ID int, Jan real,...
For each competition, count the number of matches, and show from low to high by the the total number .
SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY COUNT(*)
nvbench
CREATE TABLE table_1983 ( "Name" text, "Home or representative town or province" text, "Age" real, "Season" text, "Total days in PBB House" real, "Duration" text, "Status" text )
When nel rapiz is the name what is the status?
SELECT "Status" FROM table_1983 WHERE "Name" = 'Nel Rapiz'
wikisql
CREATE TABLE table_56334 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
How many goals against were scored when the goals for is less than 48 with 0 ties?
SELECT COUNT("Goals Against") FROM table_56334 WHERE "Goals For" < '48' AND "Ties" < '0'
wikisql
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 prescriptions ( subject_id text, hadm_id...
what is the number of patients whose diagnoses icd9 code is v293 and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V293" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_2635 ( "Best Male MC" text, "Best Female MC" text, "Best Male Artist" text, "Best Female Artist" text, "Best Male Lyricist" text, "Best Female Lyricist" text, "Best Male Record" text )
Who was the Best Male MC if Best Album won the Best Male Lyricist?
SELECT "Best Male MC" FROM table_2635 WHERE "Best Male Lyricist" = 'Best Album'
wikisql
CREATE TABLE table_13328239_4 ( competition VARCHAR, score VARCHAR )
What competition ended with a score of 38-14?
SELECT competition FROM table_13328239_4 WHERE score = "38-14"
sql_create_context
CREATE TABLE table_name_8 ( frequency VARCHAR, model_number VARCHAR )
What is the frequency of the Turion 64 X2 TL-62?
SELECT frequency FROM table_name_8 WHERE model_number = "turion 64 x2 tl-62"
sql_create_context
CREATE TABLE table_25794010_1 ( name VARCHAR, county VARCHAR )
Name the name for desha
SELECT name FROM table_25794010_1 WHERE county = "Desha"
sql_create_context
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 ...
Draw a bar chart for what are the id and name of the mountains that have at least 2 photos?, could you order names from low to high order?
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.name
nvbench
CREATE TABLE table_3267 ( "Episode Number" text, "Episode" text, "Original Airdate" text, "Rating" text, "Share" text, "Rating/Share (18\u201349)" text, "Viewers (millions)" text, "Weekly Rank" real )
For what episode was the rating/share for 18-49 at 2.8/8
SELECT "Episode" FROM table_3267 WHERE "Rating/Share (18\u201349)" = '2.8/8'
wikisql
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, ...
calculate the one year survival probability of patients who were prescribed a cefazolin 2gm syr after they were diagnosed with acute coronary syndrome - unstable angina.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_name_34 ( round VARCHAR, competition VARCHAR, series VARCHAR )
Which Round has a Competition of uefa cup, and a Series of 5 2?
SELECT round FROM table_name_34 WHERE competition = "uefa cup" AND series = "5–2"
sql_create_context
CREATE TABLE table_name_90 ( winning_score VARCHAR, margin_of_victory VARCHAR )
For the tournament ending with a margin of victory of 6 strokes, what was the winning score?
SELECT winning_score FROM table_name_90 WHERE margin_of_victory = "6 strokes"
sql_create_context
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 t...
count the number of patients whose admission year is less than 2112 and diagnoses icd9 code is 56212?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2112" AND diagnoses.icd9_code = "56212"
mimicsql_data
CREATE TABLE table_66716 ( "Year" text, "Finish" text, "Team" text, "Tournament" text, "Role" text )
What is the Tournament in the Year of 1986?
SELECT "Tournament" FROM table_66716 WHERE "Year" = '1986'
wikisql
CREATE TABLE table_25129482_1 ( capacity VARCHAR, club VARCHAR )
How many capacities are given for FF Jaro club?
SELECT COUNT(capacity) FROM table_25129482_1 WHERE club = "FF Jaro"
sql_create_context
CREATE TABLE table_2668352_5 ( incumbent VARCHAR, district VARCHAR )
Who is every incumbent when Kentucky 2 is the district?
SELECT incumbent FROM table_2668352_5 WHERE district = "Kentucky 2"
sql_create_context
CREATE TABLE table_name_54 ( points_classification VARCHAR, stage VARCHAR )
Which points classification was used in stage 15?
SELECT points_classification FROM table_name_54 WHERE stage = "15"
sql_create_context
CREATE TABLE table_name_87 ( engine VARCHAR, model VARCHAR )
Which Engine has a Model of s320 cdi?
SELECT engine FROM table_name_87 WHERE model = "s320 cdi"
sql_create_context
CREATE TABLE table_name_18 ( place INTEGER, team VARCHAR, lost VARCHAR, points VARCHAR )
what is the highest place when lost is more than 4, points is less than 18 and team is Team of atl tico verag ense?
SELECT MAX(place) FROM table_name_18 WHERE lost > 4 AND points < 18 AND team = "atlético veragüense"
sql_create_context
CREATE TABLE table_name_40 ( south VARCHAR, west VARCHAR, east VARCHAR )
Who was in the South when TSV Kottern was in the West and EHF Passau was in the East?
SELECT south FROM table_name_40 WHERE west = "tsv kottern" AND east = "ehf passau"
sql_create_context
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 procedures ( ...
what is date of birth of subject id 18351?
SELECT demographic.dob FROM demographic WHERE demographic.subject_id = "18351"
mimicsql_data
CREATE TABLE table_204_877 ( id number, "place" number, "position" text, "number" number, "name" text, "league two" number, "fa cup" number, "league cup" number, "fl trophy" number, "total" number )
what player has one fa cup and one fl trophy ?
SELECT "name" FROM table_204_877 WHERE "fa cup" = 1 AND "fl trophy" = 1
squall
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight ( aircraft_code_sequence text, ...
show me the flights on tuesday morning from CHARLOTTE to BALTIMORE
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, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE table_61022 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which To par has a Country of united states, and a Score of 71-70=141?
SELECT "To par" FROM table_61022 WHERE "Country" = 'united states' AND "Score" = '71-70=141'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of department_id bin hire_date by time in a bar chart, sort in ascending by the y axis.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_12125069_2 ( attendance VARCHAR, date VARCHAR )
How many games were on May 20?
SELECT COUNT(attendance) FROM table_12125069_2 WHERE date = "May 20"
sql_create_context
CREATE TABLE table_40468 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real, "First round" text, "Final round" text )
What position does the player with a first round score of 35.7 play?
SELECT "Pos." FROM table_40468 WHERE "First round" = '35.7'
wikisql
CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int )
Plot the total number by grouped by country as a bar graph, and could you sort by the Country from low to high please?
SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_45856 ( "Number" real, "Artist" text, "Album" text, "Average score" real, "Number of reviews" text )
What is the highest number of artists on Scarface?
SELECT MAX("Number") FROM table_45856 WHERE "Artist" = 'scarface'
wikisql
CREATE TABLE table_name_5 ( decile INTEGER, name VARCHAR )
What is the average decile of Westport South School?
SELECT AVG(decile) FROM table_name_5 WHERE name = "westport south school"
sql_create_context
CREATE TABLE table_37409 ( "Squad No" real, "Player" text, "Position" text, "Tries" real, "Goals" real, "Points" real )
What is the total number of squad no when there are more than 8 points, Danny Mcguire is a player, and there are more than 0 goals?
SELECT SUM("Squad No") FROM table_37409 WHERE "Points" > '8' AND "Player" = 'danny mcguire' AND "Goals" > '0'
wikisql
CREATE TABLE table_19778 ( "Administrative division" text, "Area (km\u00b2)" text, "Population 2000 Census" real, "Population (2010 Census)" real, "Population density 2010 (/km\u00b2)" real )
Name the number of population density 2010 for duque de caxias
SELECT COUNT("Population density 2010 (/km\u00b2)") FROM table_19778 WHERE "Administrative division" = 'Duque de Caxias'
wikisql
CREATE TABLE table_25141 ( "Position" real, "2005\u20132006" text, "2006\u20132007" text, "2007\u20132008" text, "2008\u20132009" text, "2009\u20132010" text )
what is the total number of 2006-2007 and 2007-2008 for jack huczek?
SELECT COUNT("2006\u20132007") FROM table_25141 WHERE "2007\u20132008" = 'Jack Huczek'
wikisql
CREATE TABLE table_name_67 ( crystal_structure VARCHAR, no_of_cu_o_planes_in_unit_cell VARCHAR, t_c__k_ VARCHAR )
Which crystal structures has a Tc(K) of 110 and the number of Cu-O planes in the unit cell is 3?
SELECT crystal_structure FROM table_name_67 WHERE no_of_cu_o_planes_in_unit_cell = 3 AND t_c__k_ = 110
sql_create_context
CREATE TABLE table_name_31 ( electorate VARCHAR, member VARCHAR, state VARCHAR, party VARCHAR )
Which Electorate has a State of qld, a Party of national, and a Member of hon evan adermann?
SELECT electorate FROM table_name_31 WHERE state = "qld" AND party = "national" AND member = "hon evan adermann"
sql_create_context
CREATE TABLE table_203_473 ( id number, "no." number, "date" text, "tournament" text, "winning score" text, "margin\nof victory" text, "runner(s)-up" text )
when was the tournament with more strokes than the hertz bay hill classic ?
SELECT "date" FROM table_203_473 WHERE "margin\nof victory" > (SELECT "margin\nof victory" FROM table_203_473 WHERE "tournament" = 'hertz bay hill classic')
squall
CREATE TABLE table_19741316_1 ( wins INTEGER )
What is the lowest number of wins of a team?
SELECT MIN(wins) FROM table_19741316_1
sql_create_context
CREATE TABLE table_24487 ( "Week of" text, "Tournament" text, "Champion" text, "Runner-up" text, "Semifinalists" text, "Quarterfinalists" text )
How many champions are shown for the runner-up of stefan edberg?
SELECT COUNT("Champion") FROM table_24487 WHERE "Runner-up" = 'Stefan Edberg'
wikisql
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, ...
what is the age and icu stay id of patient id 2560?
SELECT demographic.age, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_13880 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
What is the lowest pick number for Arturo McDowell, who plays the OF position for the San Francisco Giants?
SELECT MIN("Pick") FROM table_13880 WHERE "Position" = 'of' AND "Team" = 'san francisco giants' AND "Player" = 'arturo mcdowell'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
Users with largest number of 'trackable' badges.
SELECT u.Id AS "user_link", COUNT(DISTINCT b.Name) AS BadgeCount FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name IN ('Altruist', 'Benefactor', 'Curious', 'Inquisitive', 'Socratic', 'Investor', 'Explainer', 'Promoter', 'Scholar', 'Student', 'Explainer') GROUP BY u.Id ORDER BY COUNT(DISTINCT b.Name...
sede
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
在医疗就诊95767550137中,负责费用明细项目23684776575的医疗机构科室编码及名称分别是什么?
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '23684776575'
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE compartment_cla...
what is the cheapest flight from PITTSBURGH to ATLANTA leaving on 10 5
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da...
atis
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
in this year how many people were diagnosed with atrial fibrillation within 2 months after the first diagnosis of cl skul base fx w/o coma?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrial fibrillatio...
mimic_iii
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datase...
What year did Ye Cao publish the most papers
SELECT DISTINCT COUNT(DISTINCT paper.paperid), paper.year FROM author, paper, writes WHERE author.authorname LIKE 'Ye Cao' AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.year ORDER BY COUNT(DISTINCT paper.paperid) DESC
scholar
CREATE TABLE table_3146 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight" text, "Jockey" text, "Winner/2nd" text )
who was the winner /2nd for the British Champion Stakes race?
SELECT "Winner/2nd" FROM table_3146 WHERE "Race" = 'British Champion Stakes'
wikisql
CREATE TABLE table_7353 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the average attendance in week 2?
SELECT AVG("Attendance") FROM table_7353 WHERE "Week" = '2'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment tex...
Top 25 Posts on your Site. Top 25 posts on your website, with links and posters.
SELECT Score, Id AS "post_link", OwnerDisplayName AS "poster" FROM Posts ORDER BY Score DESC LIMIT 25
sede
CREATE TABLE table_180802_2 ( abbr VARCHAR, zodiac_sign VARCHAR )
What's the abbreviation of the month in the zodiac sign scorpio?
SELECT abbr FROM table_180802_2 WHERE zodiac_sign = "Scorpio"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Show me about the correlation between People_ID and Weight , and group by attribute Sex in a scatter chart.
SELECT People_ID, Weight FROM people GROUP BY Sex
nvbench
CREATE TABLE table_60083 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Score, when Player is 'Ernie Els'?
SELECT "Score" FROM table_60083 WHERE "Player" = 'ernie els'
wikisql
CREATE TABLE table_name_20 ( khmer VARCHAR, other VARCHAR )
for the other of mouy, what's the khmer?
SELECT khmer FROM table_name_20 WHERE other = "mouy"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
编号为31808020937的住院就诊中,入院科室叫什么?代码呢
SELECT wdmzjzjlb.JZKSDM, wdmzjzjlb.JZKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '31808020937' UNION SELECT bdmzjzjlb.JZKSDM, bdmzjzjlb.JZKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '31808020937'
css
CREATE TABLE table_49766 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
Which player was defensive back after round 3?
SELECT "Player" FROM table_49766 WHERE "Position" = 'defensive back' AND "Round" > '3'
wikisql
CREATE TABLE table_name_17 ( tournament VARCHAR, opponents_in_the_final VARCHAR )
Which Tournament has Opponents in the final of maria lindstr m maria strandlund?
SELECT tournament FROM table_name_17 WHERE opponents_in_the_final = "maria lindström maria strandlund"
sql_create_context
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE va...
Find the number of students for each department. Visualize by pie chart.
SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_80143 ( "Colt model no." text, "Diemaco model" text, "Stock" text, "Fire control" text, "Rear sight" text, "Forward assist" text, "Barrel length" text, "Barrel profile" text, "Barrel twist" text, "Hand guards" text, "Bayonet Lug" text, "Muzzle device" t...
Which Hand guards has a Barrel profile of a2 and a Rear sight of weaver?
SELECT "Hand guards" FROM table_80143 WHERE "Barrel profile" = 'a2' AND "Rear sight" = 'weaver'
wikisql
CREATE TABLE table_34708 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 1999" text )
What is the position of the team that played at the venue with more than 6,500 capacity?
SELECT "Position in 1999" FROM table_34708 WHERE "Capacity" > '6,500'
wikisql
CREATE TABLE table_35327 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 1996" text )
What team plays at Spartak, Mogilev?
SELECT "Team" FROM table_35327 WHERE "Venue" = 'spartak, mogilev'
wikisql
CREATE TABLE table_509 ( "Institution" text, "Main Campus Location" text, "Founded" real, "Mascot" text, "School Colors" text )
What is the instition where the main campus location is overland park?
SELECT "Institution" FROM table_509 WHERE "Main Campus Location" = 'Overland Park'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
查询两千年一月二十二日到零八年十一月八日医生72531455接待过多少门诊病人
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '72531455' AND mzjzjlb.JZKSRQ BETWEEN '2000-01-22' AND '2008-11-08'
css
CREATE TABLE table_204_503 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
what year did imma clopes only place 24th ?
SELECT "year" FROM table_204_503 WHERE "position" = 24
squall
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
View top 100 questions sorted by answers count.
SELECT p1.Id AS "post_link", COUNT(p2.Id) AS AnswerCount FROM Posts AS p1 INNER JOIN Posts AS p2 ON p2.ParentId = p1.Id GROUP BY p1.Id ORDER BY AnswerCount DESC LIMIT 100
sede
CREATE TABLE table_name_52 ( season__number VARCHAR, series__number VARCHAR )
What is the season for series 81?
SELECT season__number FROM table_name_52 WHERE series__number = 81
sql_create_context
CREATE TABLE table_16476 ( "Episode Air Date" text, "Audition City" text, "Date" text, "First Audition Venue" text, "Callback Date" text, "Callback Venue" text, "Golden Tickets" real )
Which city had the charleston area convention center as its callback location
SELECT "Audition City" FROM table_16476 WHERE "Callback Venue" = 'Charleston Area Convention Center'
wikisql
CREATE TABLE table_203_60 ( id number, "outcome" text, "no." number, "date" text, "championship" text, "surface" text, "opponent in the final" text, "score in the final" text )
which surface was used the least ?
SELECT "surface" FROM table_203_60 GROUP BY "surface" ORDER BY COUNT("surface") LIMIT 1
squall
CREATE TABLE table_name_30 ( tournament VARCHAR, margin_of_victory VARCHAR )
What is Tournament, when Margin is Victory of 6 Strokes?
SELECT tournament FROM table_name_30 WHERE margin_of_victory = "6 strokes"
sql_create_context
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...
What are the title and maximum price of each film, show by the y-axis from low to high please.
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)
nvbench
CREATE TABLE table_2254 ( "Date" text, "Location" text, "Discipline" text, "Winner" text, "2nd place" text, "3rd place" text )
Where was the cup on 07.02.2009 held?
SELECT "Location" FROM table_2254 WHERE "Date" = '07.02.2009'
wikisql
CREATE TABLE table_1506950_4 ( country VARCHAR, tournament VARCHAR )
What country hosts the tournament the open championship?
SELECT country FROM table_1506950_4 WHERE tournament = "The Open Championship"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid ...
has patient 003-48563 received in 2105 a immunosuppressives - mycophenolate procedure in other hospitals?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-48563' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-48563' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE table_30725 ( "Team" text, "Head Coach" text, "Years at School" real, "Overall Record" text, "Record at School" text, "ACC Record" text )
What is the record in the atlantic coast conference for the Miami team?
SELECT "ACC Record" FROM table_30725 WHERE "Team" = 'Miami'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
哪些人在05077547937的医疗就诊中申请检验报告单是超过2份的?列出这些申请人的工号,还有姓名也列出来
SELECT SQRGH, SQRXM FROM jybgb WHERE JZLSH = '05077547937' GROUP BY SQRGH HAVING COUNT(*) > 2
css
CREATE TABLE table_203_491 ( id number, "year" number, "title" text, "us hot 100" number, "us modern rock" number, "us mainstream rock" number, "album" text )
how many singles were released in total ?
SELECT COUNT("title") FROM table_203_491
squall
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...
what is the number of patients whose diagnoses short title is hyp ht dis nos w ht fail and lab test fluid is joint fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hyp ht dis NOS w ht fail" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_37766 ( "Year" real, "Division" real, "League" text, "Reg. Season" text, "Playoffs" text )
Which Reg Season has a Division of 2?
SELECT "Reg. Season" FROM table_37766 WHERE "Division" = '2'
wikisql
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 prescriptions ( subject_id text, hadm_id...
what is admission location and procedure long title of subject id 7273?
SELECT demographic.admission_location, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "7273"
mimicsql_data
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREA...
I want to know the proportion of the total number for each participant type code.
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code
nvbench
CREATE TABLE table_train_8 ( "id" int, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "active_infection" bool, "intention_to_arterial_catheter" bool, "temperature" float, "intention_to_central_venous_catheter" bool, "sepsis" bool, "heart_rate" int, "paco2" f...
evidence of refractory hypoperfusion attributed to sepsis ( 1 or more of the following ) : systolic blood pressure less than 90 mmhg despite an intravenous fluid challenge of at least 30 ml / kg ( a portion of this may be albumin equivalent ) ; blood lactate level at least 4 mmol / l.
SELECT * FROM table_train_8 WHERE hypoperfusion = 1 AND (sepsis = 1 OR (CASE WHEN systolic_blood_pressure_sbp < 90 THEN 1 ELSE 0 END + CASE WHEN lactate > 4 THEN 1 ELSE 0 END) >= 1)
criteria2sql
CREATE TABLE table_17173 ( "#" real, "Episode" text, "Air Date" text, "Timeslot" text, "Rating" text, "Share" real, "18-49" text, "Viewers" text, "Weekly Rank" text )
What is the weekly rank where the number is 4?
SELECT "Weekly Rank" FROM table_17173 WHERE "#" = '4'
wikisql
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 ...
how many days has it been since patient 80555's admission to icu?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE table_23428 ( "Colt model no." text, "Military designation" text, "Barrel Length" text, "Barrel" text, "Handguard type" text, "Buttstock type" text, "Pistol grip type" text, "Lower receiver type" text, "Upper receiver type" text, "Rear sight type" text, "Front si...
What is the trigger pack on the Colt 602 with the a1 rear sight type?
SELECT "Trigger pack" FROM table_23428 WHERE "Rear sight type" = 'A1' AND "Colt model no." = '602'
wikisql
CREATE TABLE table_20589703_2 ( draft_round VARCHAR, college VARCHAR, draft_year VARCHAR )
In what draft round in 2012 did a player from Rio Hondo get drafted?
SELECT draft_round FROM table_20589703_2 WHERE college = "Rio Hondo" AND draft_year = 2012
sql_create_context
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 ) C...
Specify the duration of hospital stay of patient Troy Friedman along with his death status
SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Troy Friedman"
mimicsql_data
CREATE TABLE table_15891 ( "Player" text, "Years Played" text, "Total W-L" text, "Singles W-L" text, "Doubles W-L" text )
what's the singles w-l for kim doo-hwan
SELECT "Singles W-L" FROM table_15891 WHERE "Player" = 'Kim Doo-Hwan'
wikisql
CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id number ) CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE employees ( empl...
What are the department ids, full names, and salaries for employees who make the most in their departments?
SELECT first_name, last_name, salary, department_id, MAX(salary) FROM employees GROUP BY department_id
spider
CREATE TABLE table_47591 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
When Nelson Philippe drove with a grid larger than 16, what was the timre/retired?
SELECT "Time/Retired" FROM table_47591 WHERE "Grid" > '16' AND "Driver" = 'nelson philippe'
wikisql
CREATE TABLE table_204_344 ( id number, "player" text, "games played" number, "field goals" number, "free throws" number, "points" number )
after george halas , which two players are tied for lowest number of points ?
SELECT "player" FROM table_204_344 WHERE "points" < (SELECT "points" FROM table_204_344 WHERE "player" = 'george halas')
squall
CREATE TABLE table_200_15 ( id number, "year" text, "title" text, "role" text, "notes" text )
what was the name of paul reubens 's character in the popular t.v. show murphy brown ?
SELECT "role" FROM table_200_15 WHERE "title" = 'murphy brown'
squall
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name va...
Find the total number of instructors for each department with a bar chart, sort by the x axis from high to low.
SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY T1.dept_name DESC
nvbench
CREATE TABLE table_24441 ( "Day" text, "Stage" text, "Time (CET)" text, "Name" text, "Length" text, "Winner" text, "Time" text, "Avg. spd." text, "Rally leader" text )
Who is every name for time(cet) of 09:03?
SELECT "Name" FROM table_24441 WHERE "Time (CET)" = '09:03'
wikisql
CREATE TABLE table_20361783_1 ( year INTEGER, womens_singles VARCHAR )
state the earliest year li xuerui won womens singles
SELECT MIN(year) FROM table_20361783_1 WHERE womens_singles = "Li Xuerui"
sql_create_context