instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the election year of the president with a Birth State of lost connecticut? | CREATE TABLE table_name_61 (election_year INTEGER,birth_state VARCHAR) | SELECT AVG(election_year) FROM table_name_61 WHERE birth_state = "lost connecticut" |
What is the score for the United States when Harry Hampton is the player and the money is $73? | CREATE TABLE table_79010 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" text) | SELECT "Score" FROM table_79010 WHERE "Country" = 'united states' AND "Money ( $ )" = '73' AND "Player" = 'harry hampton' |
In the tournament that has 15 events, and less than 6 top-25's, how many top-5's did he have? | CREATE TABLE table_name_76 (top_5 INTEGER,events VARCHAR,top_25 VARCHAR) | SELECT SUM(top_5) FROM table_name_76 WHERE events = 15 AND top_25 < 6 |
What is the average laps completed by riders with times of +2:11.524? | CREATE TABLE table_46266 ("Rider" text,"Manufacturer" text,"Laps" real,"Time" text,"Grid" real) | SELECT AVG("Laps") FROM table_46266 WHERE "Time" = '+2:11.524' |
Plot openning year by how many openning year as a trend line, display by the x axis in ascending please. | CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price... | SELECT Openning_year, COUNT(Openning_year) FROM cinema ORDER BY Openning_year |
what is the daily average amount of glucose of patient 025-35599 until 4 years ago? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-35599')) AND lab.labname = 'glucose' AND DATETIME(lab.labresulttime) <= DATETI... |
What is the PCT when the total number of games is less than 944? | CREATE TABLE table_10466 ("Independent" text,"Lost" real,"Tied" real,"Pct." real,"Years" real,"Total Games" real) | SELECT "Pct." FROM table_10466 WHERE "Total Games" < '944' |
Who built the car that ran out of fuel before 28 laps? | CREATE TABLE table_77592 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Constructor" FROM table_77592 WHERE "Laps" < '28' AND "Time/Retired" = 'out of fuel' |
give me the number of patients whose year of birth is less than 2168 and diagnoses short title is rheumatic heart failure? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2168" AND diagnoses.short_title = "Rheumatic heart failure" |
who won the last tourament ? | CREATE TABLE table_204_638 (id number,"year" number,"tournament" text,"surface" text,"round" text,"winner" text,"score" text) | SELECT "winner" FROM table_204_638 ORDER BY "year" DESC LIMIT 1 |
Find the total student enrollment for different affiliation type schools Plot them as bar chart, could you rank in asc by the bar please? | 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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation |
Name the result for mississippi 2 | CREATE TABLE table_1342149_24 (result VARCHAR,district VARCHAR) | SELECT result FROM table_1342149_24 WHERE district = "Mississippi 2" |
Draw a pie chart about the proportion of ACC_Road and the sum of School_ID. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road |
Show me a bar chart for what are the ids and details for all organizations that have grants of more than 6000 dollars? | CREATE TABLE Projects (project_id INTEGER,organisation_id INTEGER,project_details VARCHAR(255))CREATE TABLE Grants (grant_id INTEGER,organisation_id INTEGER,grant_amount DECIMAL(19,4),grant_start_date DATETIME,grant_end_date DATETIME,other_details VARCHAR(255))CREATE TABLE Research_Outcomes (outcome_code VARCHAR(10),ou... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details |
List the cities which have more than 2 airports sorted by the number of airports. | CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,elevation number,iata text,icao text)CREATE TABLE airlines (alid number,name text,iata text,icao text,call... | SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) |
Can you tell me Location Attendance that has the High points of andrew bogut (17)? | CREATE TABLE table_name_98 (location_attendance VARCHAR,high_points VARCHAR) | SELECT location_attendance FROM table_name_98 WHERE high_points = "andrew bogut (17)" |
What is the type for rank 2? | CREATE TABLE table_name_26 (type VARCHAR,rank VARCHAR) | SELECT type FROM table_name_26 WHERE rank = 2 |
who is the tallest delegate ? | CREATE TABLE table_204_20 (id number,"represent" text,"contestant" text,"age" number,"height" text,"hometown" text) | SELECT "contestant" FROM table_204_20 ORDER BY "height" DESC LIMIT 1 |
calculate the maximum days for which patients who died before 2111 stayed in hospital. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2111.0" |
Who wrote the episode with 8.61 million U.S. viewers? | CREATE TABLE table_24648983_1 (written_by VARCHAR,us_viewers__million_ VARCHAR) | SELECT written_by FROM table_24648983_1 WHERE us_viewers__million_ = "8.61" |
How old were Mitchell & Jessica when they danced the Cha-Cha-Cha? | CREATE TABLE table_name_48 (ages VARCHAR,dance VARCHAR,pair VARCHAR) | SELECT ages FROM table_name_48 WHERE dance = "cha-cha-cha" AND pair = "mitchell & jessica" |
Which prerequisite for most classes is offered this semester ? | 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)CREATE TABLE ta (campus_job_id int,student_id int,location var... | SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester... |
What round was the opponent Manny Gamburyan? | CREATE TABLE table_68699 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text) | SELECT "Round" FROM table_68699 WHERE "Opponent" = 'manny gamburyan' |
What is the 2005 value for the 2010 grand slam tournaments? | CREATE TABLE table_name_37 (Id VARCHAR) | SELECT 2005 FROM table_name_37 WHERE 2010 = "grand slam tournaments" |
presence of fever: temperature >= 38 c | CREATE TABLE table_train_24 ("id" int,"systolic_blood_pressure_sbp" int,"do_not_resuscitate_dnr" bool,"temperature" float,"hypotension" bool,"cardiac_arrest" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_24 WHERE temperature > 38 |
CLARCH 856 is taught on what days of the week ? | 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)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,categ... | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... |
On September 10 during Strikeforce: Heavyweight Grand Prix Semifinals, what was the PPV buyrate? | CREATE TABLE table_name_77 (ppv_buyrate VARCHAR,date VARCHAR,event VARCHAR) | SELECT ppv_buyrate FROM table_name_77 WHERE date = "september 10" AND event = "strikeforce: heavyweight grand prix semifinals" |
What is the Quantity of Type 2-4-2t? | CREATE TABLE table_56482 ("Class" text,"Type" text,"Quantity" real,"Date" text,"LNER Class" text) | SELECT SUM("Quantity") FROM table_56482 WHERE "Type" = '2-4-2t' |
Name the school for Season Outcome of loss in first round of div. i playoffs | CREATE TABLE table_name_73 (school VARCHAR,season_outcome VARCHAR) | SELECT school FROM table_name_73 WHERE season_outcome = "loss in first round of div. i playoffs" |
how many patients were newborn and born before the year 2200? | 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 = "NEWBORN" AND demographic.dob_year < "2200" |
What was the record at the game against the Blue Jays with a loss of Batista (0 3)? | CREATE TABLE table_name_22 (record VARCHAR,opponent VARCHAR,loss VARCHAR) | SELECT record FROM table_name_22 WHERE opponent = "blue jays" AND loss = "batista (0–3)" |
Who wrote episode number 28? | CREATE TABLE table_73972 ("No." real,"#" real,"Title" text,"Directed by" text,"Written by" text,"Patient Portrayer" text,"Original air date" text,"Production code" real) | SELECT "Written by" FROM table_73972 WHERE "No." = '28' |
Loss of willis has what record? | CREATE TABLE table_name_52 (record VARCHAR,loss VARCHAR) | SELECT record FROM table_name_52 WHERE loss = "willis" |
User Answers With 0 Score. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)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,Ema... | SELECT Id AS "post_link", Score, Body, CreationDate FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId##' AND Score = 0 ORDER BY CreationDate DESC |
List the number of each company whose office is in the building in a bar chart. | CREATE TABLE Companies (id int,name text,Headquarters text,Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value_billion text)CREATE TABLE Office_locations (building_id int,company_id int,move_in_year int)CREATE TABLE buildings (id int,name text,City text,Height int,Stories int,Status t... | SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name |
Who was the opponent when the result was w24-7? | CREATE TABLE table_name_1 (opponent_number VARCHAR,result VARCHAR) | SELECT opponent_number FROM table_name_1 WHERE result = "w24-7" |
Find the average age and experience working length of journalists working on different role type. | CREATE TABLE news_report (journalist_id number,event_id number,work_type text)CREATE TABLE event (event_id number,date text,venue text,name text,event_attendance number)CREATE TABLE journalist (journalist_id number,name text,nationality text,age text,years_working number) | SELECT AVG(t1.age), AVG(years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type |
What are the ids of documents with the type code CV that do not have expenses. | CREATE TABLE documents (document_id number,document_type_code text,project_id number,document_date time,document_name text,document_description text,other_details text)CREATE TABLE accounts (account_id number,statement_id number,account_details text)CREATE TABLE projects (project_id number,project_details text)CREATE T... | SELECT document_id FROM documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM documents_with_expenses |
How many inches is the barrel length when the rear sight is weaver and the barrel profile is A2? | CREATE TABLE table_12834315_8 (barrel_length VARCHAR,rear_sight VARCHAR,barrel_profile VARCHAR) | SELECT barrel_length FROM table_12834315_8 WHERE rear_sight = "Weaver" AND barrel_profile = "A2" |
what are the two year survival probability of a patient diagnosed with rupture of artery? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE d_icd_procedures (... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... |
What was the home team score when the VFL played at Western Oval? | CREATE TABLE table_name_65 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_65 WHERE venue = "western oval" |
Find the average capacity among rooms in each building with a bar chart, and rank by the bars in ascending. | CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),s... | SELECT building, AVG(capacity) FROM classroom GROUP BY building ORDER BY building |
What are the dates in which the mean sea level pressure was between 30.3 and 31, and count them by a bar chart | CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INT... | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 |
What did you try?' 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 PostLinks (Id number,CreationDate time,PostId number,RelatedPos... | SELECT C.PostId AS "post_link", C.Text, C.CreationDate, C.UserId, U.DisplayName FROM Comments AS C JOIN Users AS U ON C.UserId = U.Id WHERE REPLACE(UPPER(C.Text), ' ', '') = 'WHATDIDYOUTRY?' ORDER BY C.CreationDate |
when did the club Citizen achieve its last top division title? | CREATE TABLE table_22804 ("Club" text,"Position in 2012\u201313" text,"First season in top division" text,"Number of seasons in top division" real,"First season of current spell in top division" text,"Top division titles" real,"Last top division title" text) | SELECT "Last top division title" FROM table_22804 WHERE "Club" = 'Citizen' |
How many claim processing stages are there in total? | CREATE TABLE claims_processing_stages (claim_stage_id number,next_claim_stage_id number,claim_status_name text,claim_status_description text)CREATE TABLE policies (policy_id number,customer_id number,policy_type_code text,start_date time,end_date time)CREATE TABLE claim_headers (claim_header_id number,claim_status_code... | SELECT COUNT(*) FROM claims_processing_stages |
What day was the score for tournament of alcoba a 6 3, 2 6, 7 5? | CREATE TABLE table_name_21 (date VARCHAR,tournament VARCHAR,score VARCHAR) | SELECT date FROM table_name_21 WHERE tournament = "alcobaça" AND score = "6–3, 2–6, 7–5" |
Segment A of heather gems is what netflix episode? | CREATE TABLE table_name_97 (netflix VARCHAR,segment_a VARCHAR) | SELECT netflix FROM table_name_97 WHERE segment_a = "heather gems" |
Get me the number of patients who have private health insurance and are diagnosed with late effects of cerebrovascular disease hemiplegia affecting an unaffected side. | 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,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.short_title = "Late ef-hemplga side NOS" |
how many catalogs were released ? | CREATE TABLE table_204_966 (id number,"region" text,"date" text,"label" text,"format" text,"catalog" text) | SELECT COUNT("catalog") FROM table_204_966 |
How many of the total number of patients have a black/cape verdean ethnic origin? | 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 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,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" |
how many matters require at least one tenth of the existing representatives or senators ? | CREATE TABLE table_203_609 (id number,"#" number,"matters" text,"sections of the constitution allowing their institution" text,"eligible petitioners" text,"type" text) | SELECT COUNT("matters") FROM table_203_609 WHERE "eligible petitioners" = 'at least one tenth of the existing representatives or senators' |
serum creatinine < 1.5 mg / dl for male , and < 1.4 mg / dl for female | CREATE TABLE table_dev_22 ("id" int,"gender" string,"hemoglobin_a1c_hba1c" float,"heart_disease" bool,"cardiovascular_disease" bool,"esophageal_varices" bool,"liver_disease" bool,"diabetes" bool,"serum_creatinine" float,"hypertension" bool,"portal_hypertension" bool,"NOUSE" float) | SELECT * FROM table_dev_22 WHERE (serum_creatinine < 1.5 AND gender = 'male') OR (serum_creatinine < 1.4 AND gender = 'female') |
What is the Nation when the Athlete was emma george, and a Record of 4.58m(15ft0 in)? | CREATE TABLE table_40863 ("Record" text,"Athlete" text,"Nation" text,"Venue" text,"Date" text) | SELECT "Nation" FROM table_40863 WHERE "Athlete" = 'emma george' AND "Record" = '4.58m(15ft0¼in)' |
Name the santee sisseton for morning | CREATE TABLE table_19781 ("English gloss" text,"Santee-Sisseton" text,"Yankton-Yanktonai" text,"Northern Lakota" text,"Southern Lakota" text) | SELECT "Santee-Sisseton" FROM table_19781 WHERE "English gloss" = 'morning' |
what is the average total cost of a hospital, which includes a drug called sodium chloride 0.9% 100 ml pb until 4 years ago? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT AVG(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 medication.patientunitstayid FROM medication WHERE medication.drugname = 'sodium chloride 0.9% 100 ml pb')) AND DATETIME... |
What is the D 42 number when the D 45 is r 16? | CREATE TABLE table_name_6 (d_42_√ VARCHAR,d_45_√ VARCHAR) | SELECT d_42_√ FROM table_name_6 WHERE d_45_√ = "r 16" |
had patient 002-19159 got a diagnosis? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-19159')) |
What time was it when the away team's score was 5.4 (34)? | CREATE TABLE table_20729 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text,"Time" text) | SELECT "Time" FROM table_20729 WHERE "Away team score" = '5.4 (34)' |
What is the mean year of marriage when her age was more than 19 and his age was 30? | CREATE TABLE table_name_6 (year_of_marriage INTEGER,her_age VARCHAR,his_age VARCHAR) | SELECT AVG(year_of_marriage) FROM table_name_6 WHERE her_age > 19 AND his_age = 30 |
Which exaltation has a domicile of Saturn and a fall of Jupiter? | CREATE TABLE table_61789 ("Sign" text,"Domicile" text,"Detriment" text,"Exaltation" text,"Fall" text) | SELECT "Exaltation" FROM table_61789 WHERE "Domicile" = 'saturn' AND "Fall" = 'jupiter' |
Show aircraft names and number of flights for each aircraft with a bar chart, show by the X in ascending. | CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),dep... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name |
give the number of patients whose diagnosis long title is acute on chronic combined systolic and diastolic heart failure. | 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 diagnoses.long_title = "Acute on chronic combined systolic and diastolic heart failure" |
was patient 028-52605 given a diagnosis until 1 year ago? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labres... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-52605')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(... |
hmm.. what was patient 3710's first basophils until 11/2105? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (row_id number,icd9_cod... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3710) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'basophils') AND STRFTIME('%y-%m', labevents.charttime) <= '2105-11' ORDER BY labe... |
Give me a pie to show how many event details from different event details. | CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa... | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details |
what is the maximum number of points? | CREATE TABLE table_14342367_5 (points INTEGER) | SELECT MAX(points) FROM table_14342367_5 |
What is the start of Offy engine and in 1972? | CREATE TABLE table_68547 ("Year" real,"Chassis" text,"Engine" text,"Start" text,"Finish" text,"Entrant" text) | SELECT "Start" FROM table_68547 WHERE "Engine" = 'offy' AND "Year" = '1972' |
how many prescriptions of cephulac took place until 3 years ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'cephulac' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year') |
What are the most Points with an Assist of 46? | CREATE TABLE table_68526 ("Season" text,"League" text,"Winner" text,"Goals" real,"Assists" real,"Points" real) | SELECT MAX("Points") FROM table_68526 WHERE "Assists" = '46' |
with rank of 31 what is the year? | CREATE TABLE table_name_48 (year VARCHAR,rank VARCHAR) | SELECT COUNT(year) FROM table_name_48 WHERE rank = "31" |
Who had the most points in game 81? | CREATE TABLE table_47703 ("Game" real,"Date" text,"Team" text,"High points" text,"High rebounds" text,"Location Attendance" text,"Record" text) | SELECT "High points" FROM table_47703 WHERE "Game" = '81' |
What date has 2006 fifa world cup qualification as the competition, and alamodome, san antonio, united States as the venue? | CREATE TABLE table_75847 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_75847 WHERE "Competition" = '2006 fifa world cup qualification' AND "Venue" = 'alamodome, san antonio, united states' |
How many inches is the barrel length when the rear sight is weaver and the barrel profile is A2? | CREATE TABLE table_17832 ("Colt model no." text,"Diemaco model" text,"Stock" text,"Fire control" text,"Rear sight" text,"Forward assist" text,"Barrel length" text,"Barrel profile" text,"Barrel twist" text,"Hand guards" text,"Bayonet Lug" text,"Muzzle device" text) | SELECT "Barrel length" FROM table_17832 WHERE "Rear sight" = 'Weaver' AND "Barrel profile" = 'A2' |
What score has 33 as the points? | CREATE TABLE table_60764 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text,"Arena" text,"Points" real) | SELECT "Score" FROM table_60764 WHERE "Points" = '33' |
What was the home team's score at Princes Park? | CREATE TABLE table_name_6 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_6 WHERE venue = "princes park" |
provide the number of patients whose language is russ and diagnoses short title is proteus infection nos? | 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.language = "RUSS" AND diagnoses.short_title = "Proteus infection NOS" |
what number of patients were prescribed sodium chloride 0.9% 500 ml lvp within 2 months after receiving a insulin - subcutaneous dose of longer-acting insulin prepara procedure until 2104? | 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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin - subcutaneous dose of longer-acting insulin prepara' AND STRFTIME('%y', treatment.treatmenttime) <=... |
Visualize a pie chart about the proportion of All_Neutral and School_ID. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Neutral, School_ID FROM basketball_match |
Which team has the points category of test driver? | CREATE TABLE table_67181 ("Season" text,"Series" text,"Team" text,"Races" text,"wins" text,"Fast laps" text,"Points" text,"Pos." text) | SELECT "Team" FROM table_67181 WHERE "Points" = 'test driver' |
what are all the date for gt3 winner oliver bryant matt harris | CREATE TABLE table_17969 ("Round" real,"Circuit" text,"Date" text,"Length" text,"Pole Position" text,"GT3 Winner" text,"GTC Winner" text) | SELECT "Date" FROM table_17969 WHERE "GT3 Winner" = 'Oliver Bryant Matt Harris' |
A bar chart groups the lot details, and computes the number of each lot details. | CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Transactions_Lots (transaction_id INTEGER,lot_id INTEGER)CREATE TABLE Lots (lot_id INTEGER,investor_id INTEGER,lot_details VARCHAR(255))CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TA... | SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details |
Name the Intra DC Precision that has the Name main profile? | CREATE TABLE table_name_59 (intra_dc_precision VARCHAR,name VARCHAR) | SELECT intra_dc_precision FROM table_name_59 WHERE name = "main profile" |
What is the date where the home team scores 8.7 (55)? | CREATE TABLE table_32441 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_32441 WHERE "Home team score" = '8.7 (55)' |
What is the p max ( bar ) for the 6876 f bolt ( kgf )? | CREATE TABLE table_26967904_2 (p_max___bar__ INTEGER,f_bolt___kgf__ VARCHAR) | SELECT MIN(p_max___bar__) FROM table_26967904_2 WHERE f_bolt___kgf__ = 6876 |
What is the highest when pohang steelers is the team? | CREATE TABLE table_73344 ("Team" text,"Stadium" text,"Match played" text,"Highest" real,"Lowest" real,"Average" real) | SELECT "Highest" FROM table_73344 WHERE "Team" = 'Pohang Steelers' |
Which gender has an Authority of state, Years of 1 8, and a Decile smaller than 10, and a Roll of 36? | CREATE TABLE table_name_76 (gender VARCHAR,roll VARCHAR,decile VARCHAR,authority VARCHAR,years VARCHAR) | SELECT gender FROM table_name_76 WHERE authority = "state" AND years = "1–8" AND decile < 10 AND roll = 36 |
What is the drew for the 1999-2000 season when they were in third place? | CREATE TABLE table_63924 ("Season" text,"Competition" text,"Round" text,"Played" text,"Drew" text,"Lost" text) | SELECT "Drew" FROM table_63924 WHERE "Round" = 'third place' AND "Season" = '1999-2000' |
How many points did the team that won 5 games make? | CREATE TABLE table_30390 ("Position" real,"Club" text,"Played" real,"Won" real,"Drawn" real,"Lost" real,"Pts For" real,"Pts Agst" real,"Points" real,"Percent" text) | SELECT "Pts For" FROM table_30390 WHERE "Won" = '5' |
give me the number of patients admitted on an emergency basis who had prescription for timolol maleate 0.5%. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Timolol Maleate 0.5%" |
how many countries have remittances in 2008 of 9.07? | CREATE TABLE table_31132 ("Country" text,"Remittances 2008" text,"Remittances 2009" text,"Remittances 2010" text,"Remittances 2011" text) | SELECT COUNT("Country") FROM table_31132 WHERE "Remittances 2008" = '9.07' |
Which Music has a Points Jury of 18 (5,5,4,4)? | CREATE TABLE table_name_32 (music VARCHAR,points_jury VARCHAR) | SELECT music FROM table_name_32 WHERE points_jury = "18 (5,5,4,4)" |
what's the minimum rnd with race italian grand prix | CREATE TABLE table_16733 ("Rnd" real,"Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text) | SELECT MIN("Rnd") FROM table_16733 WHERE "Race" = 'Italian Grand Prix' |
What is the average number of people injured by all perpetrators? | CREATE TABLE perpetrator (Injured INTEGER) | SELECT AVG(Injured) FROM perpetrator |
Name the home port for kansas city | CREATE TABLE table_name_15 (home_port VARCHAR,ship VARCHAR) | SELECT home_port FROM table_name_15 WHERE ship = "kansas city" |
What place was Corey Pavin in? | CREATE TABLE table_69034 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_69034 WHERE "Player" = 'corey pavin' |
compared to last measured on the first hospital visit patient 19059's po2 is greater than the value first measured on the first hospital visit? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,had... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19059 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ... |
What is the number of artists for each gender? | CREATE TABLE artist (gender VARCHAR) | SELECT COUNT(*), gender FROM artist GROUP BY gender |
how much is the average cost of a hospital that involves pressure control in 2105? | 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 AVG(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 lab.patientunitstayid FROM lab WHERE lab.labname = 'pressure control')) AND STRFTIME('%y', cost.chargetime) = '2105' GRO... |
what is the score for the 2010 world cup qualifying? | CREATE TABLE table_name_1 (score VARCHAR,competition VARCHAR) | SELECT score FROM table_name_1 WHERE competition = "2010 world cup qualifying" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.