table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_67360 ( "Image" real, "Smith" text, "Ashmolean" real, "Foster" real, "Hahland" real, "Dinsmoor" text, "Hofkes-Brukker" text, "Harrison" text, "Cooper" text, "BM/Corbett" text )
What is the smith with a 16 ashmolean?
SELECT "Smith" FROM table_67360 WHERE "Ashmolean" = '16'
CREATE TABLE table_name_73 ( bronze INTEGER, nation VARCHAR, total VARCHAR )
What is the highest Bronze, when Nation is 'South Africa', and when Total is less than 20?
SELECT MAX(bronze) FROM table_name_73 WHERE nation = "south africa" AND total < 20
CREATE TABLE table_8794 ( "Rank" real, "City" text, "Population" real, "Country" text, "Area (km\u00b2)" real )
Which rank had a population of 7,069,000?
SELECT COUNT("Rank") FROM table_8794 WHERE "Population" = '7,069,000'
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text )
what hospital in los angeles county providing hospital beds specifically for rehabilitation is ranked at least among the top 10 hospitals ?
SELECT "hospital" FROM table_203_216 WHERE "county" = 'los angeles' AND "type of hospital" = 'rehabilitaion' AND "rank" <= 10
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
i need a flight from TORONTO to MONTREAL reaching MONTREAL early on friday
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, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 25 AND da...
CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country text, active varchar(2) ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation bigint, iata character varc...
Find the altitude (or elevation) of the airports in the city of New York with a bar chart, could you display in asc by the X?
SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY name
CREATE TABLE table_78113 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
Which Res has a Method of decision (unanimous) and an Opponent of Wataru Sakata?
SELECT "Res." FROM table_78113 WHERE "Method" = 'decision (unanimous)' AND "Opponent" = 'wataru sakata'
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
A bar chart about what are the nationalities and their average ages of journalists?, I want to rank by the x axis from low to high.
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality
CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE purchase ( member_id number, branch_id text, year text, total...
What is the membership level with the most people?
SELECT level FROM member GROUP BY level ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, oth...
How many credit cards does customer Blanche Huels have?
SELECT COUNT(*) FROM customers_cards AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Blanche" AND T2.customer_last_name = "Huels" AND T1.card_type_code = "Credit"
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_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
does patient 51497 come to the hospital during this year?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 51497 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
By taking which courses in Spring or Summer , my ULCS requirement will be satisfied ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0...
CREATE TABLE table_52191 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the home team at Princes Park when the attendance was more than 30,848?
SELECT "Home team" FROM table_52191 WHERE "Crowd" > '30,848' AND "Venue" = 'princes park'
CREATE TABLE table_name_67 ( tournament VARCHAR )
Which tournament had the result of a W in 2009?
SELECT tournament FROM table_name_67 WHERE 2009 = "w"
CREATE TABLE table_1342198_18 ( candidates VARCHAR, district VARCHAR )
Who is the candidate wehre district is louisiana 1?
SELECT candidates FROM table_1342198_18 WHERE district = "Louisiana 1"
CREATE TABLE table_76658 ( "Season" text, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F.L." text, "Podiums" text, "Points" text, "Position" text )
What is the number of poles with 104 points?
SELECT "Poles" FROM table_76658 WHERE "Points" = '104'
CREATE TABLE table_2517159_1 ( last_appearance VARCHAR, name_of_bowl VARCHAR )
Name the last appearance for music city bowl
SELECT last_appearance FROM table_2517159_1 WHERE name_of_bowl = "Music City Bowl"
CREATE TABLE table_6029 ( "National team" text, "Club" text, "Season" text, "Apps" real, "Goals" real )
In what Season does the Internazionale Club have more than 2 Apps?
SELECT "Season" FROM table_6029 WHERE "Apps" > '2' AND "Club" = 'internazionale'
CREATE TABLE table_47299 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the away team for the home team wigan athletic?
SELECT "Away team" FROM table_47299 WHERE "Home team" = 'wigan athletic'
CREATE TABLE table_36659 ( "Season" real, "Driver" text, "Team" text, "Tyre" text, "Points" real )
What team won after 2008?
SELECT "Team" FROM table_36659 WHERE "Season" > '2008'
CREATE TABLE table_9092 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the record with the opponent as Carlton Jones?
SELECT "Record" FROM table_9092 WHERE "Opponent" = 'carlton jones'
CREATE TABLE table_71015 ( "Competing entities" text, "First held" real, "Current holder" text, "Next" text, "Held every" text )
Can you tell me the Competing entities that has the First held smaller than 1970?
SELECT "Competing entities" FROM table_71015 WHERE "First held" < '1970'
CREATE TABLE table_14999 ( "No.1" text, "No.2" text, "No.3" text, "No.4" text, "No.5" text, "No.6" text, "No.7" text, "No.8" text, "No.9" text, "No.10" text, "FINAL" text )
Who was number 9 that had a number 7 of Joana and a Final of Pedro?
SELECT "No.9" FROM table_14999 WHERE "No.7" = 'joana' AND "FINAL" = 'pedro'
CREATE TABLE table_57846 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who built the grid 2 car?
SELECT "Constructor" FROM table_57846 WHERE "Grid" = '2'
CREATE TABLE table_8870 ( "Name" text, "Nationality" text, "Position" text, "Crewe Alexandra career" text, "Appearances" real, "Goals" real )
What is the position when the Crewe Alexandra career is 1988 1990, with 31 goals?
SELECT "Position" FROM table_8870 WHERE "Crewe Alexandra career" = '1988–1990' AND "Goals" = '31'
CREATE TABLE shipments ( order_id VARCHAR, shipment_tracking_number VARCHAR )
Find the id of the order whose shipment tracking number is '3452'.
SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"
CREATE TABLE table_name_84 ( form_factor VARCHAR, introduced VARCHAR, controller VARCHAR, capacities__gb_ VARCHAR )
Which value for Form factor has Sandforce with Capacity 80/120/180/240/360/480 introduced in July 2013?
SELECT form_factor FROM table_name_84 WHERE controller = "sandforce" AND capacities__gb_ = "80/120/180/240/360/480" AND introduced = "july 2013"
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Users (with minimum rep) ranked by Median Post Score. Under construction
SELECT OwnerUserId AS "user_link", AVG(Score) AS MedianScore FROM (SELECT OwnerUserId, Score, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY Score) AS RowAsc, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY Score DESC) AS RowDesc FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE Users.Reputation >=...
CREATE TABLE table_14665 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
What is the extra result of the 4th game?
SELECT "Extra" FROM table_14665 WHERE "Result" = '4th'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
when was the first time until 12/21/2104 patient 006-78314's respiration was greater than 27.0?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-78314')) AND vitalperiodic.respiration > 27.0 A...
CREATE TABLE table_76197 ( "Team" text, "Sets+" real, "Sets\u2013" real, "Points+" real, "Points\u2013" real )
What is the highest Points+ number that has a Sets+ number larger than 45, a Sets- number larger than 9, and a Points- number smaller than 1066?
SELECT MAX("Points+") FROM table_76197 WHERE "Sets+" > '45' AND "Points\u2013" < '1066' AND "Sets\u2013" > '9'
CREATE TABLE table_name_67 ( city_of_license VARCHAR, erp_w VARCHAR )
What City of license has a ERP W of 2,000?
SELECT city_of_license FROM table_name_67 WHERE erp_w = "2,000"
CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pages_per_minute_color real, max_page_size text, interface text ) CREATE TABLE store_district ( Store_ID int, District_ID int ) CREAT...
Find the name and population of districts with population between 200000 and 200000 Show a bar chart, display in asc by the District_name.
SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY District_name
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 lab ( labid numbe...
what was the top four most common diagnosis?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
find out the type of admission of patient with patient id 3343.
SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "3343"
CREATE TABLE table_204_323 ( id number, "year" number, "film" text, "function" text, "notes" text )
how long was the film schooled out before beginning blue ?
SELECT (SELECT "year" FROM table_204_323 WHERE "film" = 'beginning blue') - (SELECT "year" FROM table_204_323 WHERE "film" = 'schooled')
CREATE TABLE table_8452 ( "Player" text, "Team" text, "Matches" real, "Wickets" real, "Average" real, "Best Bowling" text )
what is the highest wickets when the matches is less than 5, player is jim laker and average is more than 52.44?
SELECT MAX("Wickets") FROM table_8452 WHERE "Matches" < '5' AND "Player" = 'jim laker' AND "Average" > '52.44'
CREATE TABLE table_45281 ( "Series Number" real, "Number of Episodes" real, "Original Air Date" real, "DVD Region 2 release date" text, "DVD Region 1 release date" text )
What's the sum of the number of episodes that originally aired after 1991 with a series number smaller than 21 and a DVD Region 2 release date of 26 march 2012?
SELECT SUM("Number of Episodes") FROM table_45281 WHERE "Original Air Date" > '1991' AND "Series Number" < '21' AND "DVD Region 2 release date" = '26 march 2012'
CREATE TABLE Research_Staff ( staff_id INTEGER, employer_organisation_id INTEGER, staff_details VARCHAR(255) ) CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details VARCHAR(255) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(...
Find the organisation ids and details of the organisations which are involved i Visualize by bar chart, and sort in ascending by the organisation_details.
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 ORDER BY T2.organisation_details
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 aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar,...
could you show me all flights from MONTREAL to CHARLOTTE
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MONTREAL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARL...
CREATE TABLE table_36342 ( "Wind Farm" text, "Scheduled" text, "Capacity (MW)" real, "Turbines" real, "Type" text, "Location" text )
What is the type of turbine having fewer than 17 units and located in County Laois?
SELECT "Type" FROM table_36342 WHERE "Turbines" < '17' AND "Location" = 'county laois'
CREATE TABLE table_name_94 ( place VARCHAR, player VARCHAR )
Where has Jimmy Demaret as a player?
SELECT place FROM table_name_94 WHERE player = "jimmy demaret"
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 varch...
For Reading Hebrew Literature , who has taught , is currently teaching or will teach the class ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L...
CREATE TABLE table_65314 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2003)" real )
What is the Constituency Number of Total:?
SELECT "Constituency number" FROM table_65314 WHERE "Name" = 'total:'
CREATE TABLE table_204_394 ( id number, "year" number, "album" text, "label" text, "peak chart\npositions\nus" number, "peak chart\npositions\nus r&b" number )
name an album released before celebration .
SELECT "album" FROM table_204_394 WHERE "year" < (SELECT "year" FROM table_204_394 WHERE "album" = 'celebration') ORDER BY "year" DESC LIMIT 1
CREATE TABLE table_57210 ( "Pick" real, "Round" real, "Player" text, "Position" text, "School" text )
What was the lowest round that Melvin Johnson played?
SELECT MIN("Round") FROM table_57210 WHERE "Player" = 'melvin johnson'
CREATE TABLE table_name_64 ( puchat_ligi INTEGER, uefa_cup VARCHAR, player VARCHAR )
Which Puchat Ligi has a UEFA Cup smaller than 2, and a Player of takesure chinyama?
SELECT MIN(puchat_ligi) FROM table_name_64 WHERE uefa_cup < 2 AND player = "takesure chinyama"
CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE ...
Find the number of patients' prescriptions physician John Dorian made.
SELECT COUNT(T1.ssn) FROM patient AS T1 JOIN prescribes AS T2 ON T1.ssn = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = "John Dorian"
CREATE TABLE table_name_60 ( runner_up VARCHAR, tournament VARCHAR )
Who was the runner up in the konica san jose classic Tournament?
SELECT runner_up FROM table_name_60 WHERE tournament = "konica san jose classic"
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, ...
provide the number of patients whose admission location is emergency room admit and drug name is amiodarone hcl?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.drug = "Amiodarone HCl"
CREATE TABLE table_24334163_1 ( Winners INTEGER, total_money_won VARCHAR )
What is the latest amount of won legs in the payoffs when the prize money was 2,350?
SELECT MAX(Winners) AS play_off_legs_won FROM table_24334163_1 WHERE total_money_won = "£2,350"
CREATE TABLE table_76220 ( "Date" text, "Opponent" text, "Score" text, "Leading Scorer" text, "Attendance" text, "Series" text )
Who is the opponent of the game with a tied 1-1 series and becky hammon (14) as the leading scorer?
SELECT "Opponent" FROM table_76220 WHERE "Series" = 'tied 1-1' AND "Leading Scorer" = 'becky hammon (14)'
CREATE TABLE table_20421 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "Who knows the most about the guest host? panelists" text )
List the date when Jeremy Edwards and Grace Adams-Short were the panelists.
SELECT "Air Date" FROM table_20421 WHERE "Who knows the most about the guest host? panelists" = 'Jeremy Edwards and Grace Adams-Short'
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE table_5125 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
What date has friendly as the type of game, france as an opponent, and paris, france as the city?
SELECT "Date" FROM table_5125 WHERE "Type of game" = 'friendly' AND "Opponent" = 'france' AND "City" = 'paris, france'
CREATE TABLE table_39650 ( "Pick" real, "Player" text, "Nationality" text, "WNBA Team" text, "School/Club Team" text )
What school or club team did the player chosen for the Sacramento Monarchs play for?
SELECT "School/Club Team" FROM table_39650 WHERE "WNBA Team" = 'sacramento monarchs'
CREATE TABLE table_58646 ( "Season" real, "Date" text, "Winning Driver" text, "Car #" real, "Sponsor" text, "Make" text, "Distance" text, "Avg Speed" text, "Margin of Victory" text )
What is the lowest car number sponsored by UPS before 2001?
SELECT MIN("Car #") FROM table_58646 WHERE "Sponsor" = 'ups' AND "Season" < '2001'
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 )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of founder and the average of code , and group by attribute founder, list by the names in desc.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
CREATE TABLE table_50126 ( "Award" text, "Year" real, "Category" text, "Work" text, "Result" text )
what is the work when the result is won and the year is before 2003?
SELECT "Work" FROM table_50126 WHERE "Result" = 'won' AND "Year" < '2003'
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, ...
show me BOSTON to OAKLAND flights
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND...
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptio...
has patient 26612 been prescribed a drug until 2104?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y', prescriptions.startdate) <= '2104'
CREATE TABLE table_name_86 ( model_number VARCHAR, voltage VARCHAR, frequency VARCHAR )
What is the Model Number, when the Voltage is 3.45 V, and when the Frequency is 133 MHZ?
SELECT model_number FROM table_name_86 WHERE voltage = "3.45 v" AND frequency = "133 mhz"
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 d_labitems ( row_id number, itemid number, label te...
what are the four most frequently given lab tests for patients who had previously received 1 int mam-cor art bypass in the same hospital visit since 2102?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
CREATE TABLE table_26965 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text )
Which player had 252 appearances
SELECT "Name" FROM table_26965 WHERE "Appearances\u00b9" = '252'
CREATE TABLE table_204_929 ( id number, "location" text, "name of mill and\ngrid reference" text, "type" text, "maps" text, "first mention\nor built" text, "last mention\nor demise" number )
what is the name of the only c mill located in colney health ?
SELECT "name of mill and\ngrid reference" FROM table_204_929 WHERE "location" = 'colney heath'
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 text, route text, drug_dose text ) C...
how many patients whose ethnicity is black/african american and year of birth is less than 2064?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2064"
CREATE TABLE table_104858_1 ( admits_boys_girls VARCHAR, year_member_organization_was_founded VARCHAR, name_of_member_organization VARCHAR )
Does the Ghana Scout Association (founded in 1912) admit boys, girls, or both?
SELECT admits_boys_girls FROM table_104858_1 WHERE year_member_organization_was_founded = "1912" AND name_of_member_organization = "The Ghana Scout Association"
CREATE TABLE table_name_48 ( driver VARCHAR, laps VARCHAR )
I want the Driver with Laps of 20
SELECT driver FROM table_name_48 WHERE laps = 20
CREATE TABLE circulation_history ( document_id number, draft_number number, copy_number number, employee_id number ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, other_details text ) CREATE TABLE documents_mailed ( document_id number, mailed_...
What is the receipt date of the document with id 3?
SELECT receipt_date FROM documents WHERE document_id = 3
CREATE TABLE table_name_25 ( game INTEGER, attendance INTEGER )
Attendance larger than 55,189 is which average game?
SELECT AVG(game) FROM table_name_25 WHERE attendance > 55 OFFSET 189
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Ref_Locations ( Location_Code...
How many documents in different starting date? Return a bar chart binning starting date by weekday interval, I want to sort y-axis in descending order.
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY COUNT(Date_in_Location_From) DESC
CREATE TABLE table_2523809_1 ( coverage VARCHAR, callsign VARCHAR )
Which city did kpnz-tv provide coverage for?
SELECT coverage FROM table_2523809_1 WHERE callsign = "KPNZ-TV"
CREATE TABLE table_24776075_2 ( final_score VARCHAR, date VARCHAR )
How many final score datas are there on Sunday, May 12?
SELECT COUNT(final_score) FROM table_24776075_2 WHERE date = "Sunday, May 12"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
what are the four most frequent drugs that were prescribed within 2 months to the patients 60 or above after they had been diagnosed with septic shock - cultures pending,?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock - cultures pending') AS t1 JOIN (SELE...
CREATE TABLE table_name_82 ( team_1 VARCHAR )
What was the 2nd leg score for the match with Lesotho as team 1?
SELECT 2 AS nd_leg FROM table_name_82 WHERE team_1 = "lesotho"
CREATE TABLE table_name_91 ( engine VARCHAR, notes VARCHAR )
What is then engine when the notes state srt8?
SELECT engine FROM table_name_91 WHERE notes = "srt8"
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 text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose diagnoses icd9 code is 2749 and lab test category is chemistry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2749" AND lab."CATEGORY" = "Chemistry"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
what is insurance and discharge location of subject id 15898?
SELECT demographic.insurance, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "15898"
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) )
Compare the smallest enrollment of schools in each state using a bar chart.
SELECT cName, MIN(enr) FROM College GROUP BY state
CREATE TABLE table_71591 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the average gold for czech republic and bronze less than 1 when total is less than 14
SELECT AVG("Gold") FROM table_71591 WHERE "Total" < '14' AND "Bronze" < '1' AND "Nation" = 'czech republic'
CREATE TABLE table_name_44 ( socket VARCHAR, order_part_number VARCHAR )
What kind of Socket has a Order part number of tmrm72dam22gg?
SELECT socket FROM table_name_44 WHERE order_part_number = "tmrm72dam22gg"
CREATE TABLE table_38710 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
Which FCC info has a Frequency MHz larger than 102.3?
SELECT "FCC info" FROM table_38710 WHERE "Frequency MHz" > '102.3'
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 prescriptions...
what is minimum age of patients whose insurance is private and year of death is less than 2183?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dod_year < "2183.0"
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, ...
how many patients on sc route of drug administration were born before the year 2041?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.route = "SC"
CREATE TABLE table_48334 ( "Model Number" text, "Clock Speed" text, "L2 Cache" text, "FSB Speed" text, "Clock Multiplier" text, "Voltage Range" text, "Socket" text, "Release Date" text )
Which Release Date has a Voltage Range of 1.148 v - 1.196 v?
SELECT "Release Date" FROM table_48334 WHERE "Voltage Range" = '1.148 v - 1.196 v'
CREATE TABLE table_name_88 ( year VARCHAR, standalone VARCHAR )
In what year is Zaxxon the Standalone?
SELECT year FROM table_name_88 WHERE standalone = "zaxxon"
CREATE TABLE table_60258 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which Place has a Player of justin leonard?
SELECT "Place" FROM table_60258 WHERE "Player" = 'justin leonard'
CREATE TABLE table_name_65 ( stadium VARCHAR, date VARCHAR )
What stadium was the game played in on november 20?
SELECT stadium FROM table_name_65 WHERE date = "november 20"
CREATE TABLE table_15059783_1 ( team_classification VARCHAR, combination_classification VARCHAR, points_classification VARCHAR )
How many teams have a combination classification of Alejandro Valverde and a Points classification of Alessandro Petacchi?
SELECT COUNT(team_classification) FROM table_15059783_1 WHERE combination_classification = "Alejandro Valverde" AND points_classification = "Alessandro Petacchi"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many married patients have procedure icd9 code 3611?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "3611"
CREATE TABLE table_38240 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
What was the record at the game with a result of W 13-12 after week 4?
SELECT "Record" FROM table_38240 WHERE "Week" > '4' AND "Result" = 'w 13-12'
CREATE TABLE table_79100 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real )
What is the total number of goals that has been played less than 38 times?
SELECT COUNT("Goals For") FROM table_79100 WHERE "Played" < '38'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
how many patients received psychiatry consultation after the first procedure of the head ct scan in the same hospital visit until 2104?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'head ct scan' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t...
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number )
What are the names of the schools with the top 3 largest class sizes?
SELECT cname FROM college ORDER BY enr DESC LIMIT 3
CREATE TABLE table_34554 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 1st leg of Team 2 PSV Eindhoven?
SELECT "1st leg" FROM table_34554 WHERE "Team 2" = 'psv eindhoven'
CREATE TABLE table_77104 ( "Rank" real, "Name" text, "Stories" real, "Height" text, "Year Completed" text, "Primary Purpose" text, "City" text )
What is the height of the EMC Insurance Building in Des Moines?
SELECT "Height" FROM table_77104 WHERE "City" = 'des moines' AND "Name" = 'emc insurance building'
CREATE TABLE table_name_50 ( downhill_points INTEGER, total VARCHAR )
What are the downhill points for the skier with total of 9.31 points?
SELECT SUM(downhill_points) FROM table_name_50 WHERE total = "9.31"
CREATE TABLE table_10620 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where does Melbourne play home games?
SELECT "Venue" FROM table_10620 WHERE "Home team" = 'melbourne'
CREATE TABLE table_name_99 ( socialist_workers_ticket VARCHAR, republican_ticket VARCHAR )
When Republican ticket was John P. Lomenzo who ran for the Socialist Workers ticket?
SELECT socialist_workers_ticket FROM table_name_99 WHERE republican_ticket = "john p. lomenzo"
CREATE TABLE table_550 ( "Championship" text, "Champion(s)" text, "Previous champion(s)" text, "Date Won" text, "Location" text )
Who are the champions that have won at Aguas Buenas, Puerto Rico?
SELECT "Champion(s)" FROM table_550 WHERE "Location" = 'Aguas Buenas, Puerto Rico'