instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the biggest points when the grid is less than 13 and the time/retired is +7.538 secs?
CREATE TABLE table_name_34 (points INTEGER,grid VARCHAR,time_retired VARCHAR)
SELECT MAX(points) FROM table_name_34 WHERE grid < 13 AND time_retired = "+7.538 secs"
Which Senior status has a Chief Judge of 1991 1995?
CREATE TABLE table_name_30 (senior_status VARCHAR,chief_judge VARCHAR)
SELECT senior_status FROM table_name_30 WHERE chief_judge = "1991–1995"
what were the four most commonly performed lab tests during the last year?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4
Stacked bar chart of team_id for with each ACC_Road in each all home, I want to sort from low to high by the x-axis.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home
What is the Status when Henry I is the Monarch and the Reason is succession unclear 1100-1103?
CREATE TABLE table_name_11 (status VARCHAR,monarch VARCHAR,reason VARCHAR)
SELECT status FROM table_name_11 WHERE monarch = "henry i" AND reason = "succession unclear 1100-1103"
WHich Scored 1,500 Points has a Years Played of 2004 2008 and a Name of jolene anderson?
CREATE TABLE table_name_34 (scored_1 VARCHAR,years_played VARCHAR,name VARCHAR)
SELECT scored_1, 500 AS _points FROM table_name_34 WHERE years_played = "2004–2008" AND name = "jolene anderson"
what was the first deep learning paper ?
CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE...
SELECT DISTINCT dataset.datasetid, paper.year FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid AND paper.pap...
What was the winning team lmpc in rnd 3?
CREATE TABLE table_24037660_2 (lmpc_winning_team VARCHAR,rnd VARCHAR)
SELECT lmpc_winning_team FROM table_24037660_2 WHERE rnd = 3
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings in a pie chart.
CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATETIME,available_yn BIT)CREATE TABLE Apartments (apt_id INTEGER,bu...
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
What is Date, when Matches is less than 32, and when Round is Fifth Round Proper?
CREATE TABLE table_name_55 (date VARCHAR,matches VARCHAR,round VARCHAR)
SELECT date FROM table_name_55 WHERE matches < 32 AND round = "fifth round proper"
the 2010 clausura tournament?
CREATE TABLE table_74455 ("Tournament" text,"Player" text,"Nationality" text,"Team" text,"Games played" real,"Goals conceded" real,"Coefficient" text)
SELECT "Coefficient" FROM table_74455 WHERE "Tournament" = '2010 Clausura'
provide the number of patients whose days of hospital stay is greater than 11 and diagnoses long title is aftercare for healing traumatic fracture of lower leg?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "11" AND diagnoses.long_title = "Aftercare for healing traumatic fracture of lower leg"
Which Points Classification Navy Blue Jersey that has a Jersey of Graeme Brown
CREATE TABLE table_name_8 (points_classification_navy_blue_jersey VARCHAR,general_classification_yellow_jersey VARCHAR)
SELECT points_classification_navy_blue_jersey FROM table_name_8 WHERE general_classification_yellow_jersey = "graeme brown"
in 2105, what are the three most frequent laboratory tests ordered for patients during the same month after receiving cv cath plcmt w guidance?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icus...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
What is the Surface of the court in the match with a Score of 4 6, 6 4, 3 6?
CREATE TABLE table_47414 ("Outcome" text,"Year" real,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Surface" FROM table_47414 WHERE "Score" = '4–6, 6–4, 3–6'
SPANISH 278 is offered every semester , correct ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction ...
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'SPANISH' AND COURSEalias0.numbe...
What is the finished place where exited is day 11?
CREATE TABLE table_14345690_5 (finished VARCHAR,exited VARCHAR)
SELECT finished FROM table_14345690_5 WHERE exited = "Day 11"
If the visiting team is Clemson, when was the time?
CREATE TABLE table_26842217_8 (time VARCHAR,visiting_team VARCHAR)
SELECT time FROM table_26842217_8 WHERE visiting_team = "Clemson"
How many tries against were there with points of 150?
CREATE TABLE table_22022 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT "Tries against" FROM table_22022 WHERE "Points for" = '150'
how many managers left sunshine stars?
CREATE TABLE table_30340 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Incoming manager" text,"Date of appointment" text)
SELECT COUNT("Outgoing manager") FROM table_30340 WHERE "Team" = 'Sunshine Stars'
What's the London borough with 7797 Pakistani citizens?
CREATE TABLE table_19149550_9 (london_borough VARCHAR,pakistani_population VARCHAR)
SELECT london_borough FROM table_19149550_9 WHERE pakistani_population = 7797
Name the high assists for december 14
CREATE TABLE table_1352 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High assists" FROM table_1352 WHERE "Date" = 'December 14'
By how many strokes did Lema beat Jack Nicklaus?
CREATE TABLE table_41402 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Margin of victory" FROM table_41402 WHERE "Runner(s)-up" = 'jack nicklaus'
How many titles were there for the 113 episode?
CREATE TABLE table_10718631_2 (title VARCHAR,no_in_series VARCHAR)
SELECT COUNT(title) FROM table_10718631_2 WHERE no_in_series = 113
My answers for questions not containing Python tag.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDa...
SELECT q.Id AS "post_link", q.Tags FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = @UserId AND NOT q.Tags LIKE '%<python>%'
what was the name of the intake that patient 005-77687 on last month/30 first had?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
How many stadiums are there with a capacity of 7500?
CREATE TABLE table_11208143_9 (stadium VARCHAR,capacity VARCHAR)
SELECT COUNT(stadium) FROM table_11208143_9 WHERE capacity = 7500
How many patients born before the year 2170 had a lab test named other cells?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.label = "Other Cells"
what is diagnoses long title and procedure short title of subject id 23733?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT diagnoses.long_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23733"
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and department_id in a bar chart.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var...
SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
patients with a history of hypersensitivity to vitamin c or thiamine
CREATE TABLE table_train_42 ("id" int,"taking_vitamin_c" bool,"do_not_resuscitate_dnr" bool,"allergy_to_thiamine" bool,"taking_thiamine" bool,"receiving_vasopressor" bool,"sepsis" bool,"hypotension" bool,"allergy_to_vitamin_c" bool,"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,"limited_care" bool,"septic_shoc...
SELECT * FROM table_train_42 WHERE allergy_to_vitamin_c = 1 OR allergy_to_thiamine = 1
Find the average age of students living in each dorm and the name of dorm Plot them as bar chart, rank by the bars in asc.
CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTE...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY dorm_name
what have you tried comments.
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)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,Tag...
SELECT Id FROM Comments WHERE Text = 'http://whathaveyoutried.com'
find the number of patients who were electively admitted to hospital before the year 2176.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2176"
How many rounds have a time of 2:18?
CREATE TABLE table_name_64 (round VARCHAR,time VARCHAR)
SELECT COUNT(round) FROM table_name_64 WHERE time = "2:18"
Find the name and age of all males in order of their age.
CREATE TABLE Person (name VARCHAR,gender VARCHAR,age VARCHAR)
SELECT name FROM Person WHERE gender = 'male' ORDER BY age
Who has the least wins when ranked above 3 with over 10 events?
CREATE TABLE table_55111 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Events" real,"Wins" real)
SELECT MIN("Wins") FROM table_55111 WHERE "Rank" < '3' AND "Events" > '10'
How many people were born in 1368?
CREATE TABLE table_name_52 (number VARCHAR,born VARCHAR)
SELECT COUNT(number) FROM table_name_52 WHERE born = "1368"
How many trophy presentations where in the year 1987?
CREATE TABLE table_22514845_4 (trophy_presentation VARCHAR,year VARCHAR)
SELECT COUNT(trophy_presentation) FROM table_22514845_4 WHERE year = 1987
which nation won the most silver medals ?
CREATE TABLE table_204_231 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_204_231 ORDER BY "silver" DESC LIMIT 1
who was the only draftee to come from clemson ?
CREATE TABLE table_204_635 (id number,"round" number,"selection" number,"player" text,"position" text,"college" text)
SELECT "player" FROM table_204_635 WHERE "college" = 'clemson'
Tell me the date that has a week larger than 3 and a result of w 28-27
CREATE TABLE table_name_26 (date VARCHAR,week VARCHAR,result VARCHAR)
SELECT date FROM table_name_26 WHERE week > 3 AND result = "w 28-27"
What are the names of the courses in alphabetical order?
CREATE TABLE courses (course_id text,course_name text,course_description text,other_details text)CREATE TABLE people_addresses (person_address_id number,person_id number,address_id number,date_from time,date_to time)CREATE TABLE addresses (address_id number,line_1 text,line_2 text,city text,zip_postcode text,state_prov...
SELECT course_name FROM courses ORDER BY course_name
What was the extra info for the Commonwealth Games?
CREATE TABLE table_15801 ("Year" real,"Tournament" text,"Venue" text,"Result" text,"Extra" text)
SELECT "Extra" FROM table_15801 WHERE "Tournament" = 'commonwealth games'
Show me about the distribution of meter_700 and meter_100 in a bar chart, could you sort by the meter_700 in asc?
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700
this year, patient 025-10988 was diagnosed for the first time with what?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid ...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-10988')) AND DATETIME(diagnosis.diagnosistime, 'start of year...
for patient kenneth koeller, specify diagnosis icd9 code with short title
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT diagnoses.icd9_code, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kenneth Koeller"
What are the actual delivery dates of orders with quantity 1?
CREATE TABLE Customer_Orders (Actual_Delivery_Date VARCHAR,Order_ID VARCHAR)CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR,Order_Quantity VARCHAR)
SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1
Show the number of games for each home team in a bar chart, and list by the X in ascending.
CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team text,Score text,Competition text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendance real,Capacity_Percentage real)CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Nu...
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY Home_team
Who was the Long Beach constructor?
CREATE TABLE table_name_24 (constructor VARCHAR,location VARCHAR)
SELECT constructor FROM table_name_24 WHERE location = "long beach"
what was the difference of sao2 of patient 021-111547 last measured on the current intensive care unit visit compared to the second to last value measured on the current intensive care unit visit?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna...
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547') AND patient.unitdischargetime IS NULL) AN...
What is the average attendance for the date of april 4?
CREATE TABLE table_67211 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT AVG("Attendance") FROM table_67211 WHERE "Date" = 'april 4'
What was the status of joon-hyung park ?
CREATE TABLE table_67436 ("Status" text,"Name" text,"First Performance" text,"Last Performance" text,"Style" text)
SELECT "Status" FROM table_67436 WHERE "Name" = 'joon-hyung park 박준형'
Where did the away team play when they scored 12.13 (85)?
CREATE TABLE table_58132 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_58132 WHERE "Away team score" = '12.13 (85)'
Questions with multiple upvoted answers by the same user.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,Target...
SELECT ParentId AS "Post Link", OwnerUserId AS "User Link", COUNT(*) AS "Number of Answers" FROM Posts WHERE ParentId > 0 AND OwnerUserId > 0 AND Score > 0 AND NOT (Title LIKE '%best%') AND NOT (Title LIKE '%worst%') AND NOT (Title LIKE '%hidden%') GROUP BY ParentId, OwnerUserId HAVING COUNT(*) >= 2 ORDER BY COUNT(*) D...
Give the proportion of the number of locations of all wrestlers with a pie chart.
CREATE TABLE Elimination (Elimination_ID text,Wrestler_ID text,Team text,Eliminated_By text,Elimination_Move text,Time text)CREATE TABLE wrestler (Wrestler_ID int,Name text,Reign text,Days_held text,Location text,Event text)
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location
Show the most common builder of railways.
CREATE TABLE railway (Builder VARCHAR)
SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1
What is the earliest year a house opened?
CREATE TABLE table_1942683_1 (year_opened INTEGER)
SELECT MIN(year_opened) FROM table_1942683_1
How old is contestant Valerie Chardonnens Vargas?
CREATE TABLE table_22447251_2 (age INTEGER,contestant VARCHAR)
SELECT MAX(age) FROM table_22447251_2 WHERE contestant = "Valerie Chardonnens Vargas"
What's the slalom when the average time was greater than 99.25?
CREATE TABLE table_name_5 (slalom INTEGER,average INTEGER)
SELECT AVG(slalom) FROM table_name_5 WHERE average > 99.25
What position does Olaf Kolzig play?
CREATE TABLE table_2897457_1 (position VARCHAR,player VARCHAR)
SELECT position FROM table_2897457_1 WHERE player = "Olaf Kolzig"
What is the average price of the products for each category?
CREATE TABLE products (product_id number,parent_product_id number,product_category_code text,date_product_first_available time,date_product_discontinued time,product_name text,product_description text,product_price number)CREATE TABLE complaints (complaint_id number,product_id number,customer_id number,complaint_outcom...
SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code
how many patients have received a int insert dual-cham dev procedure two times during this year?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,link...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int insert dual-cham ...
how many of these parties currently have no councillors ?
CREATE TABLE table_203_316 (id number,"party" text,"diet representation\nrepresentatives" number,"diet representation\ncouncillors" number,"party leader(s)" text,"comments" text)
SELECT COUNT("party") FROM table_203_316 WHERE "diet representation\ncouncillors" = 0
Who was the Player that spent the Year 2005 in Orlando?
CREATE TABLE table_name_16 (player VARCHAR,years_in_orlando VARCHAR)
SELECT player FROM table_name_16 WHERE years_in_orlando = "2005"
What is Pos., when From Club is 'CSKA Moscow'?
CREATE TABLE table_name_20 (pos VARCHAR,from_club VARCHAR)
SELECT pos FROM table_name_20 WHERE from_club = "cska moscow"
Return the average price for each product type Visualize by bar chart, I want to display by the x axis in descending.
CREATE TABLE Suppliers (supplier_id INTEGER,supplier_name VARCHAR(80),supplier_phone VARCHAR(80))CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER)CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Customers (custome...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
How many episodes when the tv station is ntv and the japanese title is ?
CREATE TABLE table_64496 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Episodes" real,"Average Ratings" text)
SELECT "Episodes" FROM table_64496 WHERE "TV Station" = 'ntv' AND "Japanese Title" = 'たったひとつの恋'
What is the most number of Bronze medals won among the countries that have won more than 1 medal, more than 1 gold medal, and have a rank bigger than 1?
CREATE TABLE table_name_49 (bronze INTEGER,gold VARCHAR,total VARCHAR,rank VARCHAR)
SELECT MAX(bronze) FROM table_name_49 WHERE total > 1 AND rank > 1 AND gold > 1
what is the place when the event is 4000 m individual pursuit?
CREATE TABLE table_name_2 (place VARCHAR,event VARCHAR)
SELECT place FROM table_name_2 WHERE event = "4000 m individual pursuit"
how many patients whose discharge location is snf and primary disease is abdominal pain?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "ABDOMINAL PAIN"
Which event led to a loss against Josh Diekman?
CREATE TABLE table_name_37 (event VARCHAR,res VARCHAR,opponent VARCHAR)
SELECT event FROM table_name_37 WHERE res = "loss" AND opponent = "josh diekman"
Who are the instructors for the hardware courses ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%...
Which Total population (2005 estimate) has a Province of west kalimantan (kalimantan barat), and an Area (km 2) smaller than 147,307.00?
CREATE TABLE table_name_78 (total_population__2005_estimate_ INTEGER,province VARCHAR,area__km_2__ VARCHAR)
SELECT AVG(total_population__2005_estimate_) FROM table_name_78 WHERE province = "west kalimantan (kalimantan barat)" AND area__km_2__ < 147 OFFSET 307.00
What date was the game against inverurie loco works when more than 342 attend?
CREATE TABLE table_9277 ("Date" text,"Opponent" text,"Score" text,"Attendance" real,"Report" text)
SELECT "Date" FROM table_9277 WHERE "Attendance" > '342' AND "Opponent" = 'inverurie loco works'
most popular tags in 2013.
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,DeactivationDat...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsIn2013, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId A...
What is the region 4 release that has july 20, 2009 as the region 2?
CREATE TABLE table_name_99 (region_4_release VARCHAR,region_2_release VARCHAR)
SELECT region_4_release FROM table_name_99 WHERE region_2_release = "july 20, 2009"
what were the five most frequently prescribed drugs to patients who previously received normal saline administration - fluid bolus (250-1000mls) within 2 months until 3 years ago?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,tr...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'normal saline administration - fluid bolus (250-10...
What is Country, when Class / Type is 'Three masted full rigged ship'?
CREATE TABLE table_62319 ("Country" text,"Builder" text,"Location" text,"Ship" text,"Class / type" text)
SELECT "Country" FROM table_62319 WHERE "Class / type" = 'three masted full rigged ship'
which regimen was in the arkansas county
CREATE TABLE table_31158 ("Division" text,"Brigade" text,"Regiment" text,"Colonel" text,"County" text)
SELECT "Regiment" FROM table_31158 WHERE "County" = 'Arkansas'
What are the names of schools with the top 3 largest size?
CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE college (cname text,state text,enr number)CREATE TABLE player (pid number,pname text,ycard text,hs number)
SELECT cname FROM college ORDER BY enr DESC LIMIT 3
What is the average Games, when Player is Robert Hock, and when Goals is less than 24?
CREATE TABLE table_45863 ("Player" text,"Club" text,"Games" real,"Goals" real,"Assists" real,"Points" real)
SELECT AVG("Games") FROM table_45863 WHERE "Player" = 'robert hock' AND "Goals" < '24'
What is the height if ot is the position?
CREATE TABLE table_20871703_1 (height VARCHAR,position VARCHAR)
SELECT height FROM table_20871703_1 WHERE position = "OT"
is there a TW flight from LAS VEGAS to NEW YORK
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 int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE airport_service (city_code ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS ...
Which Release date has a Required OS of windows, a Type of 2d, and a Developer(s) of zeonix?
CREATE TABLE table_name_59 (release_date VARCHAR,developer_s_ VARCHAR,required_os VARCHAR,type VARCHAR)
SELECT release_date FROM table_name_59 WHERE required_os = "windows" AND type = "2d" AND developer_s_ = "zeonix"
All the distinct days on which I created posts.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment tex...
SELECT * FROM Posts
Return a bar chart showing how many members have visited for each college location, show from high to low by the y axis.
CREATE TABLE member (Member_ID int,Name text,Country text,College_ID int)CREATE TABLE round (Round_ID int,Member_ID int,Decoration_Theme text,Rank_in_Round int)CREATE TABLE college (College_ID int,Name text,Leader_Name text,College_Location text)
SELECT College_Location, COUNT(College_Location) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY College_Location ORDER BY COUNT(College_Location) DESC
What is Score, when To Par is greater than 7, when Place is 'T4', and when Player is 'Bob Rosburg'?
CREATE TABLE table_name_38 (score VARCHAR,player VARCHAR,to_par VARCHAR,place VARCHAR)
SELECT score FROM table_name_38 WHERE to_par > 7 AND place = "t4" AND player = "bob rosburg"
Which is the most popular voting method for Hall of Fame in 2000?
CREATE TABLE player (player_id text,birth_year text,birth_month text,birth_day text,birth_country text,birth_state text,birth_city text,death_year text,death_month text,death_day text,death_country text,death_state text,death_city text,name_first text,name_last text,name_given text,weight text)CREATE TABLE player_award...
SELECT votedby FROM hall_of_fame WHERE yearid = "2000" GROUP BY votedby ORDER BY COUNT(*) DESC LIMIT 1
Who was his partner in 1989?
CREATE TABLE table_26309085_1 (partner VARCHAR,year VARCHAR)
SELECT partner FROM table_26309085_1 WHERE year = 1989
What is the 100 year for Carbon Dioxide?
CREATE TABLE table_21350772_2 (gas_name VARCHAR)
SELECT 100 AS _yr FROM table_21350772_2 WHERE gas_name = "Carbon dioxide"
Show the average amount of transactions for different investors.
CREATE TABLE transactions (transaction_id number,investor_id number,transaction_type_code text,date_of_transaction time,amount_of_transaction number,share_count text,other_details text)CREATE TABLE lots (lot_id number,investor_id number,lot_details text)CREATE TABLE transactions_lots (transaction_id number,lot_id numbe...
SELECT investor_id, AVG(amount_of_transaction) FROM transactions GROUP BY investor_id
What's the 1997 if 1993 has a 1R, 1995 has a 3R, and 1999 has a 1R?
CREATE TABLE table_name_99 (Id VARCHAR)
SELECT 1997 FROM table_name_99 WHERE 1999 = "1r" AND 1995 = "3r" AND 1993 = "1r"
tell me the total number of decile with a roll showing 251.
CREATE TABLE table_name_90 (decile VARCHAR,roll VARCHAR)
SELECT COUNT(decile) FROM table_name_90 WHERE roll = 251
provide the number of patients whose admission location is clinic referral/premature and drug name is clindamycin?
CREATE TABLE procedures (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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.drug = "Clindamycin"
Name the number of lost for against being 46
CREATE TABLE table_15319684_1 (lost VARCHAR,against VARCHAR)
SELECT COUNT(lost) FROM table_15319684_1 WHERE against = 46
which representative is from willowick
CREATE TABLE table_29486189_4 (representative VARCHAR,residence VARCHAR)
SELECT representative FROM table_29486189_4 WHERE residence = "Willowick"
What county is Fountain City?
CREATE TABLE table_name_8 (_number___county VARCHAR,location VARCHAR)
SELECT _number___county FROM table_name_8 WHERE location = "fountain city"
What to par has tom kite as the player?
CREATE TABLE table_name_92 (to_par VARCHAR,player VARCHAR)
SELECT to_par FROM table_name_92 WHERE player = "tom kite"
What average bronze has 0 as the silver, 17 as the rank, and a gold less than 1?
CREATE TABLE table_63534 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT AVG("Bronze") FROM table_63534 WHERE "Silver" = '0' AND "Rank" = '17' AND "Gold" < '1'