text
stringlengths 432
6.49k
| target
stringlengths 2
4.44k
|
|---|---|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_train_245 ( "id" int, "renal_disease" bool, "diabetic" string, "creatinine_clearance_cl" float, "smoking" bool, "kidney_disease" bool, "body_mass_index_bmi" float, "fasting_glucose" int, "NOUSE" float )
### Question ###
kidney disease or chronic renal insufficiency with a creatinine level > 1.8 mg / dl
### Accurate SQL ###
|
SELECT * FROM table_train_245 WHERE kidney_disease = 1 OR (renal_disease = 1 AND creatinine_clearance_cl > 1.8)
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_61 (time VARCHAR, team VARCHAR)
### Question ###
What time did team kawasaki zx10 1000cc have?
### Accurate SQL ###
|
SELECT time FROM table_name_61 WHERE team = "kawasaki zx10 1000cc"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_31945 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
### Question ###
Tell me the tournament with a hard surface for 6 1, 6 2
### Accurate SQL ###
|
SELECT "Tournament" FROM table_31945 WHERE "Surface" = 'hard' AND "Score" = '6–1, 6–2'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: 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 time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
### Question ###
were there any results of the microbiology tests for patient 031-3355 in 12/2105?
### Accurate SQL ###
|
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2105-12'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_43375 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
### Question ###
What shows for Set 5 when the Total was 77 - 65?
### Accurate SQL ###
|
SELECT "Set 5" FROM table_43375 WHERE "Total" = '77 - 65'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_20704243_6 (directed_by VARCHAR, original_air_date VARCHAR)
### Question ###
Who directed the episode that aired on july15,2012?
### Accurate SQL ###
|
SELECT directed_by FROM table_20704243_6 WHERE original_air_date = "July15,2012"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: 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 )
TABLE: 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 )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: 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 )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: 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 )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
### Question ###
what were the three most frequently prescribed medications for patients who had been previously diagnosed with food/vomit pneumonitis within 2 months, until 2101?
### Accurate SQL ###
|
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 = 'food/vomit pneumonitis') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2101') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', prescriptions.startdate) <= '2101') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_6 ( nationality VARCHAR, college_junior_club_team__league_ VARCHAR )
### Question ###
What is the nationality of the player who played for the Peterborough Petes (OHL)?
### Accurate SQL ###
|
SELECT nationality FROM table_name_6 WHERE college_junior_club_team__league_ = "peterborough petes (ohl)"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_44 (city_of_license VARCHAR, call_sign VARCHAR)
### Question ###
What city of license is associated with call sign w244bk?
### Accurate SQL ###
|
SELECT city_of_license FROM table_name_44 WHERE call_sign = "w244bk"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_7 ( grid INTEGER, time VARCHAR, laps VARCHAR )
### Question ###
What grid has an average time of +22.505 and laps larger than 23?
### Accurate SQL ###
|
SELECT AVG(grid) FROM table_name_7 WHERE time = "+22.505" AND laps > 23
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) )
TABLE: CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER )
TABLE: CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER )
TABLE: CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) )
TABLE: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) )
### Question ###
How many students are older than average for each gender.
### Accurate SQL ###
|
SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text )
TABLE: CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real )
TABLE: CREATE TABLE membership_register_branch ( Member_ID int, Branch_ID text, Register_Year text )
TABLE: CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int )
### Question ###
For each branch id, what are the names of the branches that were registered after 2015 Visualize by bar chart, could you order the total number in asc order?
### Accurate SQL ###
|
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY COUNT(*)
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_39929 ( "Date" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
### Question ###
Which Date has a Pictorials of mercedes mcnab, girls of hawaiian tropic?
### Accurate SQL ###
|
SELECT "Date" FROM table_39929 WHERE "Pictorials" = 'mercedes mcnab, girls of hawaiian tropic'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: 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 time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
### Question ###
when has patient 031-4423 had a microbiology test for the last time in 07/2104?
### Accurate SQL ###
|
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2104-07' ORDER BY microlab.culturetakentime DESC LIMIT 1
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_204_431 ( id number, "yacht" text, "nation" text, "owner" text, "skipper" text, "launch year" number )
### Question ###
who is the last yachts skipper ?
### Accurate SQL ###
|
SELECT "skipper" FROM table_204_431 ORDER BY id DESC LIMIT 1
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_3 (attendance VARCHAR, date VARCHAR)
### Question ###
What was the attendance on the bye week?
### Accurate SQL ###
|
SELECT attendance FROM table_name_3 WHERE date = "bye"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_33302 ( "Song" text, "Release date" text, "Release info" text, "Formats" text, "Album" text )
### Question ###
Which song released on heavenly (hvn152)?
### Accurate SQL ###
|
SELECT "Song" FROM table_33302 WHERE "Release info" = 'heavenly (hvn152)'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
TABLE: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
### Question ###
For those products with a price between 60 and 120, visualize a bar chart about the distribution of name and code , and display Code in desc order.
### Accurate SQL ###
|
SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Code DESC
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_69067 ( "Stage" text, "Date" text, "Course" text, "Distance" text, "Winner" text, "Race Leader" text )
### Question ###
Who was the winner for the Rome to Teramo course?
### Accurate SQL ###
|
SELECT "Winner" FROM table_69067 WHERE "Course" = 'rome to teramo'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, Black real, Amerindian real, Asian real, Multiracial real, Hispanic real )
TABLE: CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text )
### Question ###
Create a bar chart showing the total number across police force
### Accurate SQL ###
|
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_10162 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
What was the date of the game when the home team scored 21.18 (144) and the away team scored 16.19 (115)?
### Accurate SQL ###
|
SELECT "Date" FROM table_10162 WHERE "Home team score" = '21.18 (144)' AND "Away team score" = '16.19 (115)'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_93 ( crowd INTEGER, away_team VARCHAR )
### Question ###
What is the smallest amount of spectators when the away team was Hawthorn?
### Accurate SQL ###
|
SELECT MIN(crowd) FROM table_name_93 WHERE away_team = "hawthorn"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_35 (Id VARCHAR)
### Question ###
What is listed for the 2005 that has a 2012 of 4.2%?
### Accurate SQL ###
|
SELECT 2005 FROM table_name_35 WHERE 2012 = "4.2%"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_12485 ( "Draft" real, "Round" real, "Pick" real, "Player" text, "Nationality" text )
### Question ###
What is the lowest Draft, when Player is 'Dave Christian Category:Articles with hCards'?
### Accurate SQL ###
|
SELECT MIN("Draft") FROM table_12485 WHERE "Player" = 'dave christian category:articles with hcards'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: 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 time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
### Question ###
what is the minimum cost of the hospital which involves coma in 2104?
### Accurate SQL ###
|
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'coma')) AND STRFTIME('%y', cost.chargetime) = '2104' GROUP BY cost.patienthealthsystemstayid) AS t1
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_87 (athlete VARCHAR, country VARCHAR)
### Question ###
Who was the athlete from Lithuania?
### Accurate SQL ###
|
SELECT athlete FROM table_name_87 WHERE country = "lithuania"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_25996938_1 ( title VARCHAR, us_viewers__million_ VARCHAR )
### Question ###
Which episode did 18.74 million people tune in?
### Accurate SQL ###
|
SELECT title FROM table_25996938_1 WHERE us_viewers__million_ = "18.74"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: 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 )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: 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, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
### Question ###
Answers by Time of Day and Day of Week. Designed to consider whether 'night' questions have more visibility than 'day' questions
### Accurate SQL ###
|
SELECT TIME_TO_STR(Posts.CreationDate, '%A') AS Weekday, TIME_TO_STR(Posts.CreationDate, '%h') AS Hour, COUNT(Posts.Id) AS Answers FROM Posts WHERE PostTypeId = 2 GROUP BY TIME_TO_STR(Posts.CreationDate, '%A'), TIME_TO_STR(Posts.CreationDate, '%h') ORDER BY COUNT(Posts.Id) DESC
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_56279 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
What is the score of the away team whose opponent scored 7.14 (56) in front of a crowd was larger than 24,000?
### Accurate SQL ###
|
SELECT "Away team score" FROM table_56279 WHERE "Crowd" > '24,000' AND "Home team score" = '7.14 (56)'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_46722 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
### Question ###
What team has a Record of 50 28?
### Accurate SQL ###
|
SELECT "Team" FROM table_46722 WHERE "Record" = '50–28'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_24 (total INTEGER, year_s__won VARCHAR)
### Question ###
What is the total medals in 1964?
### Accurate SQL ###
|
SELECT MIN(total) FROM table_name_24 WHERE year_s__won = "1964"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_50 (competition VARCHAR, date VARCHAR, result VARCHAR, score VARCHAR)
### Question ###
Which Competition has a Result of w, and a Score of 2-0, and a Date of may 9, 1954?
### Accurate SQL ###
|
SELECT competition FROM table_name_50 WHERE result = "w" AND score = "2-0" AND date = "may 9, 1954"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_68965 ( "Draw" real, "Country" text, "Language" text, "Artist" text, "Song" text, "English translation" text, "Result" text )
### Question ###
Name the result for linn nyg rd
### Accurate SQL ###
|
SELECT "Result" FROM table_68965 WHERE "Artist" = 'linn nygård'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_44989 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" real )
### Question ###
Which Week has a Record of 2-9?
### Accurate SQL ###
|
SELECT MIN("Week") FROM table_44989 WHERE "Record" = '2-9'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_10 ( rank INTEGER, nation VARCHAR, gold VARCHAR )
### Question ###
What is the rank that when Serbia is the nation, and gold is larger than 0?
### Accurate SQL ###
|
SELECT SUM(rank) FROM table_name_10 WHERE nation = "serbia" AND gold > 0
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_26996293_7 (college VARCHAR, player VARCHAR)
### Question ###
What is the college where player terry moss attended?
### Accurate SQL ###
|
SELECT college FROM table_26996293_7 WHERE player = "Terry Moss"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_58438 ( "CDP name" text, "County" text, "Pop. (2010)" real, "Land ( sq mi )" real, "Water (sq mi)" real, "Coordinates" text, "FIPS code" real, "ANSI code" real )
### Question ###
Name the CDP name for FIPS code of 3659708
### Accurate SQL ###
|
SELECT "CDP name" FROM table_58438 WHERE "FIPS code" = '3659708'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_5 ( title VARCHAR, pages VARCHAR, vol__number VARCHAR )
### Question ###
What is the title of the edition with more than 128 pages and a volume # of 5?
### Accurate SQL ###
|
SELECT title FROM table_name_5 WHERE pages > 128 AND vol__number = 5
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_19508635_1 (song_choice VARCHAR, original_artist VARCHAR)
### Question ###
Name the song choice for michael jackson
### Accurate SQL ###
|
SELECT song_choice FROM table_19508635_1 WHERE original_artist = "Michael Jackson"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_20803241_1 ( cash_fare VARCHAR, type_of_fare VARCHAR )
### Question ###
When mega pass* (senior/disabled) is the type of fare what is the cash fare?
### Accurate SQL ###
|
SELECT cash_fare FROM table_20803241_1 WHERE type_of_fare = "Mega Pass* (Senior/Disabled)"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_23132 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
### Question ###
When michigan technological university (ncaa) is the college, junior, or club team what is the nationality?
### Accurate SQL ###
|
SELECT "Nationality" FROM table_23132 WHERE "College/junior/club team" = 'Michigan Technological University (NCAA)'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_56 (calendar VARCHAR, wysiwyg_editor VARCHAR, unread_message_tracking VARCHAR)
### Question ###
Which Calendar has WYSIWYG Editor of yes and an Unread message tracking of yes?
### Accurate SQL ###
|
SELECT calendar FROM table_name_56 WHERE wysiwyg_editor = "yes" AND unread_message_tracking = "yes"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50) )
TABLE: CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME )
TABLE: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) )
TABLE: CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) )
TABLE: CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) )
TABLE: CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL(19,4) )
TABLE: CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) )
TABLE: CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) )
### Question ###
Show the relationship between account id and name for each account in a scatter chart.
### Accurate SQL ###
|
SELECT account_name, T1.account_id FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_47023 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
### Question ###
What is the Power (kW) for the station located in Cebu?
### Accurate SQL ###
|
SELECT "Power (kW)" FROM table_47023 WHERE "Location" = 'cebu'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Student (city_code VARCHAR)
### Question ###
Show all cities where students live.
### Accurate SQL ###
|
SELECT DISTINCT city_code FROM Student
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_17964087_2 ( govt_salary VARCHAR, chinese_name VARCHAR )
### Question ###
For the chinese name how many in total is the govt salary?
### Accurate SQL ###
|
SELECT COUNT(govt_salary) FROM table_17964087_2 WHERE chinese_name = "盧奕基"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: 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 )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
### Question ###
what is the number of patients who were hospitalized for more than 7 days and had prostate specific antigen lab test done?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Prostate Specific Antigen"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_54 ( date VARCHAR, week VARCHAR )
### Question ###
When does week 1 start?
### Accurate SQL ###
|
SELECT date FROM table_name_54 WHERE week = "1"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_17707 ( "Year" real, "Total Region" real, "Biggenden" real, "Eidsvold" real, "Gayndah" real, "Monto" real, "Mundubbera" real, "Perry" real )
### Question ###
What is the minimum mundubbera when biggenden is 1882
### Accurate SQL ###
|
SELECT MIN("Mundubbera") FROM table_17707 WHERE "Biggenden" = '1882'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_14342210_14 ( touchdowns__5_points_ INTEGER, player VARCHAR )
### Question ###
How many touchdowns did Bruce Shorts make?
### Accurate SQL ###
|
SELECT MAX(touchdowns__5_points_) FROM table_14342210_14 WHERE player = "Bruce Shorts"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_81 ( co_drivers VARCHAR, year VARCHAR )
### Question ###
Who were the co-drivers in 2008?
### Accurate SQL ###
|
SELECT co_drivers FROM table_name_81 WHERE year = 2008
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int )
TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar )
TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar )
TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int )
TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int )
TABLE: CREATE TABLE area ( course_id int, area varchar )
TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar )
TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar )
TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int )
### Question ###
Which 300 -level courses are the least difficult ?
### Accurate SQL ###
|
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND program_course.course_id = course.course_id AND program_course.workload < 3 ORDER BY program_course.workload
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_56 ( body_tackle VARCHAR, diving_tackle VARCHAR, sliding_tackle VARCHAR )
### Question ###
Which body tackle has yes for the diving tackle and the sliding tackle classified as a trip?
### Accurate SQL ###
|
SELECT body_tackle FROM table_name_56 WHERE diving_tackle = "yes" AND sliding_tackle = "classified as a trip"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
TABLE: 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 )
### Question ###
Return a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, could you display by the Y-axis in desc?
### Accurate SQL ###
|
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID DESC
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_17 ( name VARCHAR, pick__number VARCHAR, overall VARCHAR )
### Question ###
What is the name of the player with a pick # less than 5 and an overall of 284?
### Accurate SQL ###
|
SELECT name FROM table_name_17 WHERE pick__number < 5 AND overall = 284
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_39 (driver VARCHAR, laps VARCHAR)
### Question ###
Who was the driver with 29 laps?
### Accurate SQL ###
|
SELECT driver FROM table_name_39 WHERE laps = "29"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_61 (population VARCHAR, urban_sub_area VARCHAR)
### Question ###
What is the population of the East Kilbride urban sub-area?
### Accurate SQL ###
|
SELECT population FROM table_name_61 WHERE urban_sub_area = "east kilbride"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_77023 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
### Question ###
What is the lowest Rank, when Nation is Great Britain, and when Bronze is less than 1?
### Accurate SQL ###
|
SELECT MIN("Rank") FROM table_77023 WHERE "Nation" = 'great britain' AND "Bronze" < '1'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_29 ( bronze INTEGER, nation VARCHAR, total VARCHAR )
### Question ###
What is the average bronze medals of Uganda's swimmers when they earned over 2 medals?
### Accurate SQL ###
|
SELECT AVG(bronze) FROM table_name_29 WHERE nation = "uganda" AND total > 2
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_28498999_6 (reset_points VARCHAR, player VARCHAR)
### Question ###
what is the number of pieces where the person is charley hoffman
### Accurate SQL ###
|
SELECT COUNT(reset_points) FROM table_28498999_6 WHERE player = "Charley Hoffman"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_52 (wheel_arrangement VARCHAR, manufacturer VARCHAR, quantity_made VARCHAR)
### Question ###
What is Wheel Arrangement, when Manufacturer is "Baldwin", and when Quantity Made is 12?
### Accurate SQL ###
|
SELECT wheel_arrangement FROM table_name_52 WHERE manufacturer = "baldwin" AND quantity_made = "12"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_50913 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
### Question ###
Who is the player from round 8?
### Accurate SQL ###
|
SELECT "Player" FROM table_50913 WHERE "Round" = '8'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_97 (d_45_o VARCHAR, d_46_o VARCHAR)
### Question ###
Name the D 45 O with D 46 O of r 31 √
### Accurate SQL ###
|
SELECT d_45_o FROM table_name_97 WHERE d_46_o = "r 31 √"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_9048 ( "Year" real, "Winner" text, "Score" text, "Runner(s)-up" text, "Winner's share ($)" real, "Course" text, "Location" text )
### Question ###
Where is runner-up Betsy Rawls from?
### Accurate SQL ###
|
SELECT "Location" FROM table_9048 WHERE "Runner(s)-up" = 'betsy rawls'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: 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 )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: 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 )
TABLE: 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 )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: 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 )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
### Question ###
what was the name of the drug that's been prescribed to patient 73713 two times during their first hospital visit?
### Accurate SQL ###
|
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_train_79 ( "id" int, "fasting_triglycerides" int, "fasting_total_cholesterol" int, "fasting_glucose" int, "age" float, "NOUSE" float )
### Question ###
laboratory findings of fasting glucose greater than or equal to 126 mg / dl
### Accurate SQL ###
|
SELECT * FROM table_train_79 WHERE fasting_glucose >= 126
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_55619 ( "Rank" real, "Movie" text, "Year" real, "Studio(s)" text, "Single Day Net Gross" real, "Day in Release" text, "Day of Week" real )
### Question ###
What is the average year for releases on Friday and weeks larger than 2 days?
### Accurate SQL ###
|
SELECT AVG("Year") FROM table_55619 WHERE "Day in Release" = 'friday' AND "Day of Week" > '2'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_92 (date VARCHAR, winning_driver VARCHAR, location VARCHAR)
### Question ###
On what date did Ayrton Senna win at Imola?
### Accurate SQL ###
|
SELECT date FROM table_name_92 WHERE winning_driver = "ayrton senna" AND location = "imola"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: 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 )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
### Question ###
How many of the patients belonging to american indian/alaska native ethnic origin were treated with main drug?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "MAIN"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_15520 ( "Character" text, "Original West End Cast" text, "Original Broadway Cast" text, "First UK Tour Cast" text, "First US Tour Cast" text )
### Question ###
What is the name of the person in the First UK Tour Cast for the Character of Sister Mary Robert?
### Accurate SQL ###
|
SELECT "First UK Tour Cast" FROM table_15520 WHERE "Character" = 'sister mary robert'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_31 (result VARCHAR, date VARCHAR)
### Question ###
What was the result on the 26th?
### Accurate SQL ###
|
SELECT result FROM table_name_31 WHERE date = "26th"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_35719 ( "Rocket" text, "Country" text, "Family" text, "Launches" real, "Successes" real, "Failures" real, "Partial failures" real )
### Question ###
What is the least amount of failures with 1 launch and 0 partial failures?
### Accurate SQL ###
|
SELECT MIN("Failures") FROM table_35719 WHERE "Launches" = '1' AND "Partial failures" < '0'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_2849 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
### Question ###
What is the record where arco arena 17361 is location attendance?
### Accurate SQL ###
|
SELECT "Record" FROM table_2849 WHERE "Location Attendance" = 'Arco Arena 17361'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_18 (round INTEGER, opponent VARCHAR)
### Question ###
What is the average round of the match with kevin manderson as the opponent?
### Accurate SQL ###
|
SELECT AVG(round) FROM table_name_18 WHERE opponent = "kevin manderson"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_204_785 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
### Question ###
did peru win more or less gold medals than chile ?
### Accurate SQL ###
|
SELECT (SELECT "gold" FROM table_204_785 WHERE "nation" = 'peru') > (SELECT "gold" FROM table_204_785 WHERE "nation" = 'chile')
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_74 ( office VARCHAR, liberal_ticket VARCHAR )
### Question ###
What is the Office when spencer c. young is on the liberal ticket??
### Accurate SQL ###
|
SELECT office FROM table_name_74 WHERE liberal_ticket = "spencer c. young"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_23088 ( "Rnd" real, "Circuit" text, "LMP1 Winning Team" text, "LMP2 Winning Team" text, "GT2 Winning Team" text, "Challenge Winning Team" text, "Results" text )
### Question ###
Name the lmp 1 winning team for rnd being 2 and adrian fern ndez luis d az
### Accurate SQL ###
|
SELECT "LMP1 Winning Team" FROM table_23088 WHERE "Rnd" = '2' AND "LMP2 Winning Team" = 'Adrian Fernández Luis Díaz'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_17294353_1 (attendance INTEGER, opponent VARCHAR)
### Question ###
Of the times the Broncos played the Cincinnati Bengals, what was the highest attendance?
### Accurate SQL ###
|
SELECT MAX(attendance) FROM table_17294353_1 WHERE opponent = "Cincinnati Bengals"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) )
TABLE: CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) )
TABLE: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) )
TABLE: CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) )
TABLE: CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) )
TABLE: CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL(19,4) )
TABLE: CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME )
TABLE: CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50) )
### Question ###
Scatter plot to show order id on x axis and the total number on y axis.
### Accurate SQL ###
|
SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_2818164_7 (production_code VARCHAR, written_by VARCHAR)
### Question ###
What is the production code that was written by matt robinson?
### Accurate SQL ###
|
SELECT production_code FROM table_2818164_7 WHERE written_by = "Matt Robinson"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_97 ( tournament VARCHAR )
### Question ###
What is the 2010 value of the monte carlo masters, which had A in 2012?
### Accurate SQL ###
|
SELECT 2010 FROM table_name_97 WHERE 2012 = "a" AND tournament = "monte carlo masters"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_97 (alternate VARCHAR, second VARCHAR)
### Question ###
What is the alternate of the nation with hubert gründhammer as the second?
### Accurate SQL ###
|
SELECT alternate FROM table_name_97 WHERE second = "hubert gründhammer"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_70 (first_class_team VARCHAR, date_of_birth VARCHAR)
### Question ###
What is the first class team of the player born on 23 February 1973?
### Accurate SQL ###
|
SELECT first_class_team FROM table_name_70 WHERE date_of_birth = "23 february 1973"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_58189 ( "Team" text, "Season" text, "Regular Season" real, "Tournament" real, "Total" real )
### Question ###
How many regular season titles did Kansas receive when they received fewer than 2 tournament titles and more than 0 total titles?
### Accurate SQL ###
|
SELECT "Regular Season" FROM table_58189 WHERE "Tournament" < '2' AND "Total" > '0' AND "Team" = 'kansas'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE writes ( paperid int, authorid int )
TABLE: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar )
TABLE: CREATE TABLE journal ( journalid int, journalname varchar )
TABLE: CREATE TABLE venue ( venueid int, venuename varchar )
TABLE: CREATE TABLE dataset ( datasetid int, datasetname varchar )
TABLE: CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int )
TABLE: CREATE TABLE paperfield ( fieldid int, paperid int )
TABLE: CREATE TABLE paperdataset ( paperid int, datasetid int )
TABLE: CREATE TABLE cite ( citingpaperid int, citedpaperid int )
TABLE: CREATE TABLE author ( authorid int, authorname varchar )
TABLE: CREATE TABLE field ( fieldid int )
TABLE: CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int )
### Question ###
When did qiang ma publish his MapReduce paper ?
### Accurate SQL ###
|
SELECT DISTINCT paper.year FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'qiang ma' AND keyphrase.keyphrasename = 'MapReduce' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_16512618_1 (losses INTEGER, manager VARCHAR)
### Question ###
Name the most losses for leslie mann
### Accurate SQL ###
|
SELECT MAX(losses) FROM table_16512618_1 WHERE manager = "Leslie Mann"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_71396 ( "Player" text, "Country" text, "Year(s) Won" text, "Total" real, "To par" real )
### Question ###
When was a game won with more than 11 to par?
### Accurate SQL ###
|
SELECT "Year(s) Won" FROM table_71396 WHERE "To par" > '11'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_68 ( country VARCHAR, rank VARCHAR )
### Question ###
What country is ranked #2?
### Accurate SQL ###
|
SELECT country FROM table_name_68 WHERE rank = 2
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_37585 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
### Question ###
Where was home with a record of 7 5 2?
### Accurate SQL ###
|
SELECT "Home" FROM table_37585 WHERE "Record" = '7–5–2'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE reviewer ( rid number, name text )
TABLE: CREATE TABLE movie ( mid number, title text, year number, director text )
TABLE: CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
### Question ###
What are the names of reviewers who had rated 3 star and 4 star?
### Accurate SQL ###
|
SELECT T2.name FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T1.stars = 4
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_49 (location VARCHAR, winning_skip VARCHAR, event VARCHAR)
### Question ###
What's the location of the National event with Kevin Martin winning?
### Accurate SQL ###
|
SELECT location FROM table_name_49 WHERE winning_skip = "kevin martin" AND event = "the national"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_31 (company_name VARCHAR, hardware_model VARCHAR)
### Question ###
What company makes the Nokia 700?
### Accurate SQL ###
|
SELECT company_name FROM table_name_31 WHERE hardware_model = "nokia 700"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_8 ( difference VARCHAR, position INTEGER )
### Question ###
What was the Difference of the Team that had a Position less than 2?
### Accurate SQL ###
|
SELECT difference FROM table_name_8 WHERE position < 2
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_17382360_7 ( team VARCHAR, date VARCHAR )
### Question ###
what team play in february 18 in the supersonic season
### Accurate SQL ###
|
SELECT team FROM table_17382360_7 WHERE date = "February 18"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_79539 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
### Question ###
What is the Airport with a ICAO of EDDH?
### Accurate SQL ###
|
SELECT "Airport" FROM table_79539 WHERE "ICAO" = 'eddh'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_71230 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
### Question ###
Which Country has a Place of t8 and byron nelson?
### Accurate SQL ###
|
SELECT "Country" FROM table_71230 WHERE "Place" = 't8' AND "Player" = 'byron nelson'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE HOTELS (star_rating_code VARCHAR, price_range INTEGER)
### Question ###
Show the average price of hotels for each star rating code.
### Accurate SQL ###
|
SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_53 (year VARCHAR, position VARCHAR, name VARCHAR)
### Question ###
What year is guard Mario Chalmers?
### Accurate SQL ###
|
SELECT year FROM table_name_53 WHERE position = "guard" AND name = "mario chalmers"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_26 ( rank INTEGER, candidate_name VARCHAR )
### Question ###
What is the average rank for antun salman?
### Accurate SQL ###
|
SELECT AVG(rank) FROM table_name_26 WHERE candidate_name = "antun salman"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_73115 ( "Song" text, "Porsgrunn" real, "Bergen" real, "Bod\u00f8" real, "Stavanger" real, "\u00c5lesund" real, "Elverum" real, "Troms\u00f8" real, "Fredrikstad" real, "Trondheim" real, "Oslo" real, "Total" real )
### Question ###
What is the lowest total?
### Accurate SQL ###
|
SELECT MIN("Total") FROM table_73115
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.