instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which currency has a central rate of 3.45280? | CREATE TABLE table_name_45 (currency VARCHAR,central_rate VARCHAR) | SELECT currency FROM table_name_45 WHERE central_rate = "3.45280" |
How many king beds are there? | CREATE TABLE Rooms (beds INTEGER,bedtype VARCHAR) | SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King' |
What's the production code of the episode seen by 7.49 million people in the US? | CREATE TABLE table_23242950_1 (production_code VARCHAR,us_viewers__millions_ VARCHAR) | SELECT production_code FROM table_23242950_1 WHERE us_viewers__millions_ = "7.49" |
What is the enrollment of the university established in or after 2011? | CREATE TABLE table_50925 ("Institution" text,"Location" text,"Nickname" text,"Enrollment" real,"Established" real) | SELECT "Enrollment" FROM table_50925 WHERE "Established" > '2011' |
Who won the Modena circuit? | CREATE TABLE table_1140116_5 (winning_driver VARCHAR,circuit VARCHAR) | SELECT winning_driver FROM table_1140116_5 WHERE circuit = "Modena" |
Loss of finley (8-7) had what record? | CREATE TABLE table_name_99 (record VARCHAR,loss VARCHAR) | SELECT record FROM table_name_99 WHERE loss = "finley (8-7)" |
What is the soap opera that has a duration of 13 years, with marina giulia cavalli as the actor? | CREATE TABLE table_name_84 (soap_opera VARCHAR,duration VARCHAR,actor VARCHAR) | SELECT soap_opera FROM table_name_84 WHERE duration = "13 years" AND actor = "marina giulia cavalli" |
what was the total number of goals scored by all of the national team players in the 1947/1948 season ? | CREATE TABLE table_203_121 (id number,"name" text,"pos." text,"caps" number,"goals" number,"club" text) | SELECT SUM("goals") FROM table_203_121 |
What courses can be taken for PreMajor next semester ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,r... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.prog... |
Draw a bar chart about the distribution of Team_Name and All_Games_Percent . | 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 Team_Name, All_Games_Percent FROM basketball_match |
With a score of 2-2, what was the Result? | CREATE TABLE table_name_30 (result VARCHAR,score VARCHAR) | SELECT result FROM table_name_30 WHERE score = "2-2" |
what is maximum age of patients whose ethnicity is hispanic/latino - puerto rican and days of hospital stay is 14? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay = "14" |
what's the team with stadium being borough briggs | CREATE TABLE table_19059 ("Team" text,"Stadium" text,"Capacity" real,"Highest" real,"Lowest" real,"Average" real) | SELECT "Team" FROM table_19059 WHERE "Stadium" = 'Borough Briggs' |
Which Fuel has an Output of ps (kw; hp) @6000 rpm? | CREATE TABLE table_60124 ("Name" text,"Volume" text,"Engine" text,"Fuel" text,"Output" text,"Torque" text,"Engine ID code(s)" text,"0\u2013100km/h,s" real,"Top speed" text,"CO 2" text,"Years" text) | SELECT "Fuel" FROM table_60124 WHERE "Output" = 'ps (kw; hp) @6000 rpm' |
How many Professors are in building NEB? | CREATE TABLE Faculty (Rank VARCHAR,building VARCHAR) | SELECT COUNT(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB" |
What is the capacity for the arena in Chester? | CREATE TABLE table_55105 ("Team" text,"City/Area" text,"Arena" text,"Capacity" text,"Last season" text) | SELECT "Capacity" FROM table_55105 WHERE "City/Area" = 'chester' |
how many episodes only had one performer ? | CREATE TABLE table_203_784 (id number,"no. in\nseries" number,"no. in\nseason" number,"performer" text,"appearance" text,"air date" text) | SELECT COUNT(*) FROM table_203_784 |
Which driver for Bob Holden Motors has fewer than 36 points and placed 7 in race 1? | CREATE TABLE table_name_80 (driver VARCHAR,race_1 VARCHAR,points VARCHAR,team VARCHAR) | SELECT driver FROM table_name_80 WHERE points < 36 AND team = "bob holden motors" AND race_1 = "7" |
What's the losing bonus count for the club with 9 won games? | CREATE TABLE table_14070062_3 (losing_bonus VARCHAR,won VARCHAR) | SELECT losing_bonus FROM table_14070062_3 WHERE won = "9" |
What is the total when the name is Carl Robinson Category:Articles with hcards? | CREATE TABLE table_name_15 (total VARCHAR,name VARCHAR) | SELECT total FROM table_name_15 WHERE name = "carl robinson category:articles with hcards" |
What is the maximum points received when Peeter V hl gave a 9? | CREATE TABLE table_29261215_4 (points INTEGER,peeter_vähi VARCHAR) | SELECT MIN(points) FROM table_29261215_4 WHERE peeter_vähi = 9 |
What is the smallest numbered episode in the series listed? | CREATE TABLE table_29630 ("#" real,"No." real,"Title" text,"Directed by" text,"Written by" text,"Viewers" real,"Original airdate" text,"Prod. code" real) | SELECT MIN("#") FROM table_29630 |
Calculate the average amount for all the payments processed with Visa of each day of week using a bar chart, and display y-axis in asc order. | CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER)CREATE TABLE Payments (Payment_ID INTEGER,Settlement_ID INTEGER,Payment_Method_Code VARCHAR(255),Da... | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY AVG(Amount_Payment) |
Find the name and credit score of the customers who have some loans. | CREATE TABLE loan (cust_id VARCHAR)CREATE TABLE customer (cust_name VARCHAR,credit_score VARCHAR,cust_id VARCHAR) | SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id |
Who is the away team that played home team Hawthorn? | CREATE TABLE table_58195 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_58195 WHERE "Home team" = 'hawthorn' |
In what venue was the hosted away team Essendon? | CREATE TABLE table_name_59 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_59 WHERE away_team = "essendon" |
children under the age of 18 will not be included in this study | CREATE TABLE table_train_10 ("id" int,"severe_sepsis" bool,"consent" bool,"raising_legs_or_head" bool,"intention_to_arterial_catheter" bool,"allergy_to_adhesive" bool,"intention_to_central_venous_catheter" bool,"septic_shock" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_10 WHERE age >= 18 |
Which school is located in the hometown of Centerville, Ohio? | CREATE TABLE table_11677691_9 (school VARCHAR,hometown VARCHAR) | SELECT school FROM table_11677691_9 WHERE hometown = "Centerville, Ohio" |
which other ship was launched in the same year as the wave victor ? | CREATE TABLE table_203_313 (id number,"name" text,"pennant" text,"builder" text,"launched" text,"original name" text,"fate" text) | SELECT "name" FROM table_203_313 WHERE "name" <> 'wave victor' AND "launched" = (SELECT "launched" FROM table_203_313 WHERE "name" = 'wave victor') |
how many patients underwent lymphs lab test? | 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 lab.label = "Lymphs" |
What 1935 has 4 as a 1953? | CREATE TABLE table_name_6 (Id VARCHAR) | SELECT 1935 FROM table_name_6 WHERE 1953 = "4" |
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the average of salary bin hire_date by weekday, rank by the mean salary from high to low please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC |
Draw a bar chart about the distribution of Name and Height , and rank y-axis in descending order. | CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real) | SELECT Name, Height FROM people ORDER BY Height DESC |
Who was the trainer when Crowd Pleaser won? | CREATE TABLE table_68179 ("Year" real,"Winner" text,"Jockey" text,"Trainer" text,"Owner" text,"Distance (Miles)" text,"Time" text) | SELECT "Trainer" FROM table_68179 WHERE "Winner" = 'crowd pleaser' |
What is the part 2 entry for class 3a? | CREATE TABLE table_name_36 (part_2 VARCHAR,class VARCHAR) | SELECT part_2 FROM table_name_36 WHERE class = "3a" |
Return the average price for each product type by a pie chart. | CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER)CREATE TABLE Products (product_id INTEGER,product_type_code VARCHAR(10),product_name VARCHAR(80),product_price DECIMAL(19,4))CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CRE... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and manufacturer , and group by attribute name. | 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name |
What date did season 12 premiere? | CREATE TABLE table_28768 ("Season #" real,"Series #" real,"Episode title" text,"Original air date" text,"Nick prod. #" real) | SELECT "Original air date" FROM table_28768 WHERE "Season #" = '12' |
when0 100km/h (60mph) is 5.5 seconds (5.2), whats is the top speed? | CREATE TABLE table_27083 ("Year" real,"Engine" text,"Power" text,"Torque" text,"Transmission" text,"0\u2013100km/h (60mph)" text,"Top speed" text,"CO2" text) | SELECT "Top speed" FROM table_27083 WHERE "0\u2013100km/h (60mph)" = '5.5 seconds (5.2)' |
The Core classes , who is teaching them next Winter ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,studen... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... |
impaired renal function with a creatinine level > 1.5 . | CREATE TABLE table_train_236 ("id" int,"renal_disease" bool,"creatinine_clearance_cl" float,"estimated_glomerular_filtration_rate_egfr" int,"hba1c" float,"fbg" int,"NOUSE" float) | SELECT * FROM table_train_236 WHERE renal_disease = 1 AND creatinine_clearance_cl > 1.5 |
Which department has the lowest budget? | CREATE TABLE department (dept_name VARCHAR,budget VARCHAR) | SELECT dept_name FROM department ORDER BY budget LIMIT 1 |
how many patients had oxyc10 as their drug code? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "OXYC10" |
What is the name of the swimmer in lane 6? | CREATE TABLE table_name_87 (name VARCHAR,lane VARCHAR) | SELECT name FROM table_name_87 WHERE lane = 6 |
What is the number of 'to par' in Mexico with a winning score of 67-67-69-70=273? | CREATE TABLE table_13388681_1 (to_par VARCHAR,country VARCHAR,winning_score VARCHAR) | SELECT to_par FROM table_13388681_1 WHERE country = "Mexico" AND winning_score = 67 - 67 - 69 - 70 = 273 |
What is Goals, when Assists is greater than 28, and when Player is Steve Walker? | CREATE TABLE table_45862 ("Player" text,"Club" text,"Games" real,"Goals" real,"Assists" real,"Points" real) | SELECT "Goals" FROM table_45862 WHERE "Assists" > '28' AND "Player" = 'steve walker' |
Use a stacked bar chart to show how many films for each title and each type. The x-axis is title. | CREATE TABLE film_market_estimation (Estimation_ID int,Low_Estimate real,High_Estimate real,Film_ID int,Type text,Market_ID int,Year int)CREATE TABLE market (Market_ID int,Country text,Number_cities int)CREATE TABLE film (Film_ID int,Title text,Studio text,Director text,Gross_in_dollar int) | SELECT Title, COUNT(Title) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type, Title |
Name the surface for nathalie tauziat | CREATE TABLE table_27019 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Surface" FROM table_27019 WHERE "Partner" = 'Nathalie Tauziat' |
What's the record in the game where Greg Monroe (8) did the high rebounds? | CREATE TABLE table_29923 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Record" FROM table_29923 WHERE "High rebounds" = 'Greg Monroe (8)' |
When there are 3.39 million u.s viewers what is the production code? | CREATE TABLE table_22784 ("No." real,"#" real,"Title" text,"Directed by" text,"Written by" text,"U.S. air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Production code" FROM table_22784 WHERE "U.S. viewers (million)" = '3.39' |
How big was the crowd in game that featured the visiting team of north melbourne? | CREATE TABLE table_name_76 (crowd VARCHAR,away_team VARCHAR) | SELECT crowd FROM table_name_76 WHERE away_team = "north melbourne" |
What is Catalog, when the Region is UK, and when Label is Razor Records? | CREATE TABLE table_name_16 (catalog VARCHAR,region VARCHAR,label VARCHAR) | SELECT catalog FROM table_name_16 WHERE region = "uk" AND label = "razor records" |
how many hours has passed since the first time patient 8888 visited careunit tsicu on this hospital encounter? | 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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1 |
list all the airlines that fly into MKE | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE food_service ... | SELECT DISTINCT airline.airline_code FROM airline, airport, flight WHERE airport.airport_code = 'MKE' AND flight.airline_code = airline.airline_code AND flight.to_airport = airport.airport_code |
Show me a pie chart for what is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos. | CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real) | SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*) |
Show the name of track with most number of races. | CREATE TABLE race (race_id number,name text,class text,date text,track_id text)CREATE TABLE track (track_id number,name text,location text,seating number,year_opened number) | SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY COUNT(*) DESC LIMIT 1 |
What is the City, when the Prize is 880,000? | CREATE TABLE table_67351 ("Date" text,"City" text,"Event" text,"Winner" text,"Prize" text) | SELECT "City" FROM table_67351 WHERE "Prize" = '€880,000' |
When is the rhel release date when scientific linux release is 3.0.4 | CREATE TABLE table_1500146_1 (rhel_release_date VARCHAR,scientific_linux_release VARCHAR) | SELECT rhel_release_date FROM table_1500146_1 WHERE scientific_linux_release = "3.0.4" |
List all channel names ordered by their rating in percent from big to small. | CREATE TABLE broadcast (channel_id number,program_id number,time_of_day text)CREATE TABLE broadcast_share (channel_id number,program_id number,date text,share_in_percent number)CREATE TABLE program (program_id number,name text,origin text,launch number,owner text)CREATE TABLE channel (channel_id number,name text,owner ... | SELECT name FROM channel ORDER BY rating_in_percent DESC |
What is the lowest position for bruce taylor? | CREATE TABLE table_35572 ("Position" real,"Pilot" text,"Glider" text,"Speed" text,"Distance" text) | SELECT MIN("Position") FROM table_35572 WHERE "Pilot" = 'bruce taylor' |
Can you draw the trend of the average of capacity over the openning year?, and show by the X in ascending. | 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 float)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Locatio... | SELECT Openning_year, AVG(Capacity) FROM cinema ORDER BY Openning_year |
how many patients aged below 72 years died in or before the year 2168? | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "72" AND demographic.dod_year <= "2168.0" |
Give me the comparison about the sum of ID over the Nationality , and group by attribute Nationality, could you order in descending by the Y-axis please? | 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 Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY SUM(ID) DESC |
what is the top ranked location ? | CREATE TABLE table_204_562 (id number,"no." number,"date" text,"location" text,"surface" text,"opponent in final" text,"score" text) | SELECT "location" FROM table_204_562 WHERE "no." = 1 |
What are the names of the workshop groups that have bookings with status code 'stop'? | CREATE TABLE ref_service_types (service_type_code text,parent_service_type_code text,service_type_description text)CREATE TABLE marketing_regions (marketing_region_code text,marketing_region_name text,marketing_region_descriptrion text,other_details text)CREATE TABLE bookings (booking_id number,customer_id number,works... | SELECT T2.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" |
What is the color of the planet venus? | CREATE TABLE table_180802_3 (color VARCHAR,planet VARCHAR) | SELECT color FROM table_180802_3 WHERE planet = "Venus" |
so whats the first weight of patient 002-59265 until 36 months ago? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabe... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-59265') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-36 month') ORDER BY patient.unita... |
what is the total number of publisher where first appearance is daredevil #1 | CREATE TABLE table_448 ("Character(s)" text,"First Appearance" text,"Cover Date" text,"Publisher" text,"Estimated Value" text) | SELECT COUNT("Publisher") FROM table_448 WHERE "First Appearance" = 'Daredevil #1' |
how many prescriptions have been written for potassium chl 40 meq / 1000 ml ns until 3 years ago? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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)CRE... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'potassium chl 40 meq / 1000 ml ns' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') |
For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the hire_date bin hire_date by weekday, order by the y-axis in descending. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE countries (... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) DESC |
What did the away team score when the home team scored 9.18 (72)? | CREATE TABLE table_33593 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_33593 WHERE "Home team score" = '9.18 (72)' |
Which Goals have a Name of lee dong-gook? | CREATE TABLE table_41791 ("Rank" real,"Name" text,"Years" text,"Matches" real,"Goals" real) | SELECT MAX("Goals") FROM table_41791 WHERE "Name" = 'lee dong-gook' |
Who were the runners-up in the game that was won by Cork City F.C. on 10/05/1998? | CREATE TABLE table_47613 ("Date" text,"Competition" text,"Winners" text,"Score" text,"Runners-up" text) | SELECT "Runners-up" FROM table_47613 WHERE "Winners" = 'cork city f.c.' AND "Date" = '10/05/1998' |
List the number of companies for each building in a bar chart, and show by the the number of name in descending. | CREATE TABLE buildings (id int,name text,City text,Height int,Stories int,Status text)CREATE TABLE Office_locations (building_id int,company_id int,move_in_year int)CREATE TABLE Companies (id int,name text,Headquarters text,Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value_billion t... | SELECT T2.name, COUNT(T2.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 T2.name ORDER BY COUNT(T2.name) DESC |
what's the minimum 180s value | CREATE TABLE table_18797 ("Player" text,"Played" real,"Sets Won" real,"Sets Lost" real,"Legs Won" real,"Legs Lost" real,"100+" real,"140+" real,"180s" real,"High Checkout" real,"3-dart Average" text) | SELECT MIN("180s") FROM table_18797 |
Which Date has a Record of 7 7 1? | CREATE TABLE table_name_49 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_49 WHERE record = "7–7–1" |
Mideast region host University of Tennessee is in what state? | CREATE TABLE table_40695 ("Region" text,"Host" text,"Venue" text,"City" text,"State" text) | SELECT "State" FROM table_40695 WHERE "Region" = 'mideast' AND "Host" = 'university of tennessee' |
Who were the champions in years where michigan technological university was in third place? | CREATE TABLE table_25966 ("Year" real,"Host City" text,"Host School" text,"Champion" text,"Second Place" text,"Third Place" text) | SELECT "Champion" FROM table_25966 WHERE "Third Place" = 'Michigan Technological University' |
have any organisms been found in the first sputum, tracheal specimen, microbiology test of patient 031-17834 since 132 months ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventi... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND microlab.culturesite = 'sputum, tracheal specimen' AND DATETI... |
What is the zan 1 that has 11 as the nor 1? | CREATE TABLE table_41635 ("Driver" text,"NOR 1" text,"NOR 2" text,"ZAN 1" text,"ZAN 2" text,"N\u00dcR 1" text,"N\u00dcR 2" text) | SELECT "ZAN 1" FROM table_41635 WHERE "NOR 1" = '11' |
what is the number of divorced patients who have heart valve transplant diagnoses? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.short_title = "Heart valve transplant" |
What is the sum of Markatal, when Inhabitants Per Km is less than 13, and when Area (in Km ) is 27? | CREATE TABLE table_name_47 (markatal INTEGER,inhabitants_per_km² VARCHAR,area__in_km²_ VARCHAR) | SELECT SUM(markatal) FROM table_name_47 WHERE inhabitants_per_km² < 13 AND area__in_km²_ = 27 |
Can you tell me the Score that has the Opponent of at edmonton oilers? | CREATE TABLE table_name_97 (score VARCHAR,opponent VARCHAR) | SELECT score FROM table_name_97 WHERE opponent = "at edmonton oilers" |
Which player was previously on the New York Knicks? | CREATE TABLE table_name_24 (player VARCHAR,previous_team VARCHAR) | SELECT player FROM table_name_24 WHERE previous_team = "new york knicks" |
List all the names of schools with an endowment amount smaller than or equal to 10. | CREATE TABLE endowment (endowment_id number,school_id number,donator_name text,amount number)CREATE TABLE budget (school_id number,year number,budgeted number,total_budget_percent_budgeted number,invested number,total_budget_percent_invested number,budget_invested_percent text)CREATE TABLE school (school_id text,school... | SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10 |
what is the award for the 2009 songwriter of the year? | CREATE TABLE table_68025 ("Year" real,"Result" text,"Award" text,"Category" text,"Nominated work" text) | SELECT "Award" FROM table_68025 WHERE "Year" = '2009' AND "Category" = 'songwriter of the year' |
What was the date of the home game for Colorado? | CREATE TABLE table_name_67 (date VARCHAR,home VARCHAR) | SELECT date FROM table_name_67 WHERE home = "colorado" |
What tournament is in Arizona? | CREATE TABLE table_name_70 (tournament VARCHAR,location VARCHAR) | SELECT tournament FROM table_name_70 WHERE location = "arizona" |
What years did Troy Hudson play for the Jazz? | CREATE TABLE table_name_29 (years_for_jazz VARCHAR,player VARCHAR) | SELECT years_for_jazz FROM table_name_29 WHERE player = "troy hudson" |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of manager_id bin hire_date by time, and visualize them by a bar chart. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
What was the loss of the Mariners game when they had a record of 21-34? | CREATE TABLE table_name_98 (loss VARCHAR,record VARCHAR) | SELECT loss FROM table_name_98 WHERE record = "21-34" |
What circuit did marlboro team penske win with an unknown fastest lap? | CREATE TABLE table_name_67 (circuit VARCHAR,winning_team VARCHAR,fastest_lap VARCHAR) | SELECT circuit FROM table_name_67 WHERE winning_team = "marlboro team penske" AND fastest_lap = "unknown" |
Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000. | CREATE TABLE Products (Product_Type_Code VARCHAR,Product_Price INTEGER) | SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000 |
How many locations have been used for ballparks named Memorial Stadium? | CREATE TABLE table_23384 ("Ballpark" text,"Location" text,"Team" text,"Opened" real,"Closed" real,"Demod" real,"Current Status" text) | SELECT COUNT("Location") FROM table_23384 WHERE "Ballpark" = 'Memorial Stadium' |
What was the Finish when NL was the League, the Percentage was under 0.726, the Year was larger than 1897, and the Franchies was the Pittsburgh Pirates? | CREATE TABLE table_name_22 (finish VARCHAR,franchise VARCHAR,year VARCHAR,league VARCHAR,percentage VARCHAR) | SELECT finish FROM table_name_22 WHERE league = "nl" AND percentage < 0.726 AND year > 1897 AND franchise = "pittsburgh pirates" |
pregnant female with pre _ gestational hypertension. | CREATE TABLE table_train_253 ("id" int,"pregnancy_or_lactation" bool,"pre_eclampsia" bool,"acute_ischemia" bool,"pre_gestational_hypertension" bool,"diabetic" string,"smoking" bool,"coronary_artery_disease_cad" bool,"NOUSE" float) | SELECT * FROM table_train_253 WHERE pregnancy_or_lactation = 1 AND pre_gestational_hypertension = 1 |
is the respiration in patient 021-246447 normal on 12/15/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 medication (medicationid number,patientunitstayid number,drugname text,dos... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-246447')) AND vitalperiodic.respiration BETWEEN respiration_lowe... |
Find the names of all swimmers, sorted by their 100 meter scores in ascending order. | CREATE TABLE swimmer (id number,name text,nationality text,meter_100 number,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,time text)CREATE TABLE stadium (id number,name text,capacity number,city text,country text,opening_year number)CREATE TABLE record (id number,result text,... | SELECT name FROM swimmer ORDER BY meter_100 |
What is the highest Points in Position 2 with more than 3 Drawn games? | CREATE TABLE table_41933 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MAX("Points") FROM table_41933 WHERE "Position" = '2' AND "Drawn" > '3' |
what is gender and drug code of subject id 2560? | 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 demographic.gender, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.