instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What district is the court located in Tolland? | CREATE TABLE table_26758262_1 (district INTEGER,location_of_court VARCHAR) | SELECT MAX(district) FROM table_26758262_1 WHERE location_of_court = "Tolland" |
Who ran for office at the Georgia 4 district in this election? | CREATE TABLE table_18655 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_18655 WHERE "District" = 'Georgia 4' |
What is the highest Against for a game against Bristol City? | CREATE TABLE table_64410 ("Opposing Team" text,"Against" real,"Date" text,"Venue" text,"Round" text) | SELECT MAX("Against") FROM table_64410 WHERE "Opposing Team" = 'bristol city' |
Questions that formerly had the [rules-as-written] tag. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId numb... | SELECT Posts.Id AS "post_link", Posts.Tags, PostHistory.CreationDate FROM Posts, PostHistory WHERE Posts.Id = PostHistory.PostId AND NOT Posts.Tags LIKE '%<rules-as-written>%' AND PostHistory.Text LIKE '%<rules-as-written>%' ORDER BY Posts.Id DESC, PostHistory.CreationDate |
i'd like a flight from KANSAS CITY to LOS ANGELES that arrives in LOS ANGELES in the late afternoon | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE equipment_sequence (aircraft_cod... | 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 ((flight.arrival_time <= 1800 AND flight.arrival_time >= 1600) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND flight... |
count the number of patients whose admission type is elective and days of hospital stay is greater than 11? | 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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay > "11" |
Show the number of courses each instructor taught in a bar chart, and rank y-axis from high to low order. | CREATE TABLE ENROLL (CLASS_CODE varchar(5),STU_NUM int,ENROLL_GRADE varchar(50))CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeric,DEPT_CODE varchar(18),STU_PHONE varchar(4),PROF_NUM in... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC |
What is the average lane racheal nachula has when the heat is less than 2? | CREATE TABLE table_8896 ("Heat" real,"Lane" real,"Name" text,"Country" text,"Mark" text) | SELECT AVG("Lane") FROM table_8896 WHERE "Heat" < '2' AND "Name" = 'racheal nachula' |
The pink cytoplasm will have a nucleus of what color? | CREATE TABLE table_817 ("Stain" text,"Common use" text,"Nucleus" text,"Cytoplasm" text,"Red blood cell (RBC)" text,"Collagen fibers" text,"Specifically stains" text) | SELECT "Nucleus" FROM table_817 WHERE "Cytoplasm" = 'Pink' |
A pie chart for finding the number of the physicians who are trained in a procedure that costs more than 5000. | CREATE TABLE Medication (Code INTEGER,Name VARCHAR(30),Brand VARCHAR(30),Description VARCHAR(30))CREATE TABLE Physician (EmployeeID INTEGER,Name VARCHAR(30),Position VARCHAR(30),SSN INTEGER)CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,PrimaryAffiliation BOOLEAN)CREATE TABLE Procedures (Code INTEGE... | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name |
What is the easiest class that I can take in order to fulfill the PreMajor requirement ? | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instru... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra... |
Show me about the distribution of All_Games and Team_ID in a bar chart, and order by the bars from low to high please. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT All_Games, Team_ID FROM basketball_match ORDER BY All_Games |
When the Vancouver Canucks were visiting, what was the record when the score was 4-2? | CREATE TABLE table_name_6 (record VARCHAR,score VARCHAR,visitor VARCHAR) | SELECT record FROM table_name_6 WHERE score = "4-2" AND visitor = "vancouver canucks" |
Count the number of unmarried patients who have an american indian/alaska native ethnic background. | 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 WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" |
What title was watched by 3.8 million US viewers? | CREATE TABLE table_26448179_3 (title VARCHAR,us_viewers__millions_ VARCHAR) | SELECT title FROM table_26448179_3 WHERE us_viewers__millions_ = "3.8" |
Which opponent had the result of W 24-14? | CREATE TABLE table_32709 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Attendance" text) | SELECT "Opponent" FROM table_32709 WHERE "Result" = 'w 24-14' |
What is the earliest year it was located in gelredome, arnhem, and a Anthem of technoboy - next dimensional world? | CREATE TABLE table_name_74 (year INTEGER,location VARCHAR,anthem VARCHAR) | SELECT MIN(year) FROM table_name_74 WHERE location = "gelredome, arnhem" AND anthem = "technoboy - next dimensional world" |
For those records from the products and each product's manufacturer, give me the comparison about price over the name , and group by attribute name by a bar chart, and list by the bars in desc. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC |
what were the three most commonly prescribed medication for patients that had been previously prescribed with multivitamin iv during the same month since 2104? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_tit... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'multivitamin iv' AND STRFTIME('%y', prescriptions.startdate) >= '... |
What tms were built nzr addington in the year 1913 | CREATE TABLE table_17023 ("Number" text,"TMS Number" text,"Builder" text,"Year built" real,"Carriage type" text) | SELECT "TMS Number" FROM table_17023 WHERE "Builder" = 'NZR Addington' AND "Year built" = '1913' |
who was the next opponent after san francisco 49ers ? | CREATE TABLE table_203_383 (id number,"week" number,"date" text,"opponent" text,"time" text,"game site" text,"tv" text,"result/score" text,"record" text,"bye" text) | SELECT "opponent" FROM table_203_383 WHERE "date" > (SELECT "date" FROM table_203_383 WHERE "opponent" = 'san francisco 49ers') ORDER BY "date" LIMIT 1 |
How many winners did Halcones uv xalapa have? | CREATE TABLE table_34265 ("Team" text,"Winners" text,"Runners-Up" text,"Third Place" text,"Fourth Place" text) | SELECT "Winners" FROM table_34265 WHERE "Team" = 'halcones uv xalapa' |
Top 1000 users in thailand. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Thailand%' LIMIT 1000 |
provide the number of patients whose age is less than 56 and drug name is insulin human regular? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "56" AND prescriptions.drug = "Insulin Human Regular" |
count the number of patients who have already received the ferrous iron compound two or more times since 2102. | 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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'ferrous iron compound' AND STRFTIME('%y', treatment.treatmenttime) >= '2102') GROUP BY patient.uniquepid) ... |
What is the name of the company that constructed the vehicle for Timo Glock? | CREATE TABLE table_name_15 (constructor VARCHAR,driver VARCHAR) | SELECT constructor FROM table_name_15 WHERE driver = "timo glock" |
What district had someone first elected in 1932? | CREATE TABLE table_1342292_4 (district VARCHAR,first_elected VARCHAR) | SELECT district FROM table_1342292_4 WHERE first_elected = 1932 |
what is maximum age of patients whose marital status is married and discharge location is rehab/distinct part hosp? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP" |
What is the paper of both Convolution and Combinatoric ? | CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename ... | SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Convolution', 'Combinatoric') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1 |
A bar chart for what is the number of locations of the wrestlers, and sort by the x-axis in descending. | 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 ORDER BY Location DESC |
which artist 's song scored the least amount of points , diana or kali ? | CREATE TABLE table_203_803 (id number,"draw" number,"country" text,"language" text,"artist" text,"song" text,"english translation" text,"place" number,"points" number) | SELECT "artist" FROM table_203_803 WHERE "artist" IN ('dina', 'kali') ORDER BY "points" LIMIT 1 |
let's count the number of patients who received a entral infus nutrit sub procedure within 2 months after receiving a contrast aortogram procedure until 2104. | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inp... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime 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 = 'contrast ao... |
How many people led in points during the game on October 5? | CREATE TABLE table_27698941_2 (high_points VARCHAR,date VARCHAR) | SELECT COUNT(high_points) FROM table_27698941_2 WHERE date = "October 5" |
How many rooms have king beds? Report the number for each decor type Plot them as bar chart, show X from low to high order. | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY decor |
Open and Closed questions per tag. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE TagS... | SELECT COALESCE(c.TargetTagName, b.TargetTagName, a.TargetTagName, Tags.TagName) AS "tagname", COUNT(Posts.ClosedDate) AS closed, COUNT(*) - COUNT(Posts.ClosedDate) AS "open" FROM Posts JOIN PostTags ON (Posts.Id = PostTags.PostId) JOIN Tags ON (PostTags.TagId = Tags.Id) LEFT JOIN TagSynonyms AS a ON (Tags.TagName = a.... |
count the number of patients that were diagnosed since 3 years ago with oth/uns inf-cen ven cath. | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum ... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth/uns inf-cen ven cath') AND DATETIME(diagnoses_icd.char... |
What was the lowest year that the engine Ilmor 2175a 3.5 v10 was used? | CREATE TABLE table_name_64 (year INTEGER,engine VARCHAR) | SELECT MIN(year) FROM table_name_64 WHERE engine = "ilmor 2175a 3.5 v10" |
How many wins has more than 165 against? | CREATE TABLE table_58658 ("Matches" real,"Wins" real,"Draw" real,"Losses" real,"Against" real) | SELECT MAX("Wins") FROM table_58658 WHERE "Against" > '165' |
Who is the player from the United States with a score of 71-72=143? | CREATE TABLE table_43749 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Player" FROM table_43749 WHERE "Country" = 'united states' AND "Score" = '71-72=143' |
Which september 26 28, 2011 polling firm had a Link of html, less than 36 liberals, and less than 8 green? | CREATE TABLE table_name_96 (polling_firm VARCHAR,date_of_polling VARCHAR,green VARCHAR,link VARCHAR,liberal VARCHAR) | SELECT polling_firm FROM table_name_96 WHERE link = "html" AND liberal < 36 AND green < 8 AND date_of_polling = "september 26–28, 2011" |
What was 1948's pick? | CREATE TABLE table_name_72 (pick VARCHAR,year VARCHAR) | SELECT pick FROM table_name_72 WHERE year = 1948 |
What driver shows grid as 18? | CREATE TABLE table_name_95 (driver VARCHAR,grid VARCHAR) | SELECT driver FROM table_name_95 WHERE grid = 18 |
Top 1000 Users in India. | 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,Ans... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 1000 |
Which venue has Tickets Sold/ Available with a Gross Revenue (1979) of $665,232? | CREATE TABLE table_name_26 (tickets_sold___available VARCHAR,gross_revenue__1979_ VARCHAR) | SELECT tickets_sold___available FROM table_name_26 WHERE gross_revenue__1979_ = "$665,232" |
What is Candidate Name, when Target/Approach is 'vaccine to amyloid-beta'? | CREATE TABLE table_76644 ("Target/Approach" text,"Candidate Name" text,"Trial Phase" text,"Trial Start Date" text,"Expected End Date" text) | SELECT "Candidate Name" FROM table_76644 WHERE "Target/Approach" = 'vaccine to amyloid-beta' |
Can you tell me the Matches that has the Rank smaller than 6, and the Years of 1943-62? | CREATE TABLE table_40896 ("Rank" real,"Name" text,"Years" text,"Matches" text,"Goals" real) | SELECT "Matches" FROM table_40896 WHERE "Rank" < '6' AND "Years" = '1943-62' |
What model has an engine of 1,868 cc? | CREATE TABLE table_name_33 (model VARCHAR,displacement VARCHAR) | SELECT model FROM table_name_33 WHERE displacement = "1,868 cc" |
calculate the five year survival rate among the patients who were prescribed protonix after they were diagnosed with hypokalemia - severe ( < 2.8 meq/dl). | 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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... |
What was the location of the bout that lasted 5:00 and led to a 6-2-1 record? | CREATE TABLE table_37136 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Location" FROM table_37136 WHERE "Time" = '5:00' AND "Record" = '6-2-1' |
What are the active pixels of the cantare model? | CREATE TABLE table_name_10 (active_pixels VARCHAR,model VARCHAR) | SELECT active_pixels FROM table_name_10 WHERE model = "cantare" |
What tags have the highest percentage of 'rookies' asking questions?. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE CloseAsOff... | SELECT t.TagName, COUNT(p.Id) AS question_count, SUM(CASE WHEN u.Reputation <= 10 THEN 1.000 ELSE 0.000 END) AS low_rep, AVG(CASE WHEN u.Reputation <= 10 THEN 1.000 ELSE 0.000 END) AS low_rep_pct FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags ... |
what was the name of the drug prescribed to patient 7112, two or more times during this month? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_i... | 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 = 7112) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 m... |
What match was on 30 january 1938? | CREATE TABLE table_57881 ("Season" text,"Match" text,"Result" text,"League" text,"Date" text) | SELECT "Match" FROM table_57881 WHERE "Date" = '30 january 1938' |
what are all the Canadian air dates where the u.s. air date is may 1, 2009 | CREATE TABLE table_12294557_3 (canadian_airdate VARCHAR,us_airdate VARCHAR) | SELECT canadian_airdate FROM table_12294557_3 WHERE us_airdate = "May 1, 2009" |
Name the district for anti-jacksonian | CREATE TABLE table_2668243_18 (district VARCHAR,party VARCHAR) | SELECT district FROM table_2668243_18 WHERE party = "Anti-Jacksonian" |
Name the representative for party of whig | CREATE TABLE table_name_76 (representative VARCHAR,party VARCHAR) | SELECT representative FROM table_name_76 WHERE party = "whig" |
What was the reating share when the total viewers was 11.49 million? | CREATE TABLE table_23793770_2 (rating VARCHAR,total_viewers__in_millions_ VARCHAR) | SELECT rating / SHARE(18 AS –49) FROM table_23793770_2 WHERE total_viewers__in_millions_ = "11.49" |
Which site has the CERCLIS ID fld004092532? | CREATE TABLE table_name_88 (name VARCHAR,cerclis_id VARCHAR) | SELECT name FROM table_name_88 WHERE cerclis_id = "fld004092532" |
How many years have HMOs been 27% and POS plans 18%? | CREATE TABLE table_7110 ("Year" real,"Conventional plans" text,"HMOs" text,"PPOs" text,"POS plans" text) | SELECT COUNT("Year") FROM table_7110 WHERE "HMOs" = '27%' AND "POS plans" = '18%' |
Which team had fewer than 167 points in the 250cc class? | CREATE TABLE table_69840 ("Year" real,"Class" text,"Team" text,"Points" real,"Rank" text,"Wins" real) | SELECT "Team" FROM table_69840 WHERE "Points" < '167' AND "Class" = '250cc' |
What is the average for the team with highest less than 13,500 and games played are fewer than 5? | CREATE TABLE table_65492 ("Team" text,"Played" real,"Highest" real,"Lowest" real,"Total" real,"Average" real) | SELECT MIN("Average") FROM table_65492 WHERE "Highest" < '13,500' AND "Played" < '5' |
A bar chart for what are the number of the dates when customers with ids between 10 and 20 became customers? | CREATE TABLE Products (product_id INTEGER,product_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),date_became_customer DATETIME,other_customer_details VARCHAR(255))CREATE TABLE Addresses (address_id INTEGER,address_content VARCHAR(80),city VARCHAR(50... | SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 |
Find the attribute data type for the attribute named 'Green'. | CREATE TABLE catalog_contents_additional_attributes (catalog_entry_id number,catalog_level_number number,attribute_id number,attribute_value text)CREATE TABLE attribute_definitions (attribute_id number,attribute_name text,attribute_data_type text)CREATE TABLE catalog_contents (catalog_entry_id number,catalog_level_numb... | SELECT attribute_data_type FROM attribute_definitions WHERE attribute_name = "Green" |
Who was the opponent on December 17, 1995? | CREATE TABLE table_69934 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Opponent" FROM table_69934 WHERE "Date" = 'december 17, 1995' |
How many events did clay win? | CREATE TABLE table_name_42 (COUNT VARCHAR,winner VARCHAR) | SELECT NOT COUNT AS event FROM table_name_42 WHERE winner = "clay" |
What is the avererage decile of Francis Douglas Memorial College? | CREATE TABLE table_name_74 (decile INTEGER,name VARCHAR) | SELECT AVG(decile) FROM table_name_74 WHERE name = "francis douglas memorial college" |
Which Cover model has a Pictorials of brande roderick-pmoy, naked news? | CREATE TABLE table_name_56 (cover_model VARCHAR,pictorials VARCHAR) | SELECT cover_model FROM table_name_56 WHERE pictorials = "brande roderick-pmoy, naked news" |
let me know the birth date of patient kelly gallardo. | 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 diagnoses (subject_id text,hadm_id tex... | SELECT demographic.dob FROM demographic WHERE demographic.name = "Kelly Gallardo" |
What is the monounsaturated fat with a smoke point of c (), a total fat of 100g, 11g of polyunsaturated fat, and 14g of saturated fat? | CREATE TABLE table_63511 ("Total fat" text,"Saturated fat" text,"Monounsaturated fat" text,"Polyunsaturated fat" text,"Smoke point" text) | SELECT "Monounsaturated fat" FROM table_63511 WHERE "Smoke point" = '°c ()' AND "Total fat" = '100g' AND "Polyunsaturated fat" = '11g' AND "Saturated fat" = '14g' |
What is his record for fights that went over 2 rounds in the Event of raging wolf 6: mayhem in the mist? | CREATE TABLE table_51951 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Record" FROM table_51951 WHERE "Round" > '2' AND "Event" = 'raging wolf 6: mayhem in the mist' |
when did patient 031-19622 until 05/2105 receive bronchial lavage microbiology test for the last time? | 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 medication (medicationid number,patientunitstayid number,drugname text,dos... | 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-19622')) AND microlab.culturesite = 'bronchial lavage' AND ST... |
How many times did anderson university leave? | CREATE TABLE table_17013 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Nickname" text,"Joined" real,"Left" real,"Current Conference" text) | SELECT COUNT("Left") FROM table_17013 WHERE "Institution" = 'Anderson University' |
A pie chart for what are the number of the names of the workshop groups that have bookings with status code 'stop'? | CREATE TABLE Invoices (Invoice_ID INTEGER,Order_ID INTEGER,payment_method_code CHAR(15),Product_ID INTEGER,Order_Quantity VARCHAR(288),Other_Item_Details VARCHAR(255),Order_Item_ID INTEGER)CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15),Workshop_Group_ID INTEGER,Product_Description VARCHAR(255),Pro... | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name |
when Casey Martin's best finish was t-65, where did he land in the money list rankings? | CREATE TABLE table_1697190_2 (money_list_rank VARCHAR,best_finish VARCHAR) | SELECT money_list_rank FROM table_1697190_2 WHERE best_finish = "T-65" |
what is the totality of patient 27591's input until 1567 days ago? | 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (r... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27591)) AND DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-1567 day') |
What is Record, when Game is '36'? | CREATE TABLE table_name_79 (record VARCHAR,game VARCHAR) | SELECT record FROM table_name_79 WHERE game = 36 |
anemia ( hemoglobin < 11 g / dl in female , < 12 g / dl in male ) or known coagulopathy | CREATE TABLE table_dev_53 ("id" int,"anemia" bool,"gender" string,"hemoglobin_a1c_hba1c" float,"dyslipidemia" bool,"hct" int,"hematocrit_hct" float,"persistent_macroalbuminuria" bool,"urine_albumin" int,"high_density_lipoprotein_cholesterol_hdl_c" int,"coagulopathy" bool,"NOUSE" float) | SELECT * FROM table_dev_53 WHERE anemia = 1 OR (hemoglobin_a1c_hba1c < 11 AND gender = 'female') OR (hemoglobin_a1c_hba1c < 12 AND gender = 'male') OR coagulopathy = 1 |
What day withdrawn is associated with fleet numbers of 12, 25, 42 46, 50, 70 71, 74 77, 106 107, 129? | CREATE TABLE table_name_96 (date_withdrawn VARCHAR,fleet_numbers VARCHAR) | SELECT date_withdrawn FROM table_name_96 WHERE fleet_numbers = "12, 25, 42–46, 50, 70–71, 74–77, 106–107, 129" |
how many countries have one more than 10 gold medals ? | CREATE TABLE table_203_497 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT COUNT("nation") FROM table_203_497 WHERE "gold" > 10 |
Bar chart x axis other details y axis resident_id, sort by the bars from low to high please. | CREATE TABLE Residents_Services (resident_id INTEGER,service_id INTEGER,date_moved_in DATETIME,property_id INTEGER,date_requested DATETIME,date_provided DATETIME,other_details VARCHAR(255))CREATE TABLE Residents (resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME,date_moved_out DATETIME,other_details VARCHA... | SELECT other_details, resident_id FROM Residents ORDER BY other_details |
Which Year has a Location of dinas on 13 january? | CREATE TABLE table_name_86 (year VARCHAR,location VARCHAR,date VARCHAR) | SELECT year FROM table_name_86 WHERE location = "dinas" AND date = "13 january" |
What was the Score in Final on February 19, 1989? | CREATE TABLE table_34648 ("Date" text,"Tournament Name" text,"Location" text,"Partner" text,"Score in Final" text) | SELECT "Score in Final" FROM table_34648 WHERE "Date" = 'february 19, 1989' |
What is the latest first elected? | CREATE TABLE table_28945 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT MAX("First elected") FROM table_28945 |
What document types do have more than 10000 total access number. | CREATE TABLE document_functional_areas (document_code text,functional_area_code text)CREATE TABLE images (image_id number,image_alt_text text,image_name text,image_url text)CREATE TABLE document_sections_images (section_id number,image_id number)CREATE TABLE functional_areas (functional_area_code text,parent_functional... | SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000 |
Which Gothic Letter has Proto-Germanic origin of / /; /b/? | CREATE TABLE table_14071 ("Gothic Letter" text,"Roman" text,"Sound (phoneme)" text,"Sound (allophone)" text,"Proto-Germanic origin" text) | SELECT "Gothic Letter" FROM table_14071 WHERE "Proto-Germanic origin" = '/ɸ/; /b/' |
During which round was a Hawkeyes player selected for the defensive back position? | CREATE TABLE table_name_87 (round VARCHAR,position VARCHAR) | SELECT round FROM table_name_87 WHERE position = "defensive back" |
For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the founder , and group by attribute founder. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder |
Which Rank has a Reaction time larger than 0.20400000000000001, and a Time larger than 45.56? | CREATE TABLE table_name_98 (rank INTEGER,react VARCHAR,time VARCHAR) | SELECT MAX(rank) FROM table_name_98 WHERE react > 0.20400000000000001 AND time > 45.56 |
What is the D44 when D43 is R 14? | CREATE TABLE table_69287 ("D 41" text,"D 42" text,"D 43" text,"D 44" text,"D 45" text,"D 46" text,"D 47" text,"D 48" text) | SELECT "D 44" FROM table_69287 WHERE "D 43" = 'r 14' |
how many patients whose admission location is phys referral/normal deli and admission year is less than 2176? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2176" |
Which position is player bernie doan? | CREATE TABLE table_24975 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Position" FROM table_24975 WHERE "Player" = 'Bernie Doan' |
Name the least tied | CREATE TABLE table_20328 ("Year" real,"Matches" real,"Wins" real,"Losses" real,"No Result" real,"Tied" real,"Success Rate" text,"Position" text,"Summary" text) | SELECT MIN("Tied") FROM table_20328 |
What is the sum of the position with less than 0 draws? | CREATE TABLE table_name_39 (position INTEGER,draws INTEGER) | SELECT SUM(position) FROM table_name_39 WHERE draws < 0 |
Who lost the game with a record of 20-13? | CREATE TABLE table_name_41 (loss VARCHAR,record VARCHAR) | SELECT loss FROM table_name_41 WHERE record = "20-13" |
What season did he have 7 appearances? | CREATE TABLE table_71133 ("Season" text,"Club" text,"Country" text,"Competition" text,"Apps." real,"Goals" real) | SELECT "Season" FROM table_71133 WHERE "Apps." = '7' |
What is the bandwidth for downstream of 20 mbit/s for 69 tl? | CREATE TABLE table_17304621_14 (bandwidth VARCHAR,downstream VARCHAR,price_tl VARCHAR) | SELECT bandwidth FROM table_17304621_14 WHERE downstream = "20 Mbit/s" AND price_tl = "69 TL" |
Hiw many losses have 30 for the goals with points greater than 24? | CREATE TABLE table_name_71 (losses VARCHAR,goals_for VARCHAR,points VARCHAR) | SELECT COUNT(losses) FROM table_name_71 WHERE goals_for = 30 AND points > 24 |
What is the scale of sv_health with a word number smaller than 4? | CREATE TABLE table_53617 ("Subframe #" real,"Page #" text,"Name" text,"Word #" real,"Bits" text,"Scale" text,"Signed" text) | SELECT "Scale" FROM table_53617 WHERE "Word #" < '4' AND "Name" = 'sv_health' |
Which courses in Readings meet the MDE need ? | 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 i... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Readings%' OR course.description LIKE '%Readings%' OR course.name LIKE '%Readings%') AND program... |
What college did the player who had the position of OT come from who was pick number less than 12 and a overall pick number bigger than 226? | CREATE TABLE table_45975 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT "College" FROM table_45975 WHERE "Overall" > '226' AND "Pick" < '12' AND "Position" = 'ot' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.